Cryptography in World War II

Slides:



Advertisements
Similar presentations
Classical Encryption Techniques Week 6-wend. One-Time Pad if a truly random key as long as the message is used, the cipher will be secure called a One-Time.
Advertisements

Origin and Nature of the Allied Cryptographic Advantage During World War II By Grant Musick.
Ciphers and Permutations. Monoalphabetic Cipher is simply a permutation abcdefghijklmnopqrstuvwxyz SATBUCVDWEXFYGZRQPONMLKJIH Cycle Form (ASOZHDB) (CTNGVLF)
Cryptology Making & Breaking Codes & Ciphers. AJ 1152 Cryptology Cryptography –Science of creating codes or ciphers Cryptanalysis –Science of breaking.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.
Team Name: team13 Programmer: 陳則凱 b Tester: 劉典恆 b
A Presentation by: ~Ksenia Potapov ~Amariah Condon ~Janette Fong ~Janice Lau CRYPTOGRAPHY.
Solving the Enigma How the Western Allies Cracked the German Secret Codes During WW II.
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 4: Captain Ridley’s Shooting Party.
Enigma? Several Images from Wikipedia (an online encyclopedia)
Enigma Meghan Emilio Faculty Sponsor: Ralph Morelli (Computer Science)
Modern Cryptography.
Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans Class 4: Modern Cryptography
A Glimpse of the History of Cryptography
Enigma Meghan Emilio Advisor: Professor Ralph Morelli April 2004.
What is Cryptography? Definition: The science or study of the techniques of secret writing, esp. code and cipher systems, methods, and the like Google.
Enigma 1 Enigma Enigma 2 Enigma  Developed and patented (in 1918) by Arthur Scherbius  Many variations on basic design  Eventually adopted by Germany.
Computer Security CS 426 Lecture 3
Classical Encryption Techniques
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Chapter 2 – Classical Encryption Techniques
Encryption. Introduction Computer security is the prevention of or protection against –access to information by unauthorized recipients –intentional but.
IntroConcAnalysisPreviousSystemsRotors
History and Background Part 1: Basic Concepts and Monoalphabetic Substitution CSCI 5857: Encoding and Encryption.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
Encryption Presentation Jamie Roberts. Encryption Defined: n The process of converting messages, information, or data into a form unreadable by anyone.
Fubswrorjb Teri Schmidt Matt Rose K-12 Outreach Center for Education and Research in Information Assurance and Security, Purdue University.
Alan Turing Presented By: Tyler Romero CSCE Spring 2014.
Chapter 1 Introduction Cryptography-Principles and Practice Harbin Institute of Technology School of Computer Science and Technology Zhijun Li
T TT The Cryptography Istituto Tecnico Industriale “E.Divini” San Severino Marche.
Cryptology By Greg Buss Pat Shields Barry Burke. What is Cryptology? Cryptology is the study of “secret writing.” Modern cryptology combines the studies.
Team Name: team13 Programmer: 陳則凱 b Tester: 劉典恆 b
Lec. 5 : History of Cryptologic Research II
Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
Terminology and classical Cryptology
CSCI 5857: Encoding and Encryption
Conventional crypto - Noack Conventional crypto Diffusion and confusion How Mary Queen of Scots lost her head Various hand operable ciphers Various Enigmas.
Classical Crypto By: Luong-Sorin VA, IMIT Dith Nimol, IMIT.
Computer Security Cryptography. Cryptography Now and Before  In the past – mainly used for confidentiality  Today –Still used for confidentiality –Data.
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 3: Striving for Confusion Structures.
Encryption of WWII Philip Gebhardt 10/24/2011. Interest.
Encryption CS110: Computer Science and the Internet.
Intro to Cryptography Lesson Introduction
“IT IS A RIDDLE, WRAPPED IN A MYSTERY, INSIDE AN ENIGMA” * By: Michaela Wontroba Mr Kuniega; PD 5,6,7.
CS 150 – Computing: From Ada to the Web Cryptography.
The cracking of Enigma in World War II John Bibb Harry Caplan Abhishek Chhikara Vladimir Grantcharov Aditi Kulkarni Nigel Lawrence Andrew Muldowney Hou.
The Enigma Machine Eric Roberts CS 106A February 3, 2016.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Lecture 5 Page 1 CS 236 Online More on Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
The Mathematics Behind
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
Lecture 3 Page 1 CS 236 Online Basic Encryption Methods Substitutions –Monoalphabetic –Polyalphabetic Permutations.
Basic Encryption Methods
History and Background Part 3: Polyalphabetic Ciphers
Cryptography.
In this lesson we will understand:
Rotor Ciphers.
Alan Turing & Cryptanalysis
Lecture 5: Enigma Concluded Bletchley Park (June 2004)
An electro-mechanical rotor cipher machine created by the German engineer Arthur Scherbius.
Lecture 4: Striving for Confusion
Modern Cryptography.
Presentation transcript:

Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans Class 3: Captain Ridley’s Shooting Party Turing’s Hut 8 at Bletchley Park http://www.cs.virginia.edu/jillcrypto

