Enigma Machine Simulator

Free online Enigma machine simulator: Enigma I, M3 and M4 with every rotor, ring setting, reflector and plugboard. Encode and decode messages, watch the signal path light the lamps, and use the crib search to find the settings of a coded message.

Message — the machine is its own inverse: the same settings turn plain text into code and code back into plain text

Lampboard — click the keys or type; the lamp shows the last letter

The signal path

Find the settings — crib search: the code-breaker's trick

Paste a coded message in the Input box, type a word you think it contains (a crib, such as WETTERBERICHT or KEINEBESONDEREN) and this tries every starting position (and optionally every rotor order) with the rings, reflector and plugboard set above, looking for settings that turn the code into your crib.

How the Enigma machine works

Press a key and an electric current runs through the plugboard (which swaps up to ten pairs of letters), the entry wheel, three or four rotors, a reflector that sends the current back the way it came, the rotors again in reverse and the plugboard once more, and finally lights one lamp. Before each key press the right-hand rotor turns one step, and sometimes carries the middle and left rotors with it, so the same letter is scrambled differently every time. The open-source simulation here follows the real wiring, notches, ring settings and the middle rotor’s famous double step.

Models

  • Enigma I — the standard German Army and Air Force machine: three rotors chosen from I–V and reflectors A, B or C.
  • M3 — the Navy’s version before 1942: rotors I–VIII (VI, VII and VIII carry two turnover notches) and reflectors B or C.
  • M4 — the four-rotor Shark machine of the U-boats: a thin Beta or Gamma rotor that never turns, plus a thin reflector (B or C).

Using it

  • Encode: choose the rotors, ring settings, start positions and plugboard, then type your message. Read the output (grouped in fives, like the original radio traffic).
  • Decode: set the same start positions, rings and plugs and type or paste the ciphertext. Enigma is reciprocal: if A becomes Q then Q becomes A at that same step, so no separate “decrypt” setting exists.
  • Only the letters A–Z are enciphered; the real machine had no digits or spaces. Operators wrote numbers out in full and used X for a full stop.
  • Check yourself: Enigma I, rotors I–II–III, reflector B, rings and positions AAA turns AAAAA into BDZGO.

The flaw that helped break it

Because the reflector can never send a signal back to the lamp of the key you pressed, an Enigma never turns a letter into itself. That sounds like a strength, but a code-breaker who guesses a word in the message (a crib) can slide it along the ciphertext and rule out every place where a letter would line up with itself. At Bletchley Park such cribs (WETTERBERICHT, “weather report”, and KEINEBESONDEREN, “nothing special to report”) fed Alan Turing’s Bombe machines. The crib search above does the same job on a modern computer, as long as you know the plugboard.

How many settings are there?

For an army Enigma I: 60 rotor orders × 17,576 start positions × 676 ring settings (the left ring does not matter) × about 150 trillion ways to set ten plugs is roughly 158,962,555,217,826,360,000 (about 1.6 × 1020) keys. The plugboard alone is responsible for most of that.

Everything runs in your browser; nothing you type is sent anywhere. More MES tools

Comments
Advertisement