Unveil

Code

Classical and machine ciphers, from Caesar’s shift and the ACA’s 62 types to Enigma and Lorenz, and text as notes: enciphered with a key, chained, many broken without one.

Shift Ciphers

Encrypts, decrypts and breaks monoalphabetic ciphers: Caesar (shift 1–25), ROT13, Atbash, affine, E(x) = (ax + b) mod 26 with gcd(a, 26) = 1, and Wolseley’s square (1871). Without the key, every shift and all 312 affine keys are ranked by fluency in a chosen language. Suetonius (Julius 56) says Caesar wrote D for A, a shift of three; Rashi reads Sheshach in Jeremiah 25:26 as Babel by Atbash.

Terms

History, how it works, how it was checked, limits

History

Suetonius (Life of Julius Caesar 56.6) says that Caesar wrote D for A, a shift of three. Atbash is a Hebrew exchange of letters that pairs the first with the last, aleph with tav; Jeremiah writes Sheshach for Babel by it (25:26), as Rashi reads the verse. ROT13, a shift of half the alphabet, undoes itself; the affine cipher multiplies before it shifts. Wolseley’s Soldier’s Pocket-Book (1871) folds a key-word’s alphabet through the centre of a square.

How it works

The ciphers work on A–Z, keeping case and passing everything else through. Caesar shifts by 1–25; ROT13 shifts by 13 and Atbash mirrors A↔Z, each its own inverse; the affine cipher enciphers by E(x) = (ax + b) mod 26, a coprime to 26, and deciphers by D(x) = a⁻¹(x − b) mod 26; Wolseley’s square undoes itself. A disk draws the cipher: the plain alphabet round the outer ring, round the inner the letters its transform writes for A to Z, a letter of the text lit at each step. Without the key, every key is tried as the text is typed and ranked by fluency, 0–100 on the chosen language’s quadgrams, one of six, and drawn in its order: the 26 shifts as a strip, the affine cipher’s 312 keys as a grid of a by b; Use puts a key in the fields.

How it was checked

The tests run the shared functions: the affine cipher comes back whole for every valid a, refuses a = 13, and takes 15 as the inverse of 7 modulo 26. Cipher Identifier’s searches use the same functions and score, and the quick rankers score exactly as the solvers do. On “Wkh vhfuhw phhwlqj lv dw gdzq”, a shift of three, of 26 shifts the third reads best, and of the 312 affine keys a = 5, b = 8. Every letter on the disk stands where the transform puts it, Suetonius’s shift both ways, Atbash and the affine cipher. Wolseley’s WE ATTACK AT NOON gives his IVXRRXOGXRDCCD.

The tests hold 35 checks of this tool; 6 rest on outside material:

  • Another’s computation ROT13 gives what Python’s rot_13 codec gives, both ways at once
  • A print’s own example Suetonius’s words (Divus Julius 56.6): A is written D, three letters on, and D read back as A
  • A print’s own example Wolseley’s square under majesty as The Soldier’s Pocket-Book prints it (1871, p. 321), row by row: M A J(I) E S / T Y B C D / F G H K L / N O P Q R / U V W X Z
  • A print’s own example … his numbers pair each space with the one opposite it through the centre, twelve pairs and the centre alone (p. 321)
  • A print’s own example Wolseley’s example (p. 322): WE ATTACK AT NOON runs in cypher IVXRRXOGXRDCCD, and back again by the same step
  • A print’s own example Wolseley’s figure cipher (p. 322): WE ATTACK AT NOON under 4,631,870 is AK DUBHCO GW OWVN, which is Gronsfeld’s cipher on Vigenère’s tab

Every tool’s checks

Limits

Only the letters A–Z move: accented letters, other scripts and digits pass through, and Atbash on Hebrew is Temurah’s. ROT13 and Atbash have no key, and Wolseley’s word is Substitution’s to find, so nothing is searched for them. A short text may read best under a wrong key. Until a language’s statistics have loaded, the ranking has only a rough English stand-in, and the other languages score nothing.