p = plaintext letter, c = ciphertext letter, k = key
Caesar used k = 3: ATTACK AT DAWN → DWWDFN DW GDZQ
Message k =
→
key (a, b): gcd(a, 26) = 1 so that a−1 exists, 0 ≤ b ≤ 25
(a, b) = (5, 8): ATTACK AT DAWN → IZZISG IZ XIOV
Message a b
→
26! ≈ 4 × 1026 keys
At 109 keys per second, trying them all takes ≈ 1.3 × 1010 years — about the age of the universe.
English: E T A O I N S H R D L C U M W F G Y P B V K J X Q Z
Plaintext keyword
→
Row = key letter, column = plaintext letter. Each row is a Caesar shift.
LJS appears 6 times. Each time it is “the”, encrypted by the same part of the keyword.
| position | 65 | 80 | 120 | 190 | 260 | 280 |
|---|---|---|---|---|---|---|
| distance | 15 | 40 | 70 | 70 | 20 |
All distances are multiples of 5 ⇒ ℓ = 5
Write the ciphertext twice, shift the copy by d, and count the positions where the letters match.
Write the ciphertext in rows of 5.
Every letter in a column was shifted by the same key letter.
So each column is a Caesar cipher.
Choose the shift that makes the English frequencies (outline) closest to the column’s letter distribution.
Key CODES = 2, 14, 3, 4, 18
After every key press the rotors turn, so the next letter is encrypted with a different substitution.
Polish mathematicians
Rejewski, Różycki and Zygalski
first break Enigma
Poland shares its methods
with Britain and France
At Bletchley Park, Turing’s
Bombe machine starts work
The message probably contains WETTERBERICHT (“weather report”). A letter never encrypts to itself, so the crib cannot sit where any of its letters matches the ciphertext.
The key is truly random, as long as the message, and used only once.
Plaintext Key
Theorem (Shannon, 1949). If the key K is chosen uniformly at random from all n-letter keys, independently of the plaintext P, and is used for only one message, then for all plaintexts p and ciphertexts c
Seeing the ciphertext leaves every plaintext exactly as likely as it was before.
Pr(P = 0) = p0, Pr(P = 1) = p1 = 1 − p0
Key K ∈ {0, 1}, each with probability ½, independent of P
Ciphertext C = P + K (mod 2)
Similarly:
So Pr(P = p | C = c) = Pr(P = p) for all p, c. ∎
C1 − C2 = P1 − P2
The key cancels out. Guess a word in one message and you can read the other.