Enigma machine at Bletchley Park Invented commercially, 1923 Used by German Navy, Army, Air Force About 50,000 in use Modified throughout WWII, believed to be perfectly secure Kahn’s Codebreakers (1967) didn’t know it was broken Turing’s 1940 Treatise on Enigma declassified in 1996 Enigma machine at Bletchley Park

Simple Substitution Ciphers (from Class 1) ABCDEFGHIJKLMNOPQRSTUVWXYZ encrypt decrypt JIDKQACRSHLGWNFEXUZVTPMYOB JILL  HSGG

Rotating Substitution Cipher ABCDEFGHIJKLMNOPQRSTUVWXYZ encrypt JIDKQACRSHLGWNFEXUZVTPMYOBJID JIDKQACRSHLGWNFEXUZVTPMYOBJI JIDKQACRSHLGWNFEXUZVTPMYOBJ JIDKQACRSHLGWNFEXUZVTPMYOB J  H I  H L  N L  F JILL  HHNF

Rotating Substitution Cipher Rotates the mapping every letter Hides simple statistical properties of plaintext: Frequency analysis defeated: E encrypts to different letters Repeated letter will not encrypt the same way in different positions

Rotating Substitution Weaknesses Will repeat after 26 letters If there is a lot of ciphertext, can still do frequency analysis on every 26th letter slides Some properties revealed If we see repeated letters in ciphertext, what does it mean? JILL  HHNF

Multiple Substitution Ciphers ABCDEFGHIJKLMNOPQRSTUVWXYZ This doesn’t help at all: Any number of multiple simple substitutions can be replaced by one substitution! JIDKQACRSHLGWNFEXUZVTPMYOB ABCDEFGHIJKLMNOPQRSTUVWXYZ SQHLZNYKXUWVJRDFBETIMOGACP J  K

Multiple Rotating Substitutions ABCDEFGHIJKLMNOPQRSTUVWXYZ Now it only repeats when both wheels have cycled: 26*26 = 676 letters! Wheel 1: Rotate one position every letter JIDKQACRSHLGWNFEXUZVTPMYOB ABCDEFGHIJKLMNOPQRSTUVWXYZ Wheel 2: Rotate one position every 26 letters SQHLZNYKXUWVJRDFBETIMOGACP

Multiple Rotating Substitutions Wheel 1: Rotate one position every letter ABCDEFGHIJKLMNOPQRSTUVWXYZ Now it only repeats when all 3 wheels have cycled: 26*26 * 26 = 17576 letters! JIDKQACRSHLGWNFEXUZVTPMYOB ABCDEFGHIJKLMNOPQRSTUVWXYZ Wheel 2: Rotate one position every 26 letters SQHLZNYKXUWVJRDFBETIMOGACP ABCDEFGHIJKLMNOPQRSTUVWXYZ Wheel 3: Rotate one position when wheel 2 cycles UAVGRDCBESYHLZOQKXTIMNJWFP

Enigma

