Skip main navigation

Early history of the Enigma machine

An introduction to the inner workings of the Enigma machine.
An Enigma machine

The Enigma machine was used extensively by the German military to encrypt its communications throughout the Second World War (and for a few years beforehand); however it was broken by the Allies, and the intelligence gained is believed to have shortened the War by about two years.

The Enigma machine is an electro-mechanical device for encrypting messages, patented by Arthur Scherbius in the 1920s and first sold commercially. In the 1930s the German military recognised its potential, so they adapted and improved the machine, and it was used widely by front-line units to communicate with each other and with headquarters.

How the machine works

Pressing a key on the keyboard sends an electric current through the machine and lights up a letter on the lampboard. These encrypted letters are then sent (via Morse code) over the radio, which means anyone can listen in on the encrypted chatter. If that person knows the relevant settings for the machine, they can then decrypt the message.

The following image shows General Guderian overseeing the use of an Enigma machine, probably taken in 1940:

General Guderian

The route the electricity flowed through the machine was as follows: the wires first go from the keyboard to a plugboard, then into a fast rotor, then a middle rotor, then a slow rotor. Then it goes into a reflector, which sends the electricity on a path back through the three rotors and back through the plugboard along a different path. Finally it ends up at the lampboard.

This image demonstrating the flow was taken from Alan Turing’s “Prof’s Book”, written whilst he was working in Bletchley Park during the War:

Turing's sketch

We now discuss each aspect in a little more detail:

  • The keyboard is where the operator pressed the keys to enter the plaintext letters.
  • The plugboard allows the user to plug in electrical wires between pairs of letters. So if A and B are connected in the plugboard, and the letter A is pressed, it will send the electricity through the remainder of the machine as if B is pressed instead.
  • Each rotor has a criss-cross of wires running through it and acts like a general substitution cipher.
  • The reflector turns the 26 letters of the alphabet into 13 pairs. It “reflects” the electricity back through the machine in the reverse direction (that is, through the three rotors, then back through the plugboard, and then to the lampboard, showing the enciphered letter), albeit along a different path. The reflector was a fixed part of the machine; it didn’t change throughout the entire War.
  • The lampboard is where the ciphertext letter lights up once the electric circuit is completed.

During each letter press, the rotors move, thus changing the internal wiring connections, thus creating a different substitution. Hence the Enigma machine is a polyalphabetic substitution cipher.

This is important, for if the rotors didn’t rotate, it would be a simple mono-alphabetic substitution cipher, and could be broken by frequency analysis. The right rotor moves 1/26th of a full turn on every key press; the middle rotor rotates 1/26th after the fast rotor completes a full cycle; the left rotor (or slow rotor) rotates round by one letter only after the middle rotor has completed a full circuit.

Remark: the previous sentence is not completely true – the slow rotor / the middle rotor don’t actually click over when the middle / fast rotors (respectively) had completed a full circuit, but rather when they reached a designated letter. On the German Army machines, there were five rotors available (labelled with Roman numerals, I through V) and they clicked their neighbouring rotor over when they reached the letters QEVJZ (respectively). Most Enigma machines had slots for three rotors. However, the U-Boats (submarines) had slightly different machines which had slots for four rotors.

Deciphering

From looking at the route the electricity takes through the machine, it is clear that if two machines were set up in an identical manner, one machine could be used to decipher the ciphertext made by the other machine.

To see this, note that if instead of following the wires from the typed (plaintext) character to the lampboard (ciphertext character), you follow the wires from the ciphertext character, you would end up at the original plaintext character on the lampboard – you would essentially be following the wires “backwards”. This is a good thing, as it means there’s no need for separate machines to decode the messages: the same machine can act as both the encoder and the decoder.

That same line of thought also shows that an Enigma machine can never encipher a letter to itself, only to a different letter.

One might think this wouldn’t lead to any security issues (there are, after all, 25 other letters to choose from). However, someone once sent a test message which consisted of typing the same letter out multiple times. A British operator noticed that there was exactly one letter missing from the encryption, and hence guessed the entire plaintext. That guess was enough for her to work out the settings for the day, and read other, genuine, messages sent that day!

This inability for the machine to encrypt a letter to itself also enabled mathematicians at Bletchley Park to rule out huge swathes of potential keys each day, making the search for the daily keys more manageable. That is, although it didn’t at first seem too bad, this was a massive security hole in the machine, and one that was exploited by the Allies.

© University of York
This article is from the free online

The Mathematics of Cryptography: From Ancient Rome to a Quantum Future

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now