Interactive
Enigma I, working
The cipher machine the German military used for most of the Second World War, rebuilt as a model you can operate. Set the rotors, press a key, and watch the lamp answer — then read the full entry for who broke it and where the surviving machines are.
This is not encryption
Enigma is broken. A modern laptop recovers the settings from a few hundred characters of ciphertext in seconds, and the machine has a structural flaw — no letter can ever be enciphered as itself — that made it attackable in 1932 with pencil and paper. Treat everything below as a museum exhibit. Do not use it for anything that matters.
Nothing you type leaves your browser. There is no server, no transmission, no storage and no share link — the machine runs entirely on this page, which is also why there is nothing here to intercept.
The machine
Left · slow
set
Middle
set
Right · fast
set
Reflector
The reflector is why one setting both locks and unlocks.
Nothing patched. The plugboard swaps letter pairs before and after the rotors.
Lampboard · none lit
Keyboard — press a key to encipher a letter
I II III · UKW-B · Ring AAA · Pos AAA · No plugs
To decode a message someone sent you, set the identical key — rotor order, ring settings, start position, reflector and plugs — and paste the ciphertext into the box above. You do not run it in reverse; the same setting undoes it. That is the reflector's doing, not a shortcut.
What to notice
A letter never enciphers as itself. Press A and the lit lamp will never be A — not once, at any setting, on any machine ever built. This is not a setting you can change; it falls out of the reflector wiring, because the current that goes out through a rotor must come back through the same set of wires. It is the crack that let Marian Rejewski reconstruct the entire machine's wiring from intercepted messages alone in 1932.
Press the same key twice and you get two different lamps. The rotors step before every letter, so the substitution changes with each keystroke. This is what makes Enigma a polyalphabetic cipher rather than a simple substitution — and it is why the same letter typed five times produces five different outputs.
Watch the middle rotor for the double-step. Every account of Enigma calls the rotors an odometer: the right one turns each press and carries to the next. That is close, and wrong. The middle rotor is carried when the right rotor is at its notch or when the middle rotor is itself at its notch — so it can advance on two consecutive presses. Set the right rotor to a notch position and step through: you will see the middle rotor jump twice while the right rotor moves once each time. This model implements that, because a machine that does not is not an Enigma.
How the machine works
Enigma is an electrical substitution cipher where the substitution changes with every keystroke. Pressing a key completes a circuit: current leaves the keyboard, passes through the plugboard, then through three rotors from right to left, reaches the reflector, comes back through the same three rotors in the opposite direction, passes through the plugboard again, and lights a lamp. There is no printer and no paper tape — the machine's only output is which lamp lights.
The rotor is the heart of it. Each rotor is a disc of 26 contacts on each face, wired internally so that each contact on one side connects to a different contact on the other. That is a substitution alphabet, fixed in the wiring — but the rotor can be rotated, so which wire a given letter enters changes with the rotor's position. Three rotors in series give three substitutions composed together, and because the right rotor turns before every letter, the composition is different for every letter of a message.
The ring setting is a separate control from the rotor order, and this is the point most explanations blur. The Walzenlage is which of the five rotors you fit, and in what order. The Ringstellung is where the alphabet ring is pinned to the rotor's wiring — it changes which window letter corresponds to which internal wire, without changing the rotor's order or the wiring itself. Putting rotor II in the middle and setting a ring three letters along are two different operations that both alter the output, and the machine needs both to specify.
The reflector makes the machine its own inverse. It is a set of 13 wires pairing the 26 contacts on the leftmost rotor — the Umkehrwalze, the reversing drum. Because it pairs contacts rather than substituting them, the same settings both encipher and decipher. That is a genuine convenience, and it was also a design flaw with two consequences: it guarantees no letter can encipher as itself, and it means the machine can never produce a substitution that is a single 26-cycle. Both facts were used against it.
The plugboard adds a final layer, and it multiplies the key space enormously. Up to ten pairs of letters were patched together on the Steckerbrett, swapping letters before they entered the rotors and swapping them back on the way out. It does nothing to the rotors' arithmetic, but it changes the effective key by a factor of hundreds of billions — which is why German operators were told to use ten plugs and why Bletchley Park's early attacks struggled until that instruction was not always followed.
What the machine does not have is a way of transmitting anything. Messages were enciphered on one machine, written down, and sent by radio in Morse by a separate operator — and it was the radio traffic, not the machine, that gave the codebreakers their raw material. The five-letter groups you see in accounts of Enigma traffic are for transmission reliability, not part of the cipher.
This model implements the real stepping behaviour, both reflectors, all five rotors, the ring settings and the plugboard, and it is checked against published test vectors — with rotors I-II-III, UKW-B, ring settings AAA and start position AAA, typing AAAAA gives BDZGO. If you set it that way above and type five As, that is what you should get.
For who built it, who broke it, and what happened to the company and the machines, read Where Is the Enigma Machine Now? — and the registry entry for Enigma itself.