Enigma Mechanics Three rotors (chosen from 5), scrambled letters Each new letter, first rotor advances Other rotors advance when ring is hit Reflector Plugboard

Rotor Wheel Simple substitution No letter maps to itself Latch turns next rotor once per rotation

Settings Plugboard: swap pairs of letters Rotors Reflector Number of plugs varied ( 6 until 1939, up to 10 after) Rotors Before 1939 – Three rotors (choose order) After – Choose 3 from set of 5 rotors Orientations (3) – start orientations of the 3 rotors Ring settings (2) – when next ring advances Reflector Fixed symmetric substitution (AB  B A) Involution: if we do it twice, get original back

http://en.wikipedia.org/wiki/Image:Enigma-action.png Image from

Three Rotor Wheels

Enigma Schematic Ciphertext = B-1L-1M-1N-1RNMLB(Plaintext) Plaintext B Turns every letter Plaintext B Plugboard L Rotor 1 M 2 N 3 R Reflector Ciphertext Ciphertext = B-1L-1M-1N-1RNMLB(Plaintext)

Does Decryption Work? C = B-1L-1M-1N-1RNMLB(P) Plaintext B Plugboard L Rotor 1 M 2 N 3 R Reflector Ciphertext Does Decryption Work? C = B-1L-1M-1N-1RNMLB(P) P = B-1L-1M-1N-1RNMLB(C) = B-1L-1M-1N-1RNMLB(B-1L-1M-1N-1RNMLB(P)) R is an involution (AB  B A)

Key Space Plugboard with 6 plugs: Rotors: (26!)3  4 * 1026 (26 * 25/2) * … * (16*15 / 2) / 6!  1011 Plaintext Plugboard B Rotor 1 L 2 M N 3 Reflector R Ciphertext Rotors: (26!)3  4 * 1026 Ring settings: 262 = 676 Message Key: 263 = 17576 Reflector: (26 * 25 / 2) * (24 * 23 / 2) * … * (2 * 2) / 13!  8 * 1012 Total:  6 * 10110 (not all are different) >> 1084 atoms in the universe

Reducing Key Space Plugboard with 6 plugs  1011 Rotors: (26!)3  4 * 1026 Ring settings: 262 = 676 Message Key: 263 = 17576 Reflector:  8 * 1012

Capture a Machine “This fictional movie about a fictional U.S. submarine mission is followed by a mention in the end credits of those actual British missions. Oh, the British deciphered the Enigma code, too. Come to think of it, they pretty much did everything in real life that the Americans do in this movie.” Roger Ebert’s review of U-571

Codebook (Rotor Settings) Captured from a U-Boat

Key Space Total:  7 * 1019 Plugboard with 6 plugs: Plaintext Ciphertext Plugboard with 6 plugs: (26 * 25/2) * … * (16*15 / 2) / 6!  1011 Rotor 1 L Rotor 2 M Rotors: (26!)3  4 * 1026 Ring settings: 262 = 676 Message Key: 263 = 17576 5 C 3 = 60 Rotor 3 N Reflector R Reflector: (26 * 25 / 2) * (24 * 23 / 2) * … * (2 * 2) / 13!  8 * 1012 1 Total:  7 * 1019 (> 264, still too big for exhaustive search)

Plugless Enigma C = L-1M-1N-1RNML(P) L Rotor 1 M Rotor 2 N Rotor 3 R Reflector Plaintext Ciphertext C = L-1M-1N-1RNML(P) Used in Spanish Civil War (1937-9) by all participants (including British, Germans and Spanish)

Plugless Enigma C = L-1ZL(P) L(C) = ZL(P) L Rotor 1 M Rotor 2 N Rotor 3 R Reflector Plaintext Z Ciphertext Probable words (4-10 letters) What is the probability that Rotor 2 and Rotor 3 do not move in 4 letter crib? C = L-1ZL(P) L(C) = ZL(P) = 22/26 = .85

