Enigma cipher online – encoder/decoder
Enigma M4 simulator online: encrypt and decrypt text with three moving rotors, a Greek rotor, thin reflector and plugboard. Explore the wiring.
How was Enigma broken?
What is the Enigma M4?
The Enigma M4 is an electromechanical rotor machine used by the German navy. Every keypress lights a different letter, because the rotors turn after each character and build a new substitution every time. The key is a complete set of settings: the choice and order of rotors, starting positions, ring settings and plugboard pairs.
How does the signal travel through the machine?
Current runs from the key through the plugboard, then through three moving rotors, the static Greek rotor and the thin reflector, before returning along the same path in reverse and through the plugboard again to the lamp. The right rotor steps before every letter; the others move only once a notch is reached.
Example with the default settings
With the tool’s default configuration — rotors I-II-III, Greek rotor Beta, reflector B, all positions at A, zero ring settings and an empty plugboard — the text “AAAAA” becomes “BDZGO”. Five identical letters turn into five different ones because the machine rotates a rotor after every character.
Wiring of rotor I
The top row is the input contact and the bottom row the letter its internal wiring leads to inside rotor I. Every rotor has different, permanently soldered connections, and rotating the rotor shifts that whole mapping.
| Input | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Output | E | K | M | F | L | G | D | Q | V | Z | N | T | O | W | Y | H | X | U | S | P | A | I | B | R | C | J |
How do you decrypt a message?
The recipient sets the machine exactly as the sender did and types the ciphertext — the plaintext appears at the output. This works thanks to the reflector, which makes the whole operation reciprocal. A single rotor position out of place ruins the entire reading.
How does the M4 differ from a three-rotor Enigma?
The M4 adds a fourth, static Greek rotor (Beta or Gamma) and a thinner reflector, so four wheels fit inside the same housing. The Greek rotor does not turn while typing — it is set once. When Beta stands at position A, the machine behaves like an ordinary three-rotor Enigma, which is visible in the classic “BDZGO” result.
The Polish contribution to breaking Enigma
The decisive Polish breakthrough began at the Cipher Bureau. In 1932 Marian Rejewski used permutation mathematics and intelligence supplied through France to reconstruct the military Enigma’s wiring. With Jerzy Różycki and Henryk Zygalski he developed the cyclometer, characteristic catalogue, cryptologic bomba, clock method and Zygalski sheets. At Pyry near Warsaw in July 1939, Poland shared this knowledge and replica machines with Britain and France, giving the Allies a practical foundation for later work at Bletchley Park. The naval M4 still required new methods and far greater computing capacity.
Why is Enigma insecure today?
The reflector gives the machine a decisive weakness: no letter can ever encrypt to itself. That allowed predictable fragments of text, known as cribs, to be matched against the ciphertext and contradictory settings to be discarded. Operator mistakes and formulaic message headers narrowed the search further. A modern computer can test those selected candidates quickly, but an exhaustive search of the entire settings space would still not take mere moments.
See also: Vigenère cipher · AES‑256‑GCM cipher
History of the Enigma M4
Arthur Scherbius developed Enigma after the First World War, initially for the commercial market. The navy introduced the four-rotor M4 in February 1942 on the U-boat network, cutting the Allies off for months from traffic they had previously been reading. Breaking back into that network required new methods, captured documents and far greater computing power.