The Most Famous Cipher Machine of All Time - “The Enigma”

Over the time from prehistoric era to present world, man wanted to send secret messages of valuable information. At first they sent a trusted messenger to deliver the letter. But it was insecure as the information might go to wrong hands. To avoid the risk, man tried to hide the message inside a message which gives a different meaning to the original. This message hiding method was later developed as “Cryptography”.

The evolution of cryptography over the past few decades has remarkably developed and different message encrypting methods were found. The most amazing invention of the Cipher machine history was invented during World War II. That is the “so called” unbreakable Nazi cipher, The Enigma machine.

History

World War II

The Second World War sparked by the Adolf Hitler’s invasion of Poland in 1939 was dragged until 1945 where Allied forces defeated Germany and Japan. It was the deadliest war in the human history involving more than 30 countries and resulting in more than 50 million military and civilian deaths. During the WWII many inventions were done by the Germans and as well as the Allied countries.

The top 10 inventions are,

  1. Penicillin
  2. Jerry Cans
  3. The pressurized cabin
  4. Radio Navigation
  5. Radar
  6. Synthetic rubber and synthetic oil
  7. The V-2 rocket
  8. The jet engine
  9. Nuclear power
  10. The Original Computer – The Enigma machine and Lorentz machine.

The Enigma machine

Figure 01 : Enigma A

The history of Enigma starts around 1915, with the invention of rotor-based cipher machine. Officially the Enigma was invented by Arthur Scherbius in 1918, after the World War I. In 1923, the first machine came out after several improvements. As the first machine printed the output directly on a paper like a typewriter, it was known as the Schreibende Enigma (writing Enigma) and as Enigma A. Due to the low reliability of the Enigma A, Scherbius developed Enigma C (probably unsuccessful Enigma B) which produced its output on a lamp panel in 1924. It was known as Gluhlampenmaschine (glow lamp machine).

Figure 02 : Enigma I

In 1926, the German army showed interest in the Enigma machine and invested in developing the machine. In 1933, German Army acquired the manufacturing rights to the Enigma machine and many companies were contracted to manufacture it for the army. There were many models of Enigma machine. German Army (Wehrmacht) and Air Force (Luftwaffe) used Enigma-I and German Secret Service (Abwehr) used Enigma-G model. For the German Navy (Kriegsmarine) a model similar to and compatible with the Enigma-I was developed.

How it work?

The Enigma is an electro-mechanical device which can operate with an electric signal passing through wires and few other mechanical tools.

Figure 03 : Encrypting Letter T

Figure 03 shows how letter ‘T’ typed on the keyboard can be changed into the letter ‘G’ in the light-board (output). If someone tried to encrypt letter ‘T’ again, the cipher letter is different. How is it possible?

Let the original text = N U M B E R P H I L E

From an original enigma machine, the following cipher text was obtained according to its configurations at the moment.

The cipher text = Y T M Y I U R F G W

According to the above example, it can be noticed in the cipher text that, cipher letter ‘Y’ appears twice for two different letters (N, B) in original text. Meanwhile for the letter ‘E’ in original text, there are two letters (I and W) in the cipher text. Therefore, every time when the same message is encrypted, different codes will be generated. That is why the Germans thought that Enigma is unbreakable.

The Enigma machine is equipped with rotors. Whenever a letter is pressed in the keyboard, the rotors move.

Figure 04 : Enigma Machine Rotor Arrangement

When the Rotor1 does a full turn, it will move the Rotor2 one place and the Rotor1 keeps moving. Eventually when Rotor2 finishes a full turn, it will move Rotor3 one place. And the Rotor1 will keep moving, such that Rotor1, Rotor2 and Rotor3 can be expressed as fast rotor, middle rotor and slow rotor respectively according to the rotating speed. This is similar to how clock hands move. This whole part is run by a circuit where the wires are placed inside the rotors and powered by a battery. This battery lights up the bulb of the relevant code in the light-board.

Figure 05 – Extra Plug Board in the Enigma Machine

There is also an extra plug-board in the Enigma machine used by German Army, Air Force and Navy. The red and blue wires shown in the figure connects two letters into two separate pairs. The red wire connects F and M while the blue wire connects Y and O. They can be swapped too. Ten such pairs can be made in the plug-board. When a letter is pressed, first the signal will go through the plug-board and then to the Rotor1, Rotor2, Rotor3 respectively. And the signal would loop back going through the machine in reverse order and go through the plug-board before lighting the lamp-board.

So then why Enigma was difficult to break?

