Cryptography

The Enigma Machine: How WWII Codebreakers Unlocked the Greatest Mystery of the War

Easy
10 min

Enigma machine

During World War II, cryptography was at the center of warfare, and one of the most significant technological puzzles was the Enigma machine. This German encryption device was designed to send and receive encrypted messages that were practically unbreakable by the standards of its time. Breaking the secret of the Enigma machine was a key goal of the Allied intelligence community, and this achievement has been recognized as one of the turning points of World War II.

Operation principle of the Enigma machine

The Enigma was based on a complex mechanical system, which included several rotating rotors and a plugboard. When the operator entered a message into the machine, each letter passed through different rotors, whose positions changed with each key press, changing the original letter to a different letter in the encrypted message. This created an endless number of possible settings, making breaking the Enigma code extremely difficult.

Machine settings

The settings of the Enigma machine consist of several parts that together determine how the machine encrypts the message.

These settings are:

Root selection

The Enigma machine had several interchangeable rotors, each marked with a number or letter. Each rotor had its own unique internal wiring. The machine user selected several rotors (usually three or four depending on the model of the machine) and placed them in a specific order in the machine.


Root settings

Each selected rotor could be set to a specific initial letter or number, which determined the rotor's starting position. These settings changed the way in which each rotor's internal wiring encoded the message.


Daily setting

Setting up the initial rotor positions to begin message encryption. It was like fine-tuning the rotor settings, which further altered the nature of encryption.


Connection board (Steckerbrett)

This part allowed the machine user to swap letters before and after passing through the rotors. The patchboard had several pairs of connections, which allowed two letters to be linked together, exchanging their positions both in encryption and decryption.


Reflector

The reflector was a fixed rotor that sent the electric current back through the rotors but through a different path, increasing the complexity of encryption. The reflector could not be adjusted, but different machines had different reflectors.


The combination of these settings created a vast number of possible encryption keys, making breaking the encryption used by the Enigma machine extremely difficult without the correct settings. Each day different settings were used, which were distributed in secret key lists to Enigma machine users.

Cracking the code

The process that led to breaking the Enigma code was multi-stage and required exceptional mathematical genius. At the center of it was the British mathematician Alan Turing, who worked at Bletchley Park in England, a secret code-breaking center.

Turing and his team developed a device called the "Bombe" machine. This mechanical device was designed to simulate the operation of the Enigma machine and speed up the testing of rotor settings, which would have been practically impossible without mechanical assistance.

This is what the Bombe device looked like!

An important part of breaking the Enigma code was also the captured parts of the enemy's message traffic and the "Ultra" project, which was a codename for extremely secret information obtained through breaking Enigma messages. In addition, Poland's contribution was significant; Polish cryptologists Marian Rejewski, Jerzy Różycki, and Henryk Zygalski had already developed methods for breaking the Enigma code before the war, and their work was the foundation for what Turing and his team later continued.

Exercise

You are part of the code-breaking unit during World War II. You have just intercepted a German message that is encrypted with an Enigma machine. You know that the message contains critical information about the enemy's upcoming moves. Successfully breaking the code could give you a strategic advantage and potentially save thousands of lives.


Your intelligence has successfully captured a German messenger who was on his way to the command center. In his possession, he had notes revealing the settings of the Enigma machine used for message encryption.

CyberChef

Use (pre-configured for you) CyberChef tool Enigma module to solve the exercise.

Here are the settings. To save time, they should already be selected for you if you followed the link above. Feel free to try playing with different settings though :)

Root Selection (selected roots)

  • Left rotor: II
  • Middle rotor: V
  • Correct rotor: III

Root Causes of Cyber Threats

  • Left rotor: A
  • Mid rotor: D
  • Correct rotor: G

Root settings

  • Left rotor: A
  • Middle rotor: B
  • Correct rotor: C

Connection board (Steckerbrett)

AD BE CF

Reflector

Reflector B (AY BR CU DH EQ FS GL IP JX KN MO TZ VW)

Compromised message

UJRNF H

What is the content of the message?

hakatemia pro

Ready to become an ethical hacker?
Start today.

As a member of Hakatemia you get unlimited access to Hakatemia modules, exercises and tools, and you get access to the Hakatemia Discord channel where you can ask for help from both instructors and other Hakatemia members.