Set up the machine, then type. The same settings encrypt and decrypt.
Press a key and an electric current runs through the machine to light a lamp. On the way it passes through:
The right-hand rotor turns one step before every key press, so the same letter typed twice comes out differently. When it passes its turnover letter it kicks the middle rotor on a step, and the middle rotor does the same to the left one. The middle rotor also steps a second time on the very next key press, the double step, a mechanical quirk that this simulator reproduces.
An operator's daily key sheet gave four settings, and this simulator asks for the same four:
02 21 12 is the same as BUL.To decrypt, set the machine exactly as it was for encryption and type the ciphertext. The reflector makes Enigma its own inverse. It also means no letter can ever encrypt to itself, the flaw that let Bletchley Park line up guessed words (cribs) against intercepts.
The simulator is tested against the standard check (rotors I-II-III, reflector B, everything at A: AAAAA encrypts to BDZGO) and against a genuine German army message from Operation Barbarossa in 1941, which decrypts to AUFKL ABTEILUNG VON KURTINOWA…. The M4's thin reflectors and fourth wheels are checked the way the Germans designed them: with the fourth wheel at A, an M4 behaves exactly like a three-rotor machine.
It reproduces the real machines' wiring and stepping, including the middle rotor's double step. It's tested against the textbook check (AAAAA becomes BDZGO with rotors I-II-III at AAA) and decrypts a genuine 1941 Wehrmacht message from Operation Barbarossa.
The reflector sends every signal back through the rotors by a different path, so the machine is its own inverse: with identical settings, ciphertext in gives plaintext out. It's also why a letter can never encrypt to itself, the flaw Bletchley Park exploited.
The Enigma I (army and air force) and M3 (navy) used three rotors chosen from five, or eight for the navy. The M4, introduced for U-boats in 1942, added a fourth thin wheel, Beta or Gamma, beside a thin reflector.
Not in a browser in a second. Bletchley Park needed cribs, guessed stretches of plaintext, and rooms full of bombes. With the settings, or a puzzle that gives them, this decrypts instantly.