Deciphering the German Enigma Machine

One of the biggest technological invention during World War II!

Featured on Hashnode
Deciphering the German Enigma Machine

“Sometimes it is the people no one can imagine anything of who do the things no one can imagine.” ― Alan Turing

pic 1.png

World War II(1939-1945) saw the use of many advanced technologies. Technological innovations like the RADAR systems, "Vergeltungswaffe 2" or V2 missiles, the invention of Penicillin, the concept of the pressurized cabin and many more came out of World War II which we now use in our daily life. The Germans were one step ahead in these innovations.

They had developed an encrypted communications system, called "Enigma", which was considered by the people to be unbreakable. The Enigma Machine made it facile for the Germans to communicate their messages in an encrypted format without any fear of being cracked. The Allies had a colossal task of cracking this German encrypted machine.

The Germans made their Enigma machines more advanced so that it would become impossible to crack them using orthodox methods. In 1940, fleets of German U-boats are sinking thousands of tonnes of Allied supply ships in the North Atlantic. The U-boats were receiving the orders by enigma coded radio messages. This is where the Allies understood the need to crack the enigma codes to stop these attacks.

In 1939, a team was set up by Dilly Knox who was a codebreaker. This team consisted of Gordon Welchman, Peter Twinn, Joan Clarke and was led by Alan Turing. They built a machine called the " bombe " which helped them to intercept German secret messages during World War II.

image.png

Source:- www.telegraph.co.uk

YouTube video demos that you'll find in this article are under my YouTube Channel named " Electronic Technocrat ".

Now let's move our attention to Enigma Machine...

What was the Enigma Machine?

image.png

Source:- www.dw.com

The above picture demonstrates the Enigma machine. It was invented by Arthur Scherbius back in the year 1918 in Germany and did you know what it was first used for? It was invented for banking and the commercial world! Initially, the original design didn't include the plugboard and it only had three rotors.

image.png

Source:- twitter.com

They failed commercially so eventually it was taken over in 1928 by the Reich's marine which was the forerunner of the Kriegsmarine, the German Navy. When Adolf Hitler came into power, he saw it liked it and decided that the entire German military should use it. So basically, it was Hitler's one of the most powerful weapon he used in WW II!

The Enigma machines are a series of electro-mechanical rotor cypher machines. It was the famous encryption machine used by the Germans during WWII to transmit coded messages.

Cover page  (1).png

Now let's understand the various components this machine had.

Components of Enigma Machine

image.png

Source:- hackaday.com

Note:- I would just describe them in brief, not in a detailed manner so that you don't get confused or bored!.

Plugboard

image.png

Source:- commons.wikimedia.org

This is a Plugboard. You might be wondering what are these sockets alongside the alphabets and those connecting wires? The Plugboard has got 26 letters of the alphabet and by each letter, there's a socket. The machine was supplied with cables and each cable had a plug on each end so that pairs of cable could be bridged. The wires/cables connected letters up together in pairs.

Keyboard and Lampboard

image.png

Source:- allthatsinteresting.com

The keyboard looks very familiar to the modern-day keyboard with the QWERTY keypad, right? But can you spot one change in this keyboard?

giphy.gif

Yes, you got it right! In place of "Y" in QWERTY, there is a "Z" because it was a very common letter in the German language. There is an illuminated panel(called the Lampboard) of 26 letters just above the keyboard and each letter can be lit from underneath with a small bulb.

Rotors

image.png

Source:- mub.eps.manchester.ac.uk/science-engineerin..

The rotors are the heart of an Enigma machine. We have 3 rotors and on the right side of rotors we have an entry disc and on the left, we have a reflector. Each rotor can be set to one of 26 possible starting positions when placed in an Enigma machine.

The rotor consists of crisscrossed wires similar to spaghetti! When you press a letter, the right-hand side rotor rotates. These rotors can be removed and can be swapped. Each rotor has 26 starting positions.

So, when it reaches a full revolution, it will kick the middle rotor in one place. After the middle rotor reaches full revolution, it will kick the third rotor and this goes on. So the right-hand side rotor is called the fast rotor, the middle rotor is the middle rotor and the third rotor is called a slow rotor. On the outside of the rotor, they are labelled as 1,2,3,4 or a,b,c,d. You can shift/rotate those labels so each rotor has 26 ways to adjust its labels.

This resembles something right? Can you guess it?

giphy (5).gif

Correct! It resembles a clock with the hour, minute and second hands.

Easy to understand ain't it? Moving on to our most important section of this article...that is the working section😮...Don't worry. The more tedious it looks, the easier it is to understand😄...Let's begin!

giphy (1).gif

Understanding the working of Enigma Machine

image.png

