Enigma Machine Simulator
Set up an Enigma I — three of the five rotors, reflector B or C, ring settings, start positions and up to ten plugboard cables — then type: the rotors step, a lamp lights and every key press is traced. The machine is its own inverse, so the same settings decode.
Load an example
Machine settings
Up to ten pairs of letters separated by spaces, such as AV BS CG. A letter can be in one pair only.
The machine had only the 26 letter keys, so spaces, digits and punctuation are not typed. Operators spelled numbers out and wrote X for a full stop.
The machine
Rotor windows
Left
Left window shows A
I
Middle
Middle window shows A
II
Right
Right window shows F
III
After the last key press. Each press moves the right rotor on before the current flows, so the first letter is enciphered one position after the start.
Lamp board
Keyboard
Path of the last key press
- KeyA
- PlugboardA
- III (Right)G
- II (Middle)R
- I (Left)U
- Reflector BC
- I (Left)Y
- II (Middle)V
- III (Right)O
- LampO
Through the plugboard, the rotors right to left, the reflector, and back through the rotors and the plugboard to a lamp.
Output
BDZGO
5 letters typed
To decode, set the same rotors, rings, plugboard and start position and type the cipher text — the Enigma is its own inverse.
Key presses
| # | Windows | Key | Lamp |
|---|---|---|---|
| 1 | AAB | A | B |
| 2 | AAC | A | D |
| 3 | AAD | A | Z |
| 4 | AAE | A | G |
| 5 | AAF | A | O |
How to Use the Enigma Machine Simulator
- 1. Set the machine. Choose the reflector, then for each slot — left, middle, right — the rotor, its ring setting and the letter showing in its window at the start.
- 2. Plug the plugboard. Type up to ten letter pairs, such as AV BS CG; each pair swaps two letters on the way in and again on the way out.
- 3. Type the message, in the box or on the keys. The machine had only 26 letter keys, so spaces, digits and punctuation are skipped — operators spelled numbers out and wrote X for a full stop.
- 4. Watch it work. The windows show the rotors after the last key press, the lamp board lights the last letter, and the signal path and log trace each press.
- 5. Decode with the same settings. Set the same rotors, rings, plugboard and start position and type the cipher text. The three examples load published test cases.
How the Enigma I Works
Pressing a key does two things, in this order. First the rotors step: the right-hand rotor always moves on one position, and a notch on its ring carries the middle rotor on once per revolution. Then current flows from the key through the plugboard, the three rotors from right to left, the reflector, the rotors again from left to right and the plugboard again, and lights a lamp.
Each rotor is a fixed scramble of the alphabet, and stepping turns it against the letters, so the same key lights a different lamp every time. The reflector joins letters in pairs, which makes the machine its own inverse — and means no letter is ever enciphered as itself. With rotors I, II and III, reflector B, rings AAA and start position AAA, typing AAAAA lights B, D, Z, G and O: the standard first check of any Enigma simulator.
| Wheel | Wiring for A → Z | Turnover | Introduced |
|---|---|---|---|
| Rotor I | EKMFLGDQVZNTOWYHXUSPAIBRCJ | Q → R | 1930 |
| Rotor II | AJDKSIRUXBLHWTMCQGZNPYFVOE | E → F | 1930 |
| Rotor III | BDFHJLCPRTXVZNYEIWGAKMUSQO | V → W | 1930 |
| Rotor IV | ESOVPZJAYQUIRHXLNFTGKDCMWB | J → K | December 1938 |
| Rotor V | VZBRGITYUPSDNHLXAWMJQOFECK | Z → A | December 1938 |
| Reflector B | YRUHQSLDPXNGOKMIEBFZCWVJAT | — | November 1937 |
| Reflector C | FVPJIAOYEDRZXWGCTKUQSBNMHL | — | 1940, briefly |
Turnover: as the rotor steps from the first letter to the second in its window, it carries the rotor to its left on one place.
Ring settings and the double step
The ring setting (Ringstellung) turns the wiring against the lettered ring, while the notch stays with the letters. With rings BBB instead of AAA, the same five key presses give EWTYX.
The middle rotor has a famous quirk: when it reaches its own turnover position, it steps again on the very next key press and carries the left rotor with it. Starting from ADU with rotors I, II and III, the windows read ADV, AEW, then BFX — the middle rotor went from D to E and straight on to F. Load The double step example to watch it.
Worked Example: A Message With Rings and Plugboard
A full message loads the worked example from German Wikipedia's Enigma article: reflector B, rotors I IV III, rings 16 26 08 (P Z H) and plugs AD CN ET FL GI JV KZ PU QY WX. The operator chose the start position QWE, typed his message key RTZ, saw EWG, and sent QWE EWG in the clear.
The receiver sets QWE, types EWG and reads RTZ off the lamps. Set to RTZ, the cipher text EJZLB SYEQP DWDUE EJJOU PSOFL B… comes out as XAACH ENXAA CHENX ISTGE RETTE T…: Aachen ist gerettet, "Aachen is saved" — with X for spaces and full stops, the place name doubled, and CH written as Q, the conventions of German military messages.
Breaking Enigma: Rejewski, Bletchley Park and Turing
Arthur Scherbius applied for his rotor-machine patent in 1918 and sold the first commercial Enigma in 1923. The German navy adopted a modified version in 1926, the army added the plugboard in 1928, and the Enigma I was in service from 1930. Polish mathematicians broke it first: around December 1932 Marian Rejewski of the Polish Cipher Bureau used permutation theory, with daily keys the French had obtained from a German spy, Hans-Thilo Schmidt, to work out the rotor wiring. With Jerzy Różycki and Henryk Zygalski he built Zygalski sheets and the electromechanical bomba to find daily settings, and in July 1939, at Pyry near Warsaw, the Poles shared it all with French and British cryptologists.
At Bletchley Park, Alan Turing designed the British bombe, which tested rotor settings against a crib — plain text the codebreakers expected in a message — and Gordon Welchman's diagonal board made it far more effective; the first bombe was installed in March 1940. Because no letter enciphers to itself, a guessed word could not sit where it would put a letter over itself, which helped place cribs. The intelligence from Enigma and other ciphers, code-named Ultra, was a substantial aid to the Allies.
Was Enigma Secure?
On paper it was strong: three of five rotors in order, their start positions and ten plugboard pairs give 158,962,555,217,826,360,000 settings — about 1.6 × 10²⁰, or 67 bits — before ring settings. It fell to its design and its use: no letter became itself, operators sent predictable phrases and, until May 1940, typed each message key twice. Today a computer recovers Enigma settings from cipher text alone, so this simulator is for learning, not secrecy.
Frequently Asked Questions
- How does an Enigma machine work?
- Each key press first steps the rotors, then sends current through the plugboard, three rotors, a reflector, the rotors again in reverse and the plugboard again to light a lamp. Because the rotors move with every press, each letter is enciphered with a different alphabet, so a repeated letter in the message does not repeat in the cipher text.
- What is the Enigma double-stepping anomaly?
- The middle rotor steps on two key presses in a row when it reaches its own turnover position: once when the right rotor carries it there, and again on the next press, when it carries the left rotor along. From ADU with rotors I, II and III the windows read ADV, AEW, BFX. Many simulators get this wrong; this one is tested against it.
- Why can't Enigma encrypt a letter to itself?
- Because of the reflector: it always pairs a letter with a different one, so the current returns along a different wire and the lamp that lights is never the key pressed. That made the machine self-reciprocal, but it also told codebreakers where a guessed word could not be.
- How do I decrypt an Enigma message?
- Set the same reflector, rotor order, ring settings, plugboard and start position the sender used, then type the cipher text: the lamps spell out the plain text. Wartime messages also carried an enciphered message key, so the receiver first decrypted that key and then reset the rotors to it.
- Who broke the Enigma code?
- The first break was Polish: Marian Rejewski reconstructed the rotor wiring around December 1932 and, with Jerzy Różycki and Henryk Zygalski, read Enigma traffic for years before the war. From 1939 the work continued at Bletchley Park, where Alan Turing, Gordon Welchman and thousands of others, many of them women running the bombes, turned it into an industrial operation.