Bartosz Naskręcki
Chapters 10--15
| Year | Change | Effect |
|---|---|---|
| 1930 | Plugboard added | Key space × \(1.5 \times 10^{14}\) |
| 1938 | Rotor set 3 → 5 | Rotor orders 6 → 60 |
| 1942 | Naval M4 (4 rotors) | Key space × \(26 \times 2\) |
Signal path:
Keyboard ⟶ \(P\) ⟶ \(R_1\) ⟶ \(R_2\) ⟶ \(R_3\) ⟶ \(U\) ⟶ \(R_3^{-1}\) ⟶ \(R_2^{-1}\) ⟶ \(R_1^{-1}\) ⟶ \(P\) ⟶ Lampboard
Rotors step before each character is encrypted -- the permutation changes with every keypress.
| Component | Choices | Count |
|---|---|---|
| Rotor selection (3 from 5) | \(5 \times 4 \times 3\) | 60 |
| Rotor positions | \(26^3\) | 17,576 |
| Ring settings | \(26^3\) (one redundant) | 17,576 |
| Plugboard (10 pairs) | \(\frac{26!}{6!\,2^{10}\,10!}\) | 150,738,274,937,250 |
Total keyspace: \(\approx 1.59 \times 10^{20}\) ≈ 67 bits
The plugboard alone contributes \(\approx 47\) bits -- yet its involutory structure was exploitable. The key insight: mathematical structure, not raw key size, determines security.
ABCABCABCDMQVBNKey insight: With ~60--100 intercepted messages per day, all three permutations could be fully determined (coupon collector problem on 26 letters).
Rejewski's method:
The number of distinct cycle structures in \(S_{26}\) is \(p(26) = 2{,}436\) (partitions of 26). Using the triple \((A, B, C)\) together yields near-unique identification of the Grundstellung among the \(26^3 = 17{,}576\) possibilities.
| Concept | Key Point |
|---|---|
| Doubled message key | Created observable pairs \((X_1,X_4)\), \((X_2,X_5)\), \((X_3,X_6)\) |
| Characteristic permutations | \(A = E_4 \circ E_1^{-1}\) -- observable from intercepts alone |
| Cycle structure | Fingerprint preserved under conjugation by plugboard |
| Catalog method | Pre-compute for all \(26^3\) positions; match fingerprint |
| Attack type | Ciphertext-only -- no known plaintext needed |
"Pure mathematics unwrapped the riddle" -- the attack relied on abstract algebra (permutation groups), not on guessed plaintext.
Crib sources: weather reports (Wetterbericht), routine phrases ("keine besonderen Ereignisse"), re-encipherments.
| Date | Event |
|---|---|
| Jul 1939 | Pyry conference: Polish handover to Britain |
| Mar 1940 | First Bombe ("Victory") operational |
| Aug 1940 | Welchman's diagonal board added |
| Jun 1944 | Ultra intelligence supports D-Day |
| 1945 | 200+ Bombes, decoding 4,000+ messages/day |
Bombe complexity: \(17{,}576 \times 26 \times 60 \approx 2.7 \times 10^7\) tests. Intelligence from Enigma decrypts was codenamed Ultra.
Conditional entropy:
$$H(X \mid Y) = -\sum_{x,y} p(x,y) \log_2 p(x \mid y)$$
Mutual information:
$$I(X; Y) = H(X) - H(X \mid Y)$$
Examples: Fair coin \(H = 1\) bit. Uniform over 26 letters: \(H = \log_2 26 \approx 4.70\) bits.
English redundancy:
| Cipher | \(H(K)\) | \(n_0\) |
|---|---|---|
| Shift | 4.7 | 1.4 |
| Vigenere (m=10) | 47.0 | 13.8 |
| Substitution | 88.4 | 26.0 |
| Enigma | 67.1 | 19.7 |
Spurious keys decay exponentially: \(\approx |\mathcal{K}| \cdot 2^{-nD} - 1\). Even substitution ciphers (\(26!\) keys) are uniquely breakable from ~25 characters.
| Concept | Key Point |
|---|---|
| Perfect secrecy | \(\Pr[P=p \mid C=c] = \Pr[P=p]\); ciphertext reveals nothing |
| Shannon entropy | \(H(X) = -\sum p(x)\log_2 p(x)\); average uncertainty in bits |
| OTP theorem | Achieves perfect secrecy with \(|\mathcal{K}| = |\mathcal{P}|\) |
| Lower bound | Perfect secrecy requires \(|\mathcal{K}| \geq |\mathcal{P}|\) |
| Unicity distance | \(n_0 = H(K)/D\); how much ciphertext determines the key |
| Fundamental tension | Unconditional security ⇔ impractical keys |
This tension motivated the shift from information-theoretic security to computational security -- the foundation of modern cryptography.
| In | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Out | E | 4 | D | 1 | 2 | F | B | 8 | 3 | A | 6 | C | 5 | 9 | 0 | 7 |
Strict Avalanche Criterion:
Flipping any single input bit should flip each output bit with probability \(\frac{1}{2}\).
A single S-box cannot satisfy SAC perfectly (only 4 bits), but after multiple SPN rounds the full cipher achieves it.
| Design Element | Purpose | Achieves |
|---|---|---|
| S-box (substitution) | Nonlinear mapping | Confusion |
| P-box (permutation) | Bit rearrangement | Diffusion |
| Key mixing (XOR) | Key dependency | Key sensitivity |
| Multiple rounds | Iterated composition | Full avalanche |
| Key schedule | Round key derivation | Key bit spreading |
Heys P-box: \(\pi(i) = 4(i \bmod 4) + \lfloor i/4 \rfloor\) -- matrix transpose ensures each S-box feeds into four different S-boxes in the next round.
This is the crucial advantage of the Feistel structure: the round function \(F\) can be any function at all (not necessarily invertible), and the overall cipher remains a bijection. DES uses 16 Feistel rounds.
| Year | Attack | Complexity |
|---|---|---|
| 1993 | Matsui's linear cryptanalysis | \(2^{43}\) known plaintexts |
| 1998 | EFF Deep Crack (brute force) | 56 hours, \$250K hardware |
| 1999 | Deep Crack + distributed.net | 22 hours |
The diffusion heatmap visualizes which output bits are affected by flipping each input bit, for different numbers of DES rounds:
| Concept | Key Point |
|---|---|
| Structure | 16-round Feistel network, 64-bit blocks |
| Key length | 56 bits effective (too small by modern standards) |
| Round function | Expansion → XOR → 8 S-boxes → P-permutation |
| Feistel property | Always invertible, regardless of \(F\) |
| Weak keys | 4 keys where \(E_K(E_K(P)) = P\) |
| Complementation | \(E_K(P) = \overline{E_{\bar{K}}(\bar{P})}\) halves search |
| Avalanche | Full diffusion by round 5--6 |
DES is now obsolete (replaced by AES in 2001), but its Feistel structure influenced every subsequent block cipher. Understanding DES is essential for understanding linear and differential cryptanalysis.