Java
Java copied to clipboard
[OTHER] Java Implementation of Playfair Cipher
What would you like to share?
Issue: https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/ciphers/ProductCipher.java The shifting of the characters is constant, but it should be determined by user input.
Solution: Substitute '5' for 'n'
Additional information
`System.out.println("Enter a number: "); int n = sc.nextInt();
// Substitution encryption
StringBuffer substitutionOutput = new StringBuffer();
for (int i = 0; i < substitutionInput.length(); i++) {
char c = substitutionInput.charAt(i);
substitutionOutput.append((char) (c + 5)); // <---- should be n instead of 5
} ...
StringBuffer plaintext = new StringBuffer();
for (int i = 0; i < transpositionPlaintext.length(); i++) {
char c = transpositionPlaintext.charAt(i);
plaintext.append((char) (c - 5)); // <---- same here
}
Is it still open? Shall I work on it?
hie are you working on it? is it open?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!
Please reopen this issue once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!