Plugless Enigma C = L-1ZL(P) L(C) = ZL (P) L(C) = ZL(Pguess) Rotor 1 M Rotor 2 N Rotor 3 R Reflector Plaintext C = L-1ZL(P) L(C) = ZL (P) Z Ciphertext Z is a fixed substitution (monoalphabetic) if R2&3 don’t move Guess a crib – have C and Pguess L(C) = ZL(Pguess) Try possible rotors and starting positions for L: 3 rotor choices * 26 starting positions = 78 Li = effect of Rotor 1 in the ith rotation position

Batons Attack L1 (X) = Z L1 (w) L2 (T) = Z L2 (e) L3 (S) = Z L3 (h) C = XTSWVUINZ Pguess = wehrmacht (“armed forces”) L1 (X) = Z L1 (w) L2 (T) = Z L2 (e) L3 (S) = Z L3 (h) L4 (W) = Z L4 (r) L5 (V) = Z L5 (m) L6 (U) = Z L6 (a) L7 (I) = Z L7 (c) ABCDEFGHIJKLMNOPQRSTUVWXYZ EKMFLGDQVZNTOWYHXUSPAIBRCJ JEKMFLGDQVZNTOWYHXUSPAIBRC CJEKMFLGDQVZNTOWYHXUSPAIBR RCJEKMFLGDQVZNTOWYHXUSPAIB BRCJEKMFLGDQVZNTOWYHXUSPAI IBRCJEKMFLGDQVZNTOWYHXUSPA AIBRCJEKMFLGDQVZNTOWYHXUSP For a given starting rotor setting, solve for Z 1: R = Z(B) 2: S = Z(F) 3: X = Z(G) 4: P = Z(Y) 5: U = Z(V) 6: H = Z(I) 7: M = Z(B)

Batons Attack We know Z is: Function: contradiction if Z(x)  Z(x) Involution: contradiction if Z(x) = y & Z(y)  x Find a rotor setting with no contradictions Long enough crib, there will only be one But if crib is too long, need to deal with R2 moving List of probable 4-10 letter words Catalog to map Z to rotor settings for R2 and R3

Plugless Enigma Ideas for making Batons attack harder? L Rotor 1 M 2 N Rotor 3 R Reflector Plaintext Ciphertext Ideas for making Batons attack harder?

Enter the Plugboard 6 plugs: (26*25)/2 * (24*23)/2 * … Plaintext B Plugboard L Rotor 1 M 2 N 3 R Reflector Ciphertext Step rotor 2 faster – British and US experimented with this Change order of rotors – fastest turning rotor closest to reflector 6 plugs: (26*25)/2 * (24*23)/2 * … * (16*15/2) / 6! ~ 1011 times more keys

Operation Day key (distributed in code book) Each message begins with message key (“randomly” chosen by sender) encoded using day key Message key sent twice to check After receiving message key, re-orient rotors according to key

Codebook Zoom

Repeated Message Key P = P1P2P3P1P2P3 C1 = E1 (P1) = B-1L1-1M-1N-1RNML1B(P1) C4 = E4 (P1) =B-1L4-1M-1N-1RNML4B(P1) P1 = E1 (C1) = B-1L1-1M-1N-1RNML1B(C1) P1 = E4 (C4) = B-1L4-1M-1N-1RNML4B(C4) E4oE1 (C1) = E4 (P1) = C4 E4oE1 = B-1L1-1M-1N-1RNML1B B-1L4-1M-1N-1RNML4B = B-1L1-1M-1N-1RNML1L4-1M-1N-1RNML4B

Letter Permutations Symmetry of Enigma: if Epos (x) = y we know Epos (y) = x Given message openings DMQ VBM E1(m1) = D E4(m1) = V E1oE4(D) = V VON PUY => E1(D) = m1 PUC FMQ => E4 (E1 (D)) = V With enough message openings, we can build complete cycles for each position pair: E1oE4 = (DVPFKXGZYO) (EIJMUNQLHT) (BC) (RW) (A) (S) Note: Cycles must come in pairs of equal length

Composing Involutions E1 and E2 are involutions (x  y  y  x) Without loss of generality, we can write: E1 contains (a1a2) (a3a4) … (a2k-1a2k) E2 contains (a2a3) (a4a5) … (a2ka1) E1 E2 a1  a2 a2  x = a3 or x = a1 a3  a4 a4  x = a5 or x = a1 Why can’t x be a2 or a3?

