ADFGVX cipher: Difference between revisions

(New post.)
Line 2,133:
System.out.println();
final String plainText = "ATTACKAT1200AM";
System.out.println("PlaintextPlain text: " + plainText);
System.out.println();
final String encryptedText = encrypt(plainText, polybius, key);
Line 2,184:
}
// Create a key using a word from "the dictionary 'unixdict.txt"'
private static String createKey(int size) throws IOException {
if ( size < 7 || size > 12 ) {
Line 2,191:
List<String> candidates = Files.lines(Path.of("unixdict.txt"))
.filter( word -> word.length() == size )
.filter( word -> word.chars().distinct().count() == word.length() )
.filter( word -> word.chars().allMatch(Character::isLetterOrDigit) )
908

edits