What is Enigma Machine (How it Works)

The enigma machine is an encryption machine that encrypts messages before transmission. It was used by the Germans in the world war 2.

A brief history of the Enigma Machine:

A German engineer, Arthur Scherbius invented the first Enigma machine towards the end of the first world war.

Enigma machine was used for field purposes during the war with the encryption code called “Enigma”.

Before the Nazi Germany decided to use the Enigma in its operation, various models of Enigma were already commercially available around 1920s.

The model used by the German military was referred to as, the Wehrmacht Enigma.

Here is a list of enigma machines models and variants throughout the history:

  • Glowlamp Enigma (1924)
  • Commercial Enigma (1926)
  • Zählwerk Enigma (1928)
  • Military Enigma (1932)
  • The Abwehr Enigma
  • The Japanese Enigma
  • Enigma A
  • Enigma B

The history of the Enigma machine can be very complex since many different models and variants were made for both commercial and military use.

The enigma machine family tree:

The Enigma is one of the best encryption machines made in history.

The need for encryption was due to: “all communications used radio transmission which could be easily listened to”.

This encryption scheme was very strong compared to other methods that existed before.

Enigma machine

In this guide, I will be discussing the following:

  • How did the enigma machine work.
  • How secure was the enigma machine.
  • Cryptanalysis of the Enigma.

How the Enigma machine works

The Enigma machine was both mechanical and electrical device. It looks more like a typewriter.

Basically you input a given letter of your message and a letter lights up showing to which encrypted letter it has been replaced with.

The machine has 3 or 4 physical rotors built in. Each of these rotors take in a letter and produces a different one as the output.

This is the mode of operation: “The letter passes through the rotors, bounces off a reflector, and then finally passes through all the rotors on the opposite direction”.

Rotors performed simple encryption in form of a substitution cipher.

For example: the pin that matches to the letter “A” could be wired to the contact for the letter “G” on the opposite side. Several rotors are used in series to improve the security of the machine.

There is also a regular stepping movement of the rotors ( could be 3 or 4) to help in implementing a kind of polyalphabetic substitution cipher.

During the encryption process, the board lights up showing the encrypted letter as output.

Then the first of the rotors clicks round one position thus changing the output even the case when the second letter input is similar to the first one.

The first rotor has to make 26 clicks before the second rotor clicks. Also the second rotor has to make 26 clicks before the third rotor clicks. This gives you around “17000” unique possible combinations.

A plug board is located between the main rotors and the input and output. It swaps pairs of letters to scramble the letters even further. Up to 10 pairs of letters can be swapped by the plug-board.

So how can you decode a message encrypted using enigma cipher?

Here is the information you need to know before you can successfully decode a message:

  • The rotors, including their order
  • Starting positions of the rotors
  • Ring settings (Ringstellung)
  • Plug board settings (Steckerverbindungen)

To decode, use ciphertext as your input to the machine and the output you get will be the original plaintext (the message).

How secure was the enigma machine

Here is the mathematical expression of how secure enigma was.

If there are there rotors, the possible combinations are:


The complexity added by the plug board:


This is the total possible configuration of the enigma machine:


Cryptanalysis of enigma machine

There are many techniques that can be used to break the enigma.

Here are a few resources about cryptanalysis of the enigma:


Add Comment