Thursday 21 May 2020

Enigma - The Once Unbreakable

“Sometimes it’s the people no one imagines anything of who do the things no one can imagine.” - Alan Turing

We all are well introduced with world wars from our history classes that our dear world survived and still stand with its head held up high. During World War II, Germany with the hope of winning for the second time employed an encryption device to protect commercial, military, and diplomatic conversions which were known as “Engima”.

Enigma has an electromechanical rotor mechanism that scrambles 26 letters of English alphabets. When the plain text was entered in, the lit-up letters are the encoded ciphertext. Entering ciphertext transforms it back into readable plaintext. The rotor mechanism changes the electrical connections between the keys and the lights with each keypress. 

History


The German engineer Arthur Scherbius by the end of World War I invented an encryption device by 1918 and finished marketing it under brand name “Enigma” by 1923. The early models were being in the application by the 1920s adopted by several countries and mostly by Nazi Germany before WW II. Several different models inspired from it were made but the most complex was the German one. Many people know that when invented by the Germans, the information was first leaked to the French, and the first reconstruction was created by the Pole before it was offered to Britain's codebreakers as a way of deciphering German signals traffic during World War Two. As a result of the information gained through this device, it has been claimed, hostilities between Germany and the Allied forces were curtailed by two years.


How Does It Work?


Enigma allowed the operator to type in a message and scramble it with three to five notched wheels or say rotors that were fitted inside which displayed different letters of the alphabets. The receiver needed to know the exact settings of these rotors to reconstitute the coded text. Over the years the basic machine became more complicated, as German code experts added plugs with electronic circuits.
The more interesting thing about Enigma was the setting of the rotor which made it more complex. Each month, Enigma operators received codebooks that specified which settings the machine would use each day. Every morning the code would change.

The following setting example has been referenced from https://brilliant.org/:

For example, one day, the codebook may list the settings described in the day-key below:


1. Plugboard settings: A/L – P/R – T/D – B/W – K/F – O/Y


A plugboard similar to an old-fashioned telephone switchboard has ten wires, each wire having two ends that can be plugged into a slot. Each plug wire can connect two letters to be a pair (by plugging one end of the wire to one letter’s slot and the other end to another letter). The two letters in a pair will swap over, so if “A” is connected to “Z,” “A” becomes “Z” and “Z” becomes “A.” This provides an extra level of scrambling for the military.

To implement this day-key first you would have to swap the letters A and L by connecting them on the plugboard, swap P and R by connecting them on the plugboard, and then the same with the other letter pairs listed above. Essentially, one end of a cable would be plugged into the "A" slot and the other end would be plugged into the L slot. Before any further scrambling happens by the rotors, this adds a first layer of scrambling where the letters connected by the cable are encoded as each other. For example, if I were to encode the message “APPLE” after connecting only the "A" to the "L", this would be encoded as “LPPAE”.


2. Rotor (or scrambler) arrangement: 2 — 3 —1


The Enigma machines came with several different rotors, each rotor providing a different encoding scheme. To encode a message, the Enigma machines took three rotors at a time, one in each of three slots. Each different combination of rotors would produce a different encoding scheme. Note: most military Enigma machines had three-rotor slots though some had more.

To accomplish the configuration above, place rotor #2 in the 1st slot of the enigma, rotor #3 in the 2nd slot, and rotor #1 in the 3rd slot.

3. Rotor orientations: D – K –P
 

On each rotor, there is an alphabet along the rim, so the operator can set in a particular orientation. For this example, the operator would turn the rotor in slot 1 so that D is displayed, rotate the second slot so that K is displayed, and rotate the third slot so that P is displayed.

Each of the three rotors will display a number or letter (the rotors in the image above have letters), and when the rotors turn, a new set of three numbers/letters appears. With the initial set of three numbers/letters (meaning the numbers/letters on the sender’s machine when they began to type the message), a message recipient can decode the message by setting their (identical) Enigma machine to the initial settings of the sender’s Enigma machine. Each rotor has 26 numbers/letters on it. An Enigma machine takes three rotors at a time, and the Germans could interchange rotors, choosing from a set of five, resulting in thousands of possible configurations. For example, one configuration of rotors could be rotor #5 in slot one, rotor #2 in slot two, and rotor #1 in slot three.

In the first slot, there are 5 rotors to pick from, in the second there are 4 rotors to pick from, and in the third slot there are 3 rotors to pick from. So there are 5* 4* 3 = 60 ways to configure the five rotors.

There are 26 starting positions for each rotor, so there are 26×26×26=17,576 choices for initial configurations of the rotors’ numbers/letters.

The features above describe the components of commercial Enigma machines, but military-grade machines have additional features, such as a plugboard, which allows for even more configuration possibilities. Since there are 26 letters in the alphabet, there are 26! ways to arrange the letters, but the plugboard can only make 10 pairs, so there are 20 letters involved with the pairings, and 6 leftovers that must be divided out.

 Furthermore, there are 10 pairs of letters, and it does not matter what order the pairs are in, so divide also by 10! and the order of the letters in the pair does not matter. The resulting number of combinations yielded by the plugboard is as follows = 150,738,274,937,250. Therefore, there are 158,962,555,217,826,360,000 total number of ways to set a military-grade Enigma machine.


How was the Enigma decrypted by Britishers?


Alan Turing played a key role in decrypting the Enigma which resulted in the Germans’  defeat. He along with a colleague Gordon Welchman created a machine named “Bombe”.This device helped to significantly reduce the work of the code-breakers. From mid-1940, German Air Force signals were being read at Bletchley and the intelligence gained from them was helping the war effort.

After all the efforts made by the polish, the Germans added two more rotors which complicated the recognition of messages by them. Therefore, on 26 and 27 July 1939, in Pyry near Warsaw, the Poles initiated French and British military intelligence representatives into their Enigma-decryption techniques and equipment, including Zygalski sheets and the cryptologic bomb, and promised each delegation a Polish-reconstructed Enigma. The demonstration represented a vital basis for the later British continuation and effort.

In September 1939, British Military Mission 4, which included Colin Gubbins and Vera Atkins, went to Poland to evacuate code-breakers Gwido Langer, Marian Rejewski, Jerzy Różycki, and Henryk Zygalski out of the country with their replica Enigma machines. The Poles were taken across the border into Atkins' native Romania, at the time a neutral country where some of them were interned. Atkins arranged for their release and onward travel to Western Europe to advise the French and British, who at the time were still unable to decrypt German messages.

Gordon Welchman, who became head of Hut 6 at Bletchley Park, has written: "Hut 6 Ultra would never have gotten off the ground if we had not learned from the Poles, in the nick of time, the details both of the German military version of the commercial Enigma machine, and of the operating procedures that were in use.

During the war, British cryptologists decrypted a vast number of messages enciphered on Enigma. The intelligence gleaned from this source, codenamed "Ultra" by the British, was a substantial aid to the Allied war effort.

Though Enigma had some cryptographic weaknesses, in practice it was German procedural mistakes, failure to systematically introduce changes in encipherment procedures, and Allied capture of key tables and hardware that, during the war, enabled Allied cryptologists to succeed and "turned the tide" in the Allies' favor.

Stay Tuned for the upcoming blogs included in the five-blog mini-series “Decrypting World War II communications”.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Good to read, how technology was crucial be it those times or now. Kudos for the good research!

    ReplyDelete
    Replies
    1. Thank You. We hope for your reviews and suggestions ahead as well.

      Delete