Code
Reading a text without its key: naming the cipher, peeling off encodings, counting letters, measuring an unknown script, breaking nomenclators, reading messages in depth, replaying the Enigma breaks, checking anagrams.
Cipher Identifier
Scores a text against 38 possibilities — encodings, classical ciphers from Caesar to ADFGVX and Enigma, hash formats — by character set, length, index of coincidence and letter statistics, auto-solves 11 cipher types and opens the matching tool. For letters or digits it also ranks the ACA’s cipher types by BION’s nine statistics (2005), set against each type’s values measured here. William Friedman introduced the index of coincidence in 1922.
Terms
History, how it works, how it was checked, limits
History
William F. Friedman introduced the index of coincidence in Riverbank Publication No. 22 (1922). In the American Cryptogram Association’s journal, The Cryptogram, BION (William Mason) published nine statistics for telling its types apart, “Reference Statistics”, in May–June 2005.
How it works
Formats are tested on any text: Morse, tap code, binary, hex, Base32, Base58, Base64, Ascii85, JWTs, zero-width characters, book coordinates, hashes. From ten letters, ciphers are judged by the index of coincidence, chi-squared against English after each shift and Atbash, common English pairs, the counts’ flatness, and signs such as no J; letters coinciding as random ones do, with no period, English or Playfair sign beyond what random letters show one time in twenty, are called random-like. Each rule adds or takes points; the total, 0 to 100, orders the results. Eleven are auto-solved, ranked by fluency. Encodings are also taken off. The letters and their index are drawn against English. From 40 letters or digits, the ACA card sets BION’s nine statistics against each type’s means and spreads (300 English ciphertexts a type), ranks the types by likelihood under normal curves, letters at random among them, and draws the likeliest types’ clouds. A list gives each line’s two best fits as a CSV table.
How it was checked
Forty 120-letter windows of the Declaration of Independence were enciphered as plain text, Caesar, Atbash, simple substitution, Vigenère and transposition; each kind ranks first in at least 34 of 40, Vigenère in 30, five more called random-like, as are 90 of 100 random texts; Morse, tap code, binary, hex, MD5 and padded Base32 are named; the auto-solves read rail fence, Caesar, affine, Morse, Bacon and tap code; a Vigenère ciphertext in Base64 in hex is taken out of both. The sheets’ examples of Checkerboard and Numbered Key rank first, the Nihilist Substitution’s second. The ranking is measured on 732 fresh ciphertexts of its 61 types. The true type comes first 270 times and in the first five 559; BION’s sum of deviations, 220 and 517.
The tests hold 58 checks of this tool; 1 rests on outside material:
- A print’s own example The sheets’ clear-cut examples ranked: the Checkerboard’s and the Numbered Key’s first as their own types, the Nihilist Substitution’s second, behind the Checkerboard
Limits
The figures are points of fit, not probabilities: any 32 hex digits score 96 as an MD5 hash. Letter tests and auto-solves read English only. Ciphers with larger keys are named, not broken; transposition’s auto-solve tries rail fences only. Only plain encodings are taken off; Layer Decoder searches further. The ACA card cannot tell apart types alike in all nine; its LDI and SDD use the app’s own digraph tables.
- William F. Friedman, The Index of Coincidence and Its Applications in Cryptography, Riverbank Publication No. 22 (Geneva, Illinois: Riverbank Laboratories, 1922)
- David Kahn, The Codebreakers: The Story of Secret Writing (New York: Macmillan, 1967)
- BION (William Mason), “Reference Statistics”, The Cryptogram, May–June 2005; the formulas as his Gadgets compute them