Anonymous user
Playfair cipher: Difference between revisions
→{{header|Java}}
(→{{header|zkl}}: dawn of the brain dead) |
|||
Line 281:
String jti = prompt("Replace J with I? y/n: ", sc, 1);
boolean
createTable(key, JtoI);
String enc = encode(prepareText(txt,
System.out.printf("%nEncoded message: %n%s%n", enc);
Line 300:
}
private static String prepareText(String s, boolean
s = s.toUpperCase().replaceAll("[^A-Z]", "");
return
}
private static void createTable(String key, boolean
charTable = new char[5][5];
positions = new Point[26];
String s = prepareText(key + "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
int len = s.length();
|