Each rotor in the machine has 26 starting places and those rotors can be swapped. Also there was a box of five rotors out of which three rotors have to be selected. Since thousands of settings can be configured, each setting will produce a different code. This can be shown as follows.

  • Picking three rotors from a box of five
    • Rotor : 5 * 4 * 6 = 60
  • Starting positions for rotors
    • Starting : 26 * 26 * 26 = 17 576
  • Plug-board calculation: need only 10 pairs out of 26. (20 letters into 10 pairs)
    • 26! / ( 6! * 10! * 2^10 ) = 150 738 274 937 250
  • Total Number of Combinations = 158 962 962 555 217 826 360 000 (158 quintillion, 962 quadrillion, 555 trillion, 217 billion, 826 million, 360 thousand)

According to the above calculated total no.of settings, the Enigma was considered as unbreakable. But then there is a question. How did the Germans communicate about their plug settings and starting rotor numbers? For that Germans used a monthly sheet of paper for each day of the month which said how to set the machine in the particular day. Therefore, if the Allied wanted to know the secret messages of German Forces, they needed to have the monthly sheet as well. But it was very difficult to find one as it was updated every month.

Then how did the British broke the Enigma code? Here comes the Story.

 Breaking Engima code

The Polish

Polish (Poland) were the first people who came close to crack the Enigma code.  The initiation was made by the Polish Cipher Bureau (Biuro Szyfrów) by starting researches on commercial Enigma. The Polish Cipher Bureau recruited three mathematicians, Marian Rejwski, Jerzy Rózycki and Henryk Zygalski from University in Poznan to work on the Enigma with a handful of intercepted messages and a description of Commercial Enigma(without the plug-board). Rejwski deduced the internal secret wiring of the Enigma started developing various aids for the regular decryption.

In 1933, Polish Cipher Bureau could get the access to the Enigma operation procedures. In 1938, Germans discovered the mistake of doubly-enciphered message indicator and changed it. They added two extra rotors which made five rotors box.

Figure 06 – Bletchley Park

Bletchley Park

Figure 07 – Alan Turing

Bletchley Park was the home of the British Cipher Bureau. Initially, Enigma messages were broken ‘by hand’ using pen and paper methods and with the help of Jeffrey sheets (similar to Polish Zygalski sheets). But as the rate of traffic increased, Alan Turing (a member of the official code-breakers in Bletchley Park) started looking for an automated solution. Based on Polish Bomba and the information from the Polish codebreakers, Turing along with another codebreaker, Gordon Welchman developed Bombe machine which uses a more universal method based on guessed plain texts. It was able to break the code within 20 minutes.

In 1941, Turing discovered the wiring of additional wheels and naval message indicator procedure. On 2nd February 1942, German Navy introduced a new Enigma machine which had an extra cipher wheel inserted between the leftmost wheel and the reflector. And they changed the indicator system and new codebooks were introduced. This was known as Enigma M4. The Bombe machine which was similar to 36 Enigma machines was able to attack only 3-wheel Enigma machine. In order to attack Enigma M4, the Bombe machine was developed into a 24-Enigma 4-wheel Bombe.

Figure 08 – Bombe Machine

Even though the Enigma was a powerful cipher, there was a flaw in it.

Suppose that the same letter was pressed in the keyboard 25 times. Each time a different letter is shown in the lamp-board excluding the original letter. For an example if letter ‘K’ was pressed 25 times, different letters will be produced each time but, it will never be ‘K’ itself. This was the flaw in the Enigma. This was used by Turing to break the Enigma code.

           

And that is the story of “The Enigma”. Historians estimate that breaking Enigma shortened the war by more than two years, saving over 14 million lives. Alan Turing’s work has inspired generations of research into what scientists called “Turing Machines”. Today we call them COMPUTERS.

“Can machines ever think as human beings do?”

“Most people say not. Of course machines can’t think as people do. A machine is different from a person. Hence they think differently. The interesting Question is justbecause something thinks differently from you, does that mean it’s not thinking?”

-Alan Turing (extracted dialogue from the movie “The Imitation Game”)

References:

  1. Crypto Museum. (n.d.) History of the Enigma. [Online]. Available From : http://www.cryptomuseum.com/crypto/enigma/hist.htm#top_of_page
  2. Brady Haran. (2013) Flaw in the Enigma Code – Numberphile. [Online]. Available From : https://www.youtube.com/watch?v=V4V2bpZlqx8
  3. Brady Haran. (2013) 158,962,555,217,826,360,000 (Enigma Machine) – Numberphile. [Online]. Available From : https://www.youtube.com/watch?v=G2_Q9FoD-oQ
Reporter,
B.M.Narmada Balasooriya
Third Year,
Department of Computer Engineering,
Faculty of Engineering,
University of Peradeniya