Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Enigma Machine Eric Roberts CS 106A February 3, 2016.

Similar presentations


Presentation on theme: "The Enigma Machine Eric Roberts CS 106A February 3, 2016."— Presentation transcript:

1 The Enigma Machine Eric Roberts CS 106A February 3, 2016

2 Once upon a time...

3 Cryptography—Bletchley Park I’ve twice had the opportunity to teach cryptography at Stanford in Oxford, which made it possible to visit Bletchley Park—the home of the Government Code and Cipher School (GCCS), where the Enigma code was broken. Oxford Bletchley

4 Cryptography—Bletchley Park In our field trips to Bletchley Park, our tour was led by Jean Valentine, who worked with the Bombe decryption machine shown in these pictures.

5 The Enigma Machine

6 Overview of Assignment #4 Part 1: Check that a key is legal In a letter-substitution cipher, the key must be a permutation of the alphabet, which means that it contains all the letters of the alphabet in some order. Your job in Part 1 is to add code to check that the key entered in the LetterSubstitutionCipher program is legal, as in the following sample run: LetterSubstitutionCipher Letter-substitution cipher. Enter 26-letter key:SHORTKEY Plaintext:HAL 9000 Ciphertext: IBM 9000 That key is illegal. Enter 26-letter key:AABCDEFGHIJKLMNOPQRSTUVWXY That key is illegal. Enter 26-letter key:BCDEFGHIJKLMNOPQRSTUVWXYZA

7 Overview of Assignment #4 LZDRXPEAJYBQWFVIHCTGNOMKSU ABCDEFGHIJKLMNOPQRSTUVWXYZ |||||||||||||||||||||||||| HKRCGNTQPIXAWUVFLDYSZOMEJB RWA | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | | S | T | U | V | | X | Y | Z | Encryption key: Decryption key: Part 2: Invert a key In a letter-substitution cipher, the sender and receiver must use different keys, one for encryption and one for decryption. Your job in Part 2 is to write an invertKey method that determines the decryption key from the encryption key by going through the alphabet and, for each letter, figuring out what plaintext letter would have produced that letter in the ciphertext.

8 Overview of Assignment #4 Part 3: Simulate the Enigma Machine

9

10 The Enigma Rotors

11 The Enigma Structure

12 Operation of the Enigma Machine Whenever the operator types a letter key on the Enigma, the following things happen: 1.The force of the key press advances the fast rotor one position. If the indicator on the fast rotor wraps around from Z to A, that action “carries” to the medium rotor, just like the digits on an odometer. Similarly, if the medium rotor passes Z, the slow rotor advances one position. 2.An electrical signal is fed into the wire corresponding to the key, which then flows through seven letter-substitution steps: –Through the fast rotor from right to left. –Through the medium rotor from right to left. –Through the slow rotor from right to left. –Through the reflector, which turns the signal around. –Through the slow rotor from left to right. –Through the medium rotor from left to right. –Through the fast rotor from left to right and then on to the lamp.

13 Encoding the Letter “A”

14 The Next “A” Is Different

15 What Made Enigma Vulnerable? Early in the war, mathematicians working for the Polish Resistance were able to smuggle Enigma machines to France and England along with a strategy for breaking the code. The British government established a top-secret cryptography center at Bletchley Park and staffed it with the top British mathematicians. The decryption team at Bletchley was able to exploit the following facts about the Enigma machine: –The encoding is symmetrical. –The Enigma machine can never map a character into itself. The codebreakers were also helped by the fact that the Germans were both careless and overconfident. In believing they had an unbreakable encoding machine, they failed to take adequate measures to safeguard the integrity of their communications.

16 Breaking the Enigma Code The most common technique used at Bletchley Park was the known-plaintext attack, in which the codebreakers guess that a particular sequence of characters exists somewhere in the decoded message. A sequence of characters that you guess is part of the plaintext is called a crib. Breaking an Enigma message required the following steps: –Align the crib with the ciphertext to eliminate crashes in which a letter appears to map to itself. –Create a menu recording the links between letter pairs in the crib and ciphertext. –Identify loops in the menu at which a chain of letter pairs cycles back to the original letter. –Use the loops in the menu to create a wiring pattern for an electromechanical device called a Bombe that searches for settings of the Enigma rotors that produce the observed pattern.

17 Step 1: Align the Crib and Ciphertext UAENFVRLBZPWMEPMIHFSRJXFMJKWRAXQEZ KEINEBESONDERENEREIGNISSEKEINEBESONDERENEREIGNISSEKEINEBESONDERENEREIGNISSEKEINEBESONDERENEREIGNISSEKEINEBESONDERENEREIGNISSEKEINEBESONDERENEREIGNISSE No crashes exist in this alignment, so it is a feasible solution.

18 Step 2: Construct the Menu V K 0 R E 1 L I 2 B N 3 Z E 4 P B 5 W E 6 M S 7 E O 8 P N 9 M D 10 I E 11 H R 12 F E 13 S N 14 R E 15 J R 16 X E 17 F I 18 M G 19 J N 20 K I 21 W S 22 R S 23 A E 24 LKV OFIHPB ZERJNG AXWSMD 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1, 15 16 17 18 19 20 21 22 23 24 V K 0 R E 1 L I 2 B N 3 Z E 4 P B 5 W E 6 M S 7 E O 8 P N 9 M D 10 I E 11 H R 12 F E 13 S N 14 R E 15 J R 16 X E 17 F I 18 M G 19 J N 20 K I 21 W S 22 R S 23 A E 24

19 Step 3: Find the Loops V K 0 R E 1 L I 2 B N 3 Z E 4 P B 5 W E 6 M S 7 E O 8 P N 9 M D 10 I E 11 H R 12 F E 13 S N 14 R E 15 J R 16 X E 17 F I 18 M G 19 J N 20 K I 21 W S 22 R S 23 A E 24 LKV OFIHPB ZERJNG AXWSMD 0 2 3 4 5 6 7 8 9 10 11 12 13 14 1, 15 16 17 18 19 20 21 22 23 24

20 Enigma Decryption

21 The End


Download ppt "The Enigma Machine Eric Roberts CS 106A February 3, 2016."

Similar presentations


Ads by Google