The Enigma Cipher Machine
Total Page:16
File Type:pdf, Size:1020Kb
The Enigma Cipher Machine Anna Hurlbut 2018-11-27 Abstract The Enigma cipher machine was invented in the early 1920s to help businesses protect commercial secrets, but the German military soon saw its potential application to military communications. By the mid-1930s, every branch of the German military was using Enigma for nearly all their encrypted communications. The electromechanical cipher machine works using a system of wires, rotors, a reflector and a plugboard to send an electrical signal from the keyboard to the lampboard, encrypting each message letter by letter. Enigma masterfully balances ease of use and security, the opposing forces of any cryptosystem. The key space is ap- proximately 15 million million million, and it could be compared to a Vigen´erecipher with a key length of 16900. Though it seemed infallible, the infamous machine eventually failed. While the cryptosystem did have inherent technical flaws, its defeat was mainly a result of errors in human operation. British intelligence at Bletchley Park was able to find patterns in German messages and used these patterns as cracks to break into the entire system. Enigma represents a vital moment in the field of cryptogra- phy. It initiated the transition from by-hand methods to automated and mechanized methods and acted as a catalyst for the development of com- puters. Additionally, Enigma's ultimate failure illustrated the inadequacy of security through obscurity and pointed the future of cryptography to- wards more advanced methods. 1 Contents 1 Historical Context 3 2 Cryptography Basics and Simple Substitution Ciphers 4 2.1 Caesar Cipher . 6 3 The Vigen´ereCipher 6 3.1 Vigen´ereCryptanalysis . 9 4 The Enigma Cipher Machine 11 4.1 Keyboard . 11 4.2 Plugboard . 12 4.3 Static Wheel . 13 4.4 Rotors and Scrambler . 13 4.5 Reflector . 17 4.6 Lampboard . 17 5 Enigma Strengths 18 6 Enigma Vulnerabilities and German Blunders 19 7 Breaking Enigma 20 7.1 Polish Cryptanalysis . 20 7.2 British Cryptanalysis . 20 8 Implications in the Field of Cryptography 22 2 1 Historical Context The Second World War provided a catalyst for technological and mathematical progress. Out of the war effort was born innumerable improvements in various fields, and cryptography was no exception. The field of cryptography is one that stretches far back in human history, nearly to the beginning of language itself. For as long as mankind has sought to communicate with one another, the com- municators have sometimes attempted to do so in secret. The word cryptogra- phy comes from the Greek words kryptos, meaning hidden, and graphia, meaning writing. It is an ancient field with a long history of innovations, but the primitive methods of pre-war cryptography were ill fitted to the fast pace of the Second World War. During World War I, military communications were accomplished primarily using codebooks and clunky, time-consuming, and confusing methods of encrypting and decrypting messages by hand.[3] Consequently, out of neces- sity arose the advent of machine ciphers. After their defeat in the Great War, Germany realized that its intelligence operations were greatly lacking|a large contributor to their failures|and recognized need for improved military com- munications and intelligence.[3] German Marine Captain Heinz Bonatz stated, \Neither the German High Seas Fleet nor the Naval War Staff hit upon the idea that it was German naval radio traffic which supplied the British their knowledge."[3, p. 13] It was clear that the current methods would no longer be adequate, especially since the German military forces needed rapid and frequent communications to execute their new Blitzkrieg war tactics.[3] They needed a way to encrypt and decrypt messages that was quick and easy to use, but also secure and nearly impossible to break. Hugo Alexander Koch, a Dutch inventor, designed and constructed the Enigma machine just after World War I for protecting commercial secrets in the business world. The patent was soon purchased by Arthur Scheribus, a German manufacturer, who also marketed the machine to the business world.[3] In 1926, the German Marines took up Enigma, and the army did so shortly after. They made numerous modifications and improvements to increase secu- rity, each military branch eventually ending up with a slightly different version of the machine.[3] By the mid-1930s, all branches of the German military were using Enigma for nearly all of their encrypted communications.[3] Polish intelligence made great strides in cracking Enigma throughout the latter half of the decade by rebuilding Enigma's internal structure and analyzing the signals they received, but as the German invasion of Poland loomed, the Poles passed off their acquired intelligence to the British and French.[3] The British then set up facilities at Bletchley Park, about fifty miles north of London, and stationed men and women of the Government Code and Cypher School there to devote undivided attention to German radio communications.[3] Though it initially seemed unbreakable, the British and their allies took ad- vantage of Germany's human errors and found much success deciphering mes- sages by looking for repeated or predictable segments and using these to uncover the rest of the message.[3] The decrypted messages and intelligence gleaned from them were given the code name \Ultra" and were used with much discretion. 3 Ultra intelligence could only be acted on if there was a plausible cover story regarding how the Allies got the information. Still, decrypted Enigma messages made it possible for the Allied forces to \avoid waiting U-boats, anticipate sur- prise attaches, and send their own troops to the German's most vulnerable points."[3, pg. 4] However, the Germans were so sure of Enigma's security that they failed to question the Allies' mounting intelligence, crediting Allied power knowledge and success to other possible information leaks, exactly as the British intended.[3] Even after war ceased, as Enigma rumors spread, Ger- man military leaders obstinately asserted its infallibility. They reasoned that the Allies would be publicly boasting of a broken Enigma had they succeeded in decrypting German codes. After all, who could stand to keep such an ac- complishment to themselves? The Germans also claimed they would have seen evidence of Enigma-cracking in intercepted and decoded Allied communications. Therefore, they presumed Enigma to be in tact and German cryptography to be entirely secured. This insistence persisted even into the 1970s when the Al- lies finally announced publicly that they had indeed cracked Enigma during the war.[3] So how did Enigma work exactly? Why were the Germans so sure of its invulnerability? Why were they wrong? How did the analysts and mathemati- cians at Bletchley Park manage to break the unbreakable code? This, and more, we will explore, but before we can confront the infamous Enigma machine, we must begin with some cryptography basics. 2 Cryptography Basics and Simple Substitution Ciphers One of the simplest examples of a cryptosystem is a simple substitution cipher, of which there are many forms. The basic premise of a substitution cipher is to encrypt each letter in the alphabet to a predetermined letter. No two letters can be encrypted to the same letter. In other words, it must be an injective function.[2] For this type of encryption to work, it is essential that both parties, the sender and the receiver, know the substitution alphabet being used. Otherwise, the receiver would be unable to decrypt the message. Consider the following example. Let Table 1 indicate the encryption alphabet. Assume that Alice would like to send a message that says, \I LOVE CRYPTOGRAPHY," to her friend Bob. This original message in readable form is known as the plaintext.[2] Before she sends the message, Alice must encrypt it, so she uses the encryption alphabet to encrypt each letter in the plaintext message to its corresponding letter in the second column of the table. Starting from the beginning, I is encrypted to X, L is encrypted to P, O is encrypted to O, and so on. She continues this process until she has encoded the entire message so it reads, \X POGJ HFMRDOYFSRAM." This is known as the ciphertext and is what is sent to Bob. Once Bob receives the message, he does the same process in reverse to recover the plaintext, \I LOVE 4 Table 1: Substitution Cipher Encryption Alphabet Letter Encrypted As A S B C C H D V E J F K G Y H A I X J U K L L P M Z N E O O P R Q B R F S T T D U W V G W I X N Y M Z Q CRYPTOGRAPHY." Bob can then send a response using the same method. In this type of cipher, the encryption alphabet forms the key, the information needed to transform plaintext into ciphertext and vice versa.[2] A large factor in determining the security of a cryptosystem is its key-space, which is the number of possible keys. How big is the key-space for a simple substitution cipher using the English alphabet? The answer can be calculated using a simple combination. First of all, the letter A can be encrypted to any one of the 26 letters in the alphabet. Next, B can be encrypted to any of the remaining letters (25 possibilities). There are 24 choices for C, and we continue on until we get to Z, at which point there is only one remaining letter that we can use. Therefore the size of the key-space is 26! = 403; 291; 461; 126; 605; 635; 584; 000; 000. A random guess of the encryption alphabet is pretty unlikely.