Enigma machine

The cipher machine the German army used through the Second World War, working as it worked: three rotors turning behind a patch panel, a reflector sending the signal back through them, and a different alphabet for every letter you press. Set the wheels and type. The same settings encipher and decipher, because the machine could do nothing else, and no letter ever comes out as itself, which is the flaw that let Bletchley Park read it.

This protects nothing. Enigma was broken in 1932 by Marian Rejewski and read at scale from 1940 onwards, and a laptop breaks it now in seconds. It is here to be understood, not used.

A A A

It is a typewriter whose wiring is scrambled: press A and a different lamp lights.

A wheel turns after EVERY keypress, so the scrambling is different for the next letter. Press A five times and you get five different letters. That is the whole idea, and it is what makes counting letter frequencies useless.

The six settings below are simply how the wiring is arranged before you start. Both operators set their machines the same way each morning from a key sheet, so what one types the other gets back.

Type a message

Machine settings

The machine is already set to rotors I, II and III with everything at A, which is a working machine. Change these only to match a key sheet, or press the 1930 message button above and watch them fill themselves in.

The three rotors
Take three wheels from a box of five and slide them onto the shaft, left to right. Which three, and in what order, is part of the day’s key.
The reflector
The cap at the far end that sends the current back through the wheels along a different path. It is why a letter can never come out as itself.
The ring setting
Each wheel has a lettered ring clipped around it. This is how far that ring is turned relative to the wiring inside, set before the wheel goes in.
The start position
Having loaded the wheels, turn each by hand until the letter you want shows in its window. That is where the message begins.
The plugboard
Cables plugged into the front panel, each swapping two letters both on the way in and on the way out. Ten cables was the usual issue.

The army issued five rotors and used three at a time, in any order. UKW-B was standard from 1937; UKW-A is here because the 1930 manual message uses it.

The ring setting turns the wiring inside each wheel; the start position is what showed through the window when the operator began. Both are three letters, one per rotor, left to right. Up to ten cables, each swapping two letters both ways. Leave it empty for a machine without one.

Frequently asked questions

Is my text uploaded?

No. The machine runs in this tab as you type. The site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages, meaning the text could not be sent even if the code tried.

How do I know this is accurate?

It deciphers the worked example from the 1930 Enigma instruction manual, all ninety letters of it, to the plaintext that has been published for decades. That message is long enough for the double step to happen several times, which is the thing most simulators get wrong: a machine without it is correct for the first few letters and then quietly diverges. Press the button to watch it come apart.

What is the double step?

The middle rotor is turned by a pawl that catches a notch on the rotor to its right, and that same pawl rests against the middle rotor’s own notch. So when the middle rotor sits on its notch, the next keypress moves it and the left rotor together, which means the middle wheel advances twice in two presses. It is a consequence of the gearing rather than a design decision, and it is the detail that separates a simulator from a picture of one.

Why can a letter never come out as itself?

The reflector sends the signal back through the rotors along a different path, and a path that returned to where it started would need a wire joining a contact to itself, which no reflector has. It sounds like a small thing. It was the largest single weakness: knowing that a word could not be sitting where it appeared to be let Bletchley Park eliminate huge numbers of possible settings before testing any of them, and the guessed words that made it work were things like the weather report sent every morning.

Who broke it, and when?

Marian Rejewski of the Polish Cipher Bureau reconstructed the wiring mathematically in 1932, years before the war, and Poland handed its work to Britain and France weeks before the invasion. At Bletchley Park, Alan Turing and Gordon Welchman built on it to attack the daily settings at scale. The machines they designed to do it are a direct ancestor of the computer you are reading this on.

Why are there only five rotors?

Because those are the five the army issued. The navy added three more, numbered VI to VIII, which carry two notches each and step differently; supporting them halfway would produce output that looks right and is not, so they are left out until they are done properly.