All articles
enigmacipherhistorywwii

The Enigma Machine: How It Worked and How It Was Broken

How the Enigma machine worked — rotors, reflectors, plugboards — and how Alan Turing and Bletchley Park cracked it. The story that changed WWII.

April 20, 20267 min readBy SolveCipher Team

The Enigma machine was an electro-mechanical cipher device that encrypted military communications for Nazi Germany during World War II. It looked like a heavy typewriter, but inside it was an engineering marvel — a system of spinning rotors, electrical wiring, and plug connections that could produce 158,962,555,217,826,360,000 different settings. Breaking it seemed mathematically impossible.

Then a team at Bletchley Park, led by mathematician Alan Turing, did exactly that. The story of Enigma — how it worked, why it was trusted, and how it was broken — is the most famous chapter in the history of cryptography.

A Brief History of the Enigma Machine

German engineer Arthur Scherbius patented the Enigma in 1918, originally marketing it to businesses for protecting trade secrets. The German military adopted it in the late 1920s, and by the start of WWII, Enigma was the standard encryption device for the Wehrmacht, the Luftwaffe, and the Kriegsmarine.

The military versions were more complex than the commercial ones. The Wehrmacht added a plugboard (Steckerbrett) that swapped letter pairs before and after the rotor encryption, multiplying the possible settings by billions. German command believed the machine was unbreakable.

The Physical Components

An Enigma machine had four main components, each adding a layer of encryption:

The Keyboard

A standard 26-letter keyboard (QWERTY layout, German variant). When an operator pressed a key, it sent an electrical signal through the encryption circuit.

The Rotors

Three (later four, for naval Enigma) interchangeable rotors, each a thick disc with 26 electrical contacts on each side. Each rotor implemented a different internal wiring pattern — a fixed substitution — that scrambled the electrical signal passing through it.

The rotors were selected from a set of five (or eight for naval use) and placed in a specific order. The choice and arrangement of rotors was part of the daily key.

The Reflector

A fixed component at the end of the rotor stack that sent the electrical signal back through the rotors by a different path. The reflector ensured that encryption was self-reciprocal — typing A might produce Q, and typing Q with the same settings would produce A. This property simplified field operations since the same machine and settings could both encrypt and decrypt.

The Plugboard (Steckerbrett)

A panel on the front of the machine with 26 sockets (one per letter) connected by cables. Each cable swapped two letters — if A was plugged to M, then A became M and M became A before the signal entered the rotors. The military Enigma typically used 10 cables, swapping 10 pairs and leaving 6 letters unchanged.

How the Rotor Stepping Mechanism Works

The critical feature that made Enigma a polyalphabetic cipher (and not just a simple substitution) was the rotor stepping mechanism.

After each keypress, the rightmost rotor advanced one position — like an odometer. When the right rotor completed a full revolution (26 positions), it triggered the middle rotor to advance one position. The middle rotor similarly triggered the left rotor.

This meant the encryption substitution changed with every single keypress. Pressing the same letter three times in a row would produce three different ciphertext letters. Over the course of a message, the machine cycled through thousands of different alphabets, making frequency analysis useless.

The Enigma also had a mechanical quirk called the "double-stepping anomaly" — the middle rotor would advance both when the right rotor triggered it and when it was about to trigger the left rotor. This shortened the full rotor cycle slightly.

Why No Letter Encrypts to Itself

The reflector's wiring guaranteed that no letter could ever encrypt to itself. If you pressed A, you might get any letter from B to Z — but never A. This was a design feature meant to simplify verification: operators could check their work by confirming that no plaintext letter matched its ciphertext position.

This property turned out to be Enigma's greatest cryptographic weakness. It gave codebreakers a powerful way to eliminate wrong settings — if a proposed setting produced a letter encrypting to itself at any position, that setting was definitively wrong. This negative constraint dramatically reduced the search space.

The Bombe: Alan Turing's Codebreaking Device

