4 min read

Alan Turing and the Enigma Code

How Alan Turing cracked the enigma code helping shorten the war and saving lives of millions.
Alan Turing and the Enigma Code
Sometimes its the very people who no one imagines anything of, who do the things that no one can imagine - Alan Turing

Britain was on the verge of losing the war against Germany during the Second World War. Though, they had one hope of winning it by breaking into German communications by cracking the enigma code with which the broadcasts of the Germans were encrypted.

In the mid-twentieth century, Arthur Scherbius developed a cipher machine that encrypts and decrypts messages called the Enigma Machine. The Enigma Machine was used to protect commercial, diplomatic and military communications. It was extensively used by Germany during the Second World War. Germans had a strong belief that the use of the Enigma Machine enabled them with a huge advantage of communicating securely during the second world war. They even used it for enciphering top-secret messages.

Well, you must have had the question of why did the germans had such strong beliefs about the Enigma Machine. Let's see what the enigma machine actually is and why did it serve such a competitive advantage to the Germans.

The Enigma machine is made of combinations of Mechanical and Electrical subsystems. The electromechanical rotor mechanism of the machine consisted of Electrical pathways, Rotors, Reflectors, Plugboard, and Entry Wheel

The message to be enciphered using the enigma machine was typed by a person on the enigma's keyboard and another person would write down which of the 26 lights above the keyboard lights up at each keypress. This way the plain text entered would turn into the encoded ciphertext. This also worked in reverse, where entering the ciphertext would turn into the plain text, therefore decrypting the message.

The rotor mechanism would change the electrical connections between the keys and the lights with each keypress. Therefore, even after clicking on the same alphabets twice, they would result in two different alphabets as ciphertext. For example, "AA" could turn into "JQ" or "PN".

To make this system even more secure, the set of machine settings were changed daily during the war which was based on secret-key lists distributed in advance. This made sure that the receiving station had to know and use the exact setting employed by the transmitting station to successfully decrypt a message.

Combining the three rotors from a set of five, each of the 3 rotor settings with 26 positions with the plugboard with ten pairs of letters connected the enigma machine produced 158,962,555,217,826,360,000 possible combinations (yep, that’s nearly 159 quintillions). This was the major reason why it was thought that the Enigma is impossible to crack and therefore, the strong belief the Germans had in it. Remember, these were the times before we had computers therefore it would be a major challenge for cryptographers to manually try cracking the code in the limited time as the settings were changed daily.

(5 × 4 × 3) × (263) × [26! / (6! × 10! × 210)] = 158,962,555,217,826,360,000 possible combinations

Here's a Cipher Text :

jdmnb faure jpdic yytmn bedf

You can try to decrypt it using an online version of the Enigma Machine.

ok, now we know what the enigma machine actually was and why was it so hard to crack the enigma code. Now, let's see what role Alan Turing played and how he was able to crack the enigma code.

During the Second World War, Alan Turing worked for the Government Code and Cypher School at Bletchley Park(Britain's codebreaking center that produced Ultra Intelligence). For a time he led Hut 8, the section responsible for German Naval Cryptanalysis.

Within weeks after arriving at Bletchley Park, Turing specified an electromechanical machine called the bombe.

The Bombe would search for possible correct settings used for the Enigma message (i.e the rotor order, rotor settings, and plugboard settings) using crib (plain text and its encrypted version). For each possible setting of the rotors, the bombe performed a chain of logical deductions based on the crib which was implemented electromechanically.

The team at Bletchley Park was able to guess some of the plaintext based upon when the message was sent and by recognizing routine operational messages. For instance, the daily weather report would be sent at the same time regularly and would contain the word "Wetter"(German for weathers) at the same location in every message. Many operators would send standard salutations. Also, the occurrence of "Heil Hitler" at the end of the message was common.

This helped the British to decrypt the messages broadcasted by Germany and gave them a major advantage in the war. Turing played a crucial role in cracking intercepted coded messages that enabled the Allies to defeat the Nazis in many crucial engagements, including the Battle of the Atlantic. Professor Jack Copeland estimated that Turing's work shortened the war in Europe by more than two years and saved over 14 Million Lives.

Alan Turing is regarded as the Father of Computer Science for the major contributions he made in the field of computers. Turing is widely known for the Turing Machine, Turing Test, Turing Pattern, and many more things. There has been a movie made on Turing's life called the "Imitation Game" starring Benedict Cumberbatch which you guys should definitely check out.