Enigma Machine
The Enigma machine was a family of German electro-mechanical rotor cipher devices invented by Arthur Scherbius in 1918 whose polyalphabetic permutations were broken mathematically by Polish Biuro Szyfrów cryptologists and mechanized at scale by British cryptanalysts at Bletchley Park.
Enigma Machine designates a series of portable electro-mechanical polyalphabetic rotor cipher machines patented by German electrical engineer Arthur Scherbius in February 1918 and adopted in modified military configurations by the German Reichswehr, Wehrmacht (Heer and Luftwaffe), and Kriegsmarine between 1926 and 1945. Built into a compact wooden-cased chassis housing a 26-key input keyboard, a battery-powered 26-bulb lampboard, a front plugboard (Steckerbrett), three or four scrambler rotors (Walzen), and a stationary reflector (Umkehrwalze), the Enigma dynamically altered its electrical substitution pathway with every keypress. Although its combinatorial keyspace exceeded 1020 configurations, algebraic invariants—most notably the reflector's reciprocal self-inverse symmetry—enabled Polish mathematician Marian Rejewski in 1932 and Alan Turing, Gordon Welchman, and colleagues at Bletchley Park from 1939 onward to mechanize modern cryptanalysis.
Electro-Mechanical Architecture and Permutation Algebra
Conjugation in the Symmetric Group S26
Depressing a letter key mechanically stepped the rightmost fast rotor by one twenty-sixth of a revolution prior to closing the direct-current lamp circuit. Over the symmetric group S26 of permutations on {A, B, …, Z} ≅ Z26, the three-rotor Wehrmacht Enigma I executed a composite permutation E defined by algebraic conjugation:
E = P−1 R1−1 R2−1 R3−1 U R3 R2 R1 P
Here P ∈ S26 denotes the front Steckerbrett (plugboard) permutation composed of p ≤ 13 dual-plug patch cords swapping disjoint pairs of letters (P = P−1). Each rotor k ∈ {1, 2, 3} (ordered right-to-left from fast to middle to slow) possessed a fixed internal 26-contact cross-wiring permutation ρk, an adjustable alphabet ring setting (Ringstellung) rk, and a visible window ground/offset position zk. Letting C(x) = (x + 1) mod 26 denote the cyclic unit shift and sk = (zk − rk) mod 26 the net rotational displacement, rotor k applied the shifted permutation Rk = C−sk ρk Csk on the forward pass toward the left and its inverse Rk−1 on the return pass back to the lampboard.
Reciprocal Involution and the Non-Self-Encryption Flaw
At the left end of the spindle stood the Umkehrwalze (reflector U, such as UKW-B or UKW-C), wired internally as 13 disjoint transpositions with zero fixed points (U2 = I and U(x) ≠ x for all x). Writing Q = R3 R2 R1 P, the encryption operator simplifies to the conjugate E = Q−1 U Q. Two immediate algebraic consequences follow:
- Reciprocal Involution (E2 = I): Because E2 = (Q−1 U Q)(Q−1 U Q) = Q−1 U2 Q = I, ciphertext y = E(x) decrypted identically back to plaintext x = E(y) when typed under the same key settings, simplifying field operation at the cost of halving permutation diversity.
- Absence of Fixed Points (E(x) ≠ x): Suppose E(x) = x for some letter x; then Q−1 U Q(x) = x, implying U(Q(x)) = Q(x), contradicting the physical wiring of U which paired 26 contacts in 13 distinct loops. Consequently, no letter could ever encrypt to itself. During known-plaintext (crib) alignment, any candidate position where a hypothesized plaintext letter matched the observed ciphertext letter was ruled out in one step.
Keyspace Combinatorics and the Double-Stepping Anomaly
For a standard wartime Heer/Luftwaffe Enigma selecting 3 rotors from a set of 5 (I–V) and plugging p = 10 Steckerbrett cables:
- Wheel Order (Walzenlage): 5 × 4 × 3 = 60 arrangements (rising to 8 × 7 × 6 = 336 with 8 naval rotors, plus thin fourth rotor β or γ paired with thin reflector in the 1942 Kriegsmarine M4).
- Core Rotor Alignments: 263 = 17,576 relative window positions (further modified by 262 = 676 middle/right turnover notch offsets via Ringstellung).
- Steckerbrett Pairings: Selecting 20 letters from 26 and partitioning them into 10 unordered pairs yields 26! / [(26 − 2p)! · p! · 2p] = 150,738,274,937,250 (~1.51 × 1014) plugboard states, dominating the total keyspace of ~1.59 × 1020 (~67.1 bits of Shannon Entropy).
Unlike a pure odometer, Enigma rotor stepping used a pawl-and-ratchet mechanism rather than meshing gears. When the middle rotor reached its turnover notch, the middle pawl engaged both the slow rotor's ratchet and the middle rotor's notch simultaneously on the next keystroke, stepping the middle rotor on two consecutive keypresses (double-stepping). This mechanical quirk shortened the three-rotor period from 263 = 17,576 characters to 26 × 25 × 26 = 16,900 characters, contrasting with binary Stream Cipher generators.
| Enigma Variant | Rotor Architecture | Theoretical Keyspace | Primary Cryptanalytic Method |
|---|---|---|---|
| Commercial Enigma D (1926) | 3 rotors + movable reflector | 6 × 263 ≈ 1.05 × 105 | Polyalphabetic index-of-coincidence analysis |
| Wehrmacht Enigma I (Pre-1938) | 3 of 3 rotors + UKW-A/B + 6–10 plugs | ~1.0 × 1016 – 1.6 × 1019 | Rejewski cycle theorem, cyclometer & Polish bomba |
| Wehrmacht 5-Rotor (1939–1945) | 3 of 5 rotors + UKW-B + 10 plugs | ~1.59 × 1020 (~67.1 bits) | Turing–Welchman Bombe with diagonal board |
| Kriegsmarine M4 (1942–1945) | 3 of 8 rotors + β/γ + thin UKW + 10 plugs | ~4.63 × 1021 (~72.0 bits) | 4-wheel Bombes, weather cribs & Banburismus |
Cryptanalysis from Warsaw to Bletchley Park
Marian Rejewski and the Polish Biuro Szyfrów (1932–1939)
Prior to September 1938, German operators encrypted a three-letter message key (such as KCH) twice (KCHKCH) at the daily ground setting (Grundstellung) before typing the message body. Polish mathematician Marian Rejewski, working alongside Jerzy Różycki and Henryk Zygalski at the Warsaw Cipher Bureau (Biuro Szyfrów), observed that equality of the first and fourth, second and fifth, and third and sixth indicator letters defined three composite permutations A = E1E4, B = E2E5, and C = E3E6 across intercepted traffic.
By Rejewski's theorem, the product of two fixed-point-free involutions decomposes into pairs of disjoint cycles of equal lengths; moreover, because (P−1 M1 P)(P−1 M4 P) = P−1(M1 M4)P, conjugation by the unknown plugboard P left the cycle lengths of E1E4 invariant. Combining French intelligence handoffs of monthly key tables with non-commutative permutation equations, Rejewski reconstructed the internal wiring of rotors I–III in December 1932—a landmark preceding Computational Complexity Theory and Diffie–Hellman Key Exchange. Rejewski's team built the cyclometer to catalog cycle fingerprints across all 105,456 rotor states, Zygalski perforated sheets, and in October 1938 the six-rotor electromechanical bomba kryptologiczna, sharing replicas with British and French cryptanalysts at Pyry in July 1939.
Turing–Welchman Bombe and Bayesian Banburismus
When Germany ended doubly enciphered indicators in May 1940, Alan Turing at Bletchley Park redesigned electromechanical search around known-plaintext (crib) menus—stereotyped phrases such as WETTERVORHERSAGE aligned against ciphertext via the non-self-encryption rule. Closed loops in the crib–ciphertext graph (such as plaintext W → ciphertext E at offset 1, E → T at offset 5, T → W at offset 9) yielded fixed-point consistency constraints independent of most plugboard cables. Turing's Bombe—echoing Charles Babbage's Analytical Engine ethos of mechanized symbolic deduction—tested 36 three-rotor triples in parallel by energizing a hypothesized assignment P(W) = a; contradictory cascades lit 25 of 26 wires without pausing, whereas self-consistent hypotheses left 1 or 25 wires distinct and triggered a relay stop.
Gordon Welchman multiplied Bombe selectivity via the diagonal board, a symmetric 26 × 26 cross-connection matrix exploiting Steckerbrett reciprocity (P(x) = y ⇔ P(y) = x) to propagate deductions across open trees as well as closed loops from 12–14-letter cribs. Against Kriegsmarine traffic with 336 wheel orders, Turing developed Banburismus: a sequential Bayesian Inference test on punched Banbury sheets scoring ciphertext character repeats in decibans (0.1 log10 odds units) until posterior odds reached 50:1.
Frequently Asked Questions
Did adding a fourth rotor on the Kriegsmarine M4 Enigma introduce a completely separate cipher?
Only partially. In February 1942, the German Navy fielded the M4 Enigma on Atlantic U-boat (Shark) nets by pairing a thin reflector with a non-stepping fourth rotor (Beta or Gamma). Whenever that fourth rotor stood in its neutral A position, the combined thin-reflector-and-fourth-rotor assembly emulated the older three-rotor UKW-B/C reflector, enabling Bletchley Park to verify captured Kurzsignalheft weather codebooks and commission four-wheel Bombes by December 1942.
Why did operator procedural habits remain decisive alongside electromechanical Bombes?
Testing all 60 wheel orders required ~20 minutes per wheel order on early Bombes unless pruned beforehand. Operator shortcuts—choosing keyboard-adjacent indicator trigrams (QWE, ASD), reusing wheel orders across adjacent nets, re-enciphering reports on three-rotor dockyard links, or opening daily weather dispatches at fixed character offsets—supplied the aligned cribs and wheel-order reductions needed to recover daily keys within hours.
References
- Rejewski, M. (1981). How Polish mathematicians deciphered the Enigma. Annals of the History of Computing, 3(3), 213–234. https://doi.org/10.1109/MAHC.1981.10033
- Good, I. J. (1979). Studies in the history of probability and statistics. XXXVII A. M. Turing's statistical work in World War II. Biometrika, 66(2), 393–396. https://doi.org/10.1093/biomet/66.2.393
- Davies, D. W. (1995). The Bombe—a remarkable logic machine. Cryptologia, 19(2), 165–186. https://doi.org/10.1080/0161-119591883845
- Gillogly, J. J. (1995). Ciphertext-only cryptanalysis of Enigma. Cryptologia, 19(4), 405–413. https://doi.org/10.1080/0161-119591884060
- Christensen, C. (2007). Polish mathematicians finding patterns in Enigma messages. Mathematics Magazine, 80(4), 247–273. https://doi.org/10.1080/0025570X.2007.11953492