Polish mathematicians Marian Rejewski, Jerzy Rozycki, and Henryk Zygalski made the first breakthroughs against Enigma in the 1930s, building a mechanical device called the "Bomba." When Germany increased Enigma's complexity in 1938, the Poles shared their work with Britain and France.

At Bletchley Park, Alan Turing and Gordon Welchman designed the Bombe — an electro-mechanical machine that tested Enigma settings at high speed. The Bombe didn't try every possible setting exhaustively. Instead, it used logical contradictions to eliminate impossible settings, drastically narrowing the search.

The Bombe worked by testing a "crib" — a guessed piece of plaintext — against the ciphertext. Using the no-self-encryption rule and the structure of the rotor wiring, it could eliminate millions of settings in minutes, leaving only a handful to test manually.

The Role of Cribs

A crib is a known or guessed piece of plaintext that corresponds to a section of ciphertext. Bletchley Park's codebreakers found cribs through several sources:

Weather reports followed rigid formats. German weather stations transmitted reports at predictable times using standardized phrases — Bletchley knew approximately what the plaintext would say.

Operator laziness was another goldmine. Some operators used predictable rotor starting positions (like AAA or their girlfriend's initials). Others sent identical messages in different ciphers, allowing cross-referencing.

Standardized openings and closings in military messages provided additional cribs. Many messages began with the same bureaucratic preambles or ended with "Heil Hitler."

The no-self-encryption rule then let codebreakers align cribs against ciphertext and eliminate positions where a letter matched itself.

Impact on WWII

Historians estimate that breaking Enigma shortened World War II by two to three years and saved millions of lives. The intelligence derived from Enigma decrypts was codenamed Ultra and was one of the most closely guarded secrets of the war.

Ultra intelligence was critical in the Battle of the Atlantic, where it allowed Allied convoys to avoid German U-boat wolfpacks. It also informed the D-Day invasion planning and numerous tactical decisions across every theater of the war.

Churchill called the Bletchley Park codebreakers "the geese that laid the golden eggs and never cackled" — referring to the absolute secrecy maintained around Ultra, which remained classified until 1974.

Where to See an Enigma Machine Today

Several museums display original Enigma machines:

Bletchley Park in Milton Keynes, England, has the most extensive collection, including working Bombe replicas and interactive exhibits. The National Cryptologic Museum at NSA headquarters in Fort Meade, Maryland, has multiple variants. The Imperial War Museum in London, the Deutsches Museum in Munich, and the International Spy Museum in Washington, D.C. also display Enigma machines.

Surviving Enigma machines occasionally appear at auction, selling for $200,000 to $500,000 depending on variant and condition.

Try Classical Ciphers Online

The Enigma machine is too complex for a simple online tool, but you can explore the classical ciphers that preceded it — and that it was built to surpass. Try the Vigenere cipher (the polyalphabetic system Enigma evolved from), the basic substitution cipher, or use our homepage decoder to break classical ciphers the way Turing's team approached Enigma — through pattern recognition and logical deduction.

Frequently Asked Questions

How many possible Enigma settings were there?

With the standard three-rotor military Enigma, approximately 158.9 quintillion (158,962,555,217,826,360,000) possible settings existed, considering rotor selection, rotor order, rotor starting positions, ring settings, and plugboard connections.

Could a modern computer break Enigma?

Easily. A modern laptop could brute-force all possible Enigma settings in minutes to hours, depending on the approach. The Bombe's logical elimination method, implemented on modern hardware, would solve any Enigma message almost instantly.

Why didn't the Germans realize Enigma was broken?

The Allies were extremely careful about how they used Ultra intelligence. They fabricated cover stories for every action based on Enigma decrypts — staging fake reconnaissance flights before attacking convoys, for example. The Germans investigated potential breaches several times but concluded the machine was secure.

Is the Enigma machine a substitution cipher?

It's a polyalphabetic substitution cipher — the substitution alphabet changes with every keypress due to the rotor stepping mechanism. This makes it fundamentally different from a simple substitution cipher where A always maps to the same letter.