​How The Enigma Machine Worked, In One Infographic

Illustration for article titled ​How The Enigma Machine Worked, In One Infographic

The release of the film, The Imitation Game, about the life and work of Alan Turing, inspired the Guardian to publish this description of how the German encryption device worked—and why, like all good cryptography, it was a simple concept that was a nightmare to break.


Part mechanical, part electrical, Enigma looked like an oversized typewriter. Input the first letter of your message on the keyboard, and then a letter lights up revealing what it has been replaced with in the encrypted message:

Inside the box, the system is built around three physical rotors. Each takes in a letter and outputs it as a different one. That letter passes through all three rotors, bounces off a "reflector" at the end, and passes back through all three rotors in the other direction.

The board lights up to show the encrypted output, and the first of the three rotors clicks round one position – changing the output even if the second letter input is the same as the first one.

When the first rotor has turned through all 26 positions, the second rotor clicks round, and when that's made it round all the way, the third does the same, leading to more than 17,000 different combinations before the encryption process repeats itself. Adding to the scrambling was a plugboard, sitting between the main rotors and the input and output, which swapped pairs of letters. In the earliest machines, up to six pairs could be swapped in that way; later models pushed it to 10, and added a fourth rotor.

Illustration for article titled ​How The Enigma Machine Worked, In One Infographic

Thanks to the reflector, decoding was the same as encoding the text, but in reverse. But that reflector also led to the flaw in Enigma, and the basis on which all code breaking efforts were founded: no letter would ever be encoded as itself. With that knowledge, as well as an educated guess at what might be encrypted in some of the messages, it was possible to eliminate thousands of potential rotor positions.


Dr Emilio Lizardo

The way I understand it, Enigma was beaten because the Germans got lazy and reused wheel orders and patchcord patterns, so the Allies could use captured machines to decode messages because the "key" wasn't changed often enough. Many people believe that with good discipline, Enigma would have been secure to the end of the war.

It is also interesting to note that sometimes when men were captured with the machines, Germany was not notified that their soldiers had been taken prisoner so that they would not guess that an Enigma machine had been captured. That was a clear violation of the Geneva convention.