Rejewski’s Theorem E1E4 contains (a1a3a5…a2k-1) (a2ka2k-2… a4a2) E1 contains (a1a2) (a3a4) … (a2k-1a2k) E4 contains (a2a3) (a4a5) … (a2ka1) E1E4 contains (a1a3a5…a2k-1) (a2ka2k-2… a4a2) The composition of two involutions consists of pairs of cycles of the same length For cycles of length n, there are n possible factorizations

Factoring Permutations E1E4 = (DVPFKXGZYO) (EIJMUNQLHT) (BC) (RW) (A) (S) (A) (S) = (AS) o (SA) (BC) (RW) = (BR)(CW) o (BW)(CR) or = (BW)(RC) o (WC) (BR) (DVPFKXGZYO) (EIJMUNQLHT) = (DE)(VI)… or (DI)(VJ) … or (DJ)(VM) … … (DT)(VE) 10 possibilities

How many factorizations? (DVPFKXGZYO) (EIJMUNQLHT) E1 E2 D  a2 a2  V V  a4 a4  P Once we guess a2 everything else must follow! So, only n possible factorizations for an n-letter cycle Total to try = 2 * 10 = 20 E2E5 and E3E6 likely to have about 20 to try also About 203 (8000) factorizations to try (still too many in pre-computer days)

Luckily… Operators picked message keys (“cillies”) Identical letters Easy to type (e.g., QWE) If we can guess P1 = P2 = P3 (or known relationships) can reduce number of possible factorizations If we’re lucky – this leads to E1 …E6

Solving? E1 = B-1L-1Q LB E2 = B-1L-2QL2B E3 = B-1L-3QL3B 6 equations, 3 unknowns Not known to be efficiently solvable

Solving? E1 = B-1L-1Q LB BE1B-1 = L-1Q L 6 equations, 2 unknowns – solvable Often, know plugboard settings (didn’t change frequently) 6 possible arrangements of 3 rotors, 263 starting locations = 105,456 possibilities Poles spent a year building a catalog of cycle structures covering all of them (until Nov 1937): 20 mins to break Then Germans changed reflector and they had to start over.

1939 Early 1939 – Germany changes scamblers and adds extra plugboard cables, stop double-transmissions Poland unable to cryptanalyze 25 July 1939 – Rejewski invites French and British cryptographers Gives England replica Enigma machine constructed from plans, cryptanalysis 1 Sept 1939 – Germany invades Poland, WWII starts

Alan Turing Leads British effort to crack Enigma Use cribs (“WETTER” transmitted every day at 6am) to find structure of plugboard settings 10,000 people worked at Bletchley Park on breaking Enigma (100,000 for Manhattan Project)

Alan Turing’s “Bombe” Steps through all possible rotor positions (263), testing for probable plaintext; couldn’t search all plugboard settings (> 1012); take advantage of loops in cribs

“Bombes” Idea by Alan Turing Name from Rejewski’s “Bomba” machine (Polish for bomb) “for lack of a better idea” (Rejewki’s paper) Design by “Doc” Keen, British Tabulating Machine Co. First machine, “Victory”: Bletchley Park, March 1940

Enigma Cryptanalysis Relied on combination of sheer brilliance, mathematics, espionage, operator errors, and hard work Huge impact on WWII Britain knew where German U-boats were Advance notice of bombing raids But...keeping code break secret more important than short-term uses or giving credit: Turing’s Enigma report declassified in 1996!

Turing after the War Made several major contributions to Computer Science (both before and after) Most important award is named “Turing Award” Prosecuted for homosexuality Illegal in Britain Forced hormone treatment 1954 – died of cyanide poisoning from eating apple (believed to be suicide)

Next Class: Modern Crypto Strong Symmetric Ciphers How they are similar and different How hard to break How two people who have never met can communicate securely Public-key Cryptography What it means when you see the key symbol on your web browser