Join the Official Discord

Enigma machine simulator

Set up the machine, then type. The same settings encrypt and decrypt.

Machine
Rotors (left to right)
letters (AAA) or numbers (01 01 01)
fourth wheel at ring
Lampboard
Rotor windows after typing: AAA

How the Enigma machine works

Press a key and an electric current runs through the machine to light a lamp. On the way it passes through:

  1. The plugboard, which swaps up to thirteen pairs of letters, both on the way in and on the way out.
  2. Three rotors, each a wheel of 26 contacts wired to scramble the alphabet in its own fixed way.
  3. The reflector, which sends the current back through the rotors by a different route, then out through the plugboard to a lamp.

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.

Setting it up

An operator's daily key sheet gave four settings, and this simulator asks for the same four:

  • Walzenlage: which rotors, in which order. The army chose three of five; the navy three of eight.
  • Ringstellung: the ring settings, which shift each rotor's wiring against its lettered rim. Key sheets wrote them as numbers, so 02 21 12 is the same as BUL.
  • Steckerverbindungen: the plugboard pairs.
  • Grundstellung: the start positions, the letters showing in the windows when you begin. In practice each message also had its own key, sent at the start.

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.

Checked against the real thing

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.

Questions

How accurate is this Enigma simulator?

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.

Why does decrypting use the same settings as encrypting?

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.

What's the difference between the Enigma I, M3 and M4?

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.

Can you crack an Enigma message without the settings?

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.

More cipher tools

See all cipher tools →