Here I will be using an online Enigma Machine Emulator so as to demonstrate the working of the Enigma machine for you guys.

  • There are 2 German operators sitting miles apart from each other.

  • The first German operator will be given a plaintext message which he has to encrypt. Let's say that message is a very simple message that is "Hi".

  • If a message had to be accurately encrypted and decrypted, the condition was that both the sender and the receiver had to configure their Enigma in the same way. What did that mean? It means that rotor selection and order, ring positions, plugboard connections and starting rotor positions must be homogeneous. The initial starting position of the rotor is at times A-A-A for all 3 rotors. It is subject to change according to the operator.

  • After all the settings are been done, the first German operator would type the message(Hi) on the Enigma keyboard. With every letter pressed, a bulb lights on the Lampboard that indicates a pseudo-random substitution which is determined by the electrical pathways inside a machine. Also, the rotor position is changed by 2 places(From A to C) here cause the plaintext message is Hi.

  • The letter that was indicated by the lit bulb was been noted down by another operator.

  • This process continued until the whole message(Hi) was been typed. Now, the ciphertext obtained from the plaintext message(that is IO) was been sent by radio generally in Morse code fashion.

  • The second German operator who is sitting miles apart, along with his Enigma machine, with the same settings as that of the encrypting machine(setting used by the first German operator), would type the cyphertext(IO) and he obtains the plaintext(Hi) which the first German operator encrypted for him.

That's how the encryption and decryption were done using the Enigma machine.

This is how the Enigma machine worked! Way simpler than it is right? Yes, indeed it is!

giphy (2).gif

Why did the Enigma machine made use of light bulbs?

If the machine was built with a carriage like a typewriter with paper, it made it heavier. To be precise, 8 times heavier. This was the main reason behind using light bulbs as indicators.

giphy (4).gif

How did we get a different bulb lit every time we pressed the same letter?

giphy (3).gif

Let's take an example word as "Hello". Obviously, it has 2 L's in it. Now the question is, how do we get different output even though press the same letter?

The two L's in the word Hello were 2 different letters. So in the old-fashioned codes, if you have double letters, they would become double letters in your code. But this is not in the case of a codebreaker machine! If you press L twice, you will notice that the pattern is not similar(different bulbs lit).

When you press a key from the keyboard, there was a rotation of the right-hand rotor which resulted in a different substitution alphabet been used for every keypress. Every keypress uses a different electrical pathway which results in different substitution even if the same plaintext letter were entered again. So this is how a different bulb lighted up every time anyone pressed the same letter again and again.

How did the German operators sent their secret starting position for 3 rotors?

giphy (6).gif

The settings were written on a big monthly sheet of paper and the settings changed every day of the month. The first column is Datum(meaning Date), the second column is Walzenlage(meaning Rotor position), the third column is Steckerverbindungen(meaning Plug connections...plugboard) and the last one is Grundstellung(meaning Starting position of the rotors).

image.png

Source:- www.researchgate.net

The question is how did they send it?

  • First of all, they set the Enigma machine to the ground setting(Grundstellung).

  • Suppose the ground setting is XYZ. The German operator could then pick his own secret starting position like for example ABC.

  • Now this German operator has to send this secret starting position to another German operator. So for that, he has to include it at the beginning of the message.

  • So, he would type ABC into the Enigma machine twice...that is ABCABC. The ciphertext generated is QGLJYE(only an example). Now, he will add this to the beginning of the message he wants to send.

  • The other German operator with the Enigma machine will type QGLJYE and will come to know the secret starting position of the rotors! Wow, that is simply clever and brilliant!

giphy (7).gif

Enigma Models

Accessories

  • There are 6 ways to arrange the 3 rotors.

  • As said earlier, each rotor has 26 ways to adjust its labels. So if you do the calculations, The total number of ways you can set those ring labels is,

     26x26x26 = 17,576
    
  • In the third column, you see pairs of letters. the Plugboard in the front makes pairs of letters. Right now, we have 6 pairs of letters and the total number of ways that you can make six pairs of letters out of the alphabet is,

     100,391,791,500
    
  • The last column is the starting position of the rotors. Each rotor has 26 starting positions. so total number of starting positions is,

     17,576
    
  • The total number of ways to set up the Enigma machine would be,

     1.06x10^16 (10,000 Trillion)
    

giphy (8).gif

Conclusion

So basically, The German Enigma machine is the most famous example of the battle between code makers and codebreakers. The story of Enigma combines technology, military history, espionage, codebreaking and intelligence into a real thriller. The Germans invented this machine so as to make it almost impossible for anyone to crack their secret messages. At one point the Enigma machine seemed unbreakable. They, however, succeeded in this until Alan Turing with his machine called the bombe makes it possible to crack those complex German encrypted messages. This was the turning point of World War II and it helped the Allies a high time by shortening the war by 24 years!

If you haven't read my previous article, read it now via this

👉🏻link👈🏻

giphy (9).gif

Did you find this article valuable?

Support Ninad Ingale by becoming a sponsor. Any amount is appreciated!