Introduction
The German military trusted the Enigma machine to protect operational communications across every theater of WWII. They were wrong to trust it. This simulator reproduces the electromechanical cipher that Marian Rejewski first broke in 1932 and that Alan Turing and Gordon Welchman cracked at scale from 1940 onward at Bletchley Park. Configure rotors I through VIII, select reflector A/B/C, set ring positions and plugboard pairs, then type a message. The output appears instantly. Because Enigma is self-reciprocal, feeding ciphertext back through the same settings recovers the plaintext. Everything runs in your browser, so no message leaves your device.
What this tool does
- Simulates the Wehrmacht Enigma I with three rotors selected from the standard set I-V or the naval set VI-VIII (dual-notch rotors).
- Supports reflectors A, B, and C as documented in the technical specifications at codesandciphers.org.uk.
- Configurable ring settings (Ringstellung) from 1-26 for each rotor, shifting the wiring relative to the alphabet ring.
- Plugboard (Steckerbrett) input accepting up to 13 letter pairs, matching the historical patch panel on the front of the machine.
- Visual rotor windows showing the current letter position of each rotor, just like the operator saw through the machine's lid slits.
- Implements the double-stepping anomaly discovered by Marian Rejewski, where the middle rotor advances on two consecutive keypresses near its notch position.
How this tool works
The simulator builds three Rotor objects from the historical wiring tables, a Reflector from the selected UKW definition, and a Plugboard map from the letter pairs you enter. For each character you type, it first steps the rotors (right rotor always steps, middle rotor steps when the right rotor hits its notch, and the double-stepping anomaly causes the middle rotor to step again at its own notch). The signal then passes through the plugboard, forward through the rotors right-to-left, through the reflector, backward through the rotors left-to-right, and through the plugboard again. The result is the lit lamp letter. Non-alphabetic characters pass through unchanged. The visual display updates the rotor windows to show the position after stepping, so you can watch the odometer-like advance happen in real time.
How the cipher or encoding works
Arthur Scherbius patented the Enigma in 1918. The Wehrmacht adopted it in 1926 and used it through 1945. The machine's security rested on five variable components, as documented in the NSA's cryptographic mathematics paper: the plugboard, the three ordered rotors, the initial rotor positions, the ring settings, and the reflector.
Rotor wirings are fixed permutations of A-Z. Rotor I maps ABCDEFGHIJKLMNOPQRSTUVWXYZ to EKMFLGDQVZNTOWYHXUSPAIBRCJ. Each rotor has a notch that triggers the rotor to its left: rotor I at Q, II at E, III at V, IV at J, V at Z, and VI/VII/VIII at both Z and M (the naval dual-notch rotors). The Crypto Museum provides a detailed walkthrough of the electrical path.
The reflector (Umkehrwalze) is a fixed involution with no fixed points. It pairs all 26 letters into 13 transpositions, ensuring the signal returns through the rotors via a different path. This makes Enigma self-reciprocal: encryption and decryption are identical operations. It also means a letter can never encrypt to itself, a weakness that Turing exploited with cribs to eliminate impossible rotor positions.
The plugboard swaps letter pairs before and after the rotor path. With 10 cables (the wartime standard), there are approximately 150.7 trillion possible plugboard configurations. Combined with 60 rotor arrangements (5 rotors in 3 slots), 17,576 start positions, 17,576 ring settings, and 3 reflectors, the total key space exceeds 1.5 x 10^23. The Germans considered this unbreakable by brute force, which was true for the era. But the key space was not the problem. The structural weaknesses were.
Key weaknesses: (1) A letter never maps to itself, enabling crib-based elimination. (2) The plugboard is reciprocal, so if A maps to N then N maps to A. Gordon Welchman's diagonal board exploited this in the Bombe. (3) The rotor stepping is largely predictable (odometer-like), with the double-stepping anomaly being the only irregularity. (4) German procedural errors, like repeating the three-letter message key, let Rejewski recover the rotor wirings in 1932 using permutation group theory.
How to use this tool
- Select rotors for the left, middle, and right slots. The standard Wehrmacht set uses rotors I-V; the naval set adds VI-VIII with dual notches.
- Set the ring setting (1-26) for each rotor. This shifts the internal wiring relative to the alphabet ring and affects when notches trigger stepping.
- Set the start position (A-Z) for each rotor. This is the letter visible in the window before encryption begins.
- Choose a reflector: A (early), B (most common wartime), or C (later variant).
- Optionally enter plugboard pairs (e.g., "AB CD EF"). Each pair swaps those letters on input and output. Up to 13 pairs are supported.
- Type your message in the input field. The encrypted output appears instantly. To decrypt, use the same settings and paste the ciphertext.
Real-world examples
WWII Wehrmacht message simulation
A history class simulates field communications using the standard daily key: rotors I-II-III, reflector B, ring settings AAA, start position AAA, plugboard "AM CE FG". A student types HELLO WORLD and gets QMTPM OZPAQ. Feeding the ciphertext back through the same settings recovers HELLO WORLD, demonstrating the self-reciprocal property that let operators use the same machine for both encryption and decryption.
Cryptanalysis education with cribs
A cryptography course demonstrates why Enigma fell. Students encrypt WETTERBERICHT (weather report, a common German message header) with known settings, then attempt a known-plaintext attack. They learn that since a letter never encrypts to itself, any position where the crib letter matches the ciphertext letter can be eliminated immediately. This is the same technique Turing automated with the Bombe at Bletchley Park.
Naval Enigma M4 configuration
A researcher studying the U-boat Enigma configures rotors VI-V-II with reflector C and dual-notch behavior. They observe that rotors VI, VII, and VIII have two notch positions (Z and M), causing the middle rotor to step more frequently and less predictably than the single-notch Army rotors. This explains why the Kriegsmarine messages took far longer to break at Bletchley Park until the capture of U-110 and its codebooks in May 1941.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Caesar cipher | Very low | Single-shift substitution teaching |
| Vigenere cipher | Medium | Polyalphabetic keyword cipher |
| Enigma (3-rotor) | High | WWII German field communications |
| Modern AES-256 | Very high | Secure digital encryption |
Limitations or considerations
The Enigma machine is completely insecure by modern standards. Its key space of roughly 10^23 sounds large, but it was broken by hand and electromechanical methods in the 1930s and 1940s. The reflector guarantees that no letter maps to itself, which is a structural leak. The plugboard is reciprocal, which Welchman's diagonal board exploited. The rotor stepping is mostly regular. This simulator implements the 3-rotor Wehrmacht Enigma I. It does not model the 4-rotor naval M4 (which added the Beta/Gamma thin rotors and the thin reflectors B Duenmn and C Duenmn). It also does not model the entry wheel (ETW) wiring, which was alphabetical on all Wehrmacht models. Never use Enigma for any real security purpose. Use AES or another NIST-approved algorithm instead.
Frequently asked questions
Why can a letter never encrypt to itself in Enigma?
The reflector (Umkehrwalze) sends the electrical signal back through the rotors via a different path. Because the reflector has no fixed points (every letter maps to a different letter), the output can never equal the input. This property helped Allied codebreakers eliminate impossible crib positions.
What is the double-stepping anomaly?
When the middle rotor reaches its notch position, it steps again on the next keypress, along with the left rotor. This means the middle rotor advances on two consecutive keypresses instead of just one. It was a mechanical side effect of the pawl-and-ratchet design, not an intentional security feature. Marian Rejewski identified this anomaly in the 1930s.
How many possible Enigma configurations are there?
For the 3-rotor Wehrmacht Enigma with 5 rotors to choose from, 3 reflectors, 10 plugboard cables, and all ring/position settings, the total is approximately 1.5 x 10^23 (158 million million million). The NSA paper on Enigma mathematics derives the exact figure. Despite this, Bletchley Park broke it daily using structural weaknesses rather than brute force.
Is Enigma encryption the same as decryption?
Yes. Enigma is self-reciprocal due to the reflector. If you encrypt a message with a given set of settings, feeding the ciphertext through the same settings produces the original plaintext. This is why operators did not need separate encrypt and decrypt modes.
What rotors were available for the German Navy?
The Kriegsmarine used rotors I-VIII (8 rotors instead of 5), giving 336 possible rotor arrangements instead of 60. Rotors VI, VII, and VIII each had two notch positions (Z and M) instead of one, causing more frequent and less predictable stepping. The M4 naval model also added a fourth rotor slot with the Beta or Gamma thin rotors.
Conclusion
This simulator lets you explore the machine that shaped WWII signals intelligence. Configure the rotors, plugboard, and ring settings, then watch the rotor windows advance as you type. Compare the output with known historical examples to understand why the Germans trusted it and why Bletchley Park broke it. For modern encryption needs, use the AES or RSA Key Inspector tools instead. To learn more about classical cipher analysis, try the Caesar Brute Force or Vigenere Cracker tools.