SlideShare a Scribd company logo
The Math That Saved the WorldBrad Youngbrad@clearpoint.co.ilA Mathematical and Historical Analysis of the Cryptographic Attacks on the Nazi Enigma Machine Marian RejewskiAlan Turing
AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
WWI CryptologyFirst major war with radio + telegraph Very large volume of communications Hand-ciphersPlayfair, ADFGVX etc.Bigraph substitution + transformationEncryption/DecryptionInefficient …Became bottleneckCryptanalysisDifficult, time-consuming…But successful (mainly)
Zimmermann Telegram
Invention of Enigma MachineArthur ScherbiusEfficient!(oh, and also Secure, by the way)Business, Military versionsEarly 1920’s – very poor salesGerman economy in trouble
OopsPublishes history bookReveals the impact of crypto on WWINow, the Germans want Enigma!
ABCDEFGHReflector3rd Rotor2nd Rotor1st RotorLightbulbsKeyboardEnigma Schematic
ABCDEFGHReflectorLightbulbs3rd Rotor2nd Rotor1st RotorKeyboardElectric Circuit
ABPressing ‘A’ on the keyboard…CDEF… lights the ‘B’ lightbulbGHNOTE: Because it is a electric circuit, no letter can map to itself. Minor detail combinatorically speaking, but very important for the Turing crack.ReflectorLightbulbs3rd Rotor2nd Rotor1st RotorKeyboardElectric Circuit
ABCDEAfter each letter, the first rotor shifts one step.So now, pressing ‘A’ lights a different lightbulb….’F’FGHReflectorLightbulbs3rd Rotor2nd Rotor1st RotorKeyboardRotor Shift
ABCDEFSits between keyboard and rotors.Each plug cable swaps signal between two letters.6 cables connect 12 letters. 14 other letters are not plugged at all.GHReflectorLightbulbsPlugboard3rd Rotor2nd Rotor1st RotorKeyboardPlugboard
Plugboard
KeysizeABRotor OrderRotor SettingPlugboardWiringI – III - IIVYJA/G, D/Q, J/Z,L/S, M/V, N/T3! = 6263 =17,576C(26,2) x C(24,2) xC(22,2) x C(20,2) xC(18,2) x C(16,2) x 1/6!(26!)3  x C(26,2)…C(2,2)x1/13!C≈ 105DEF≈ 1011≈ 1092GHTotal Key Size ≈ 10108Variable Key Size ≈ 1016
German Use of Enigma
German Use of EnigmaDay Keys (RO, RS, PB) distributed monthly in key booksFor each message, sender chooses Message Key (Rotor Setting only)Encode Message Key using Day Key, twiceMove rotor to Message Key setting Encode actual messageSet to Day Key(VYJ)Change to Message Key(CIL)CILCILATTACKFROMNORTHATNINETHIRTYBOKJRVSQIGPQTMNWJRAKOBYTKMTKGBBRQ
AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
Biuro Szyfrów1918 – Polish Independence1919 – Creation (and success) of Cipher Bureau 1926 – Germany goes dark as Enigma is adopted1930 – Bring in the mathematicians (?!?)Marian RejewskiJerzy RóżyckiHenryk Zygalski
The Rejewski CrackIntuition,Espionage,Engineering Understand how Enigma worksReverse-engineer the wiringBe able to crack the key each dayPermutational Mathematics
The Math of Permutation Cycles P =  P-1 =
Cycle Notation P =  P  =  (AECH)(BFD)(G)   =    (BFD)(G) (AECH)  =     (FDB)(G)(CHAE) P-1  =  (HCEA)(DFB)(G)  Benefits of cycle notation:ConciseEasier to take inverse(These are benefits of efficiency)
Cycle Structure  =  (AECH)(BFD)(G)  P =      4          3      1  =  (AFC)(BG)(D)(EH)  Q =      3       2     1    2Benefits of cycle notation:ConciseEasier to take inverseGives more info – Cycle Structure	(This is a benefit of value-add information)
Composition P =   =  (AECH)(BFD)(G)  Q =   =  (AFC)(BG)(D)(EH)  Q ◦ P =  Q(P()) =  (AHFDGBCE) Q ◦ P ≠ P ◦ Q    - NOT Commutative Q ◦ ( P ◦ R ) =  ( Q ◦ P ) ◦ R    - Associative
Identity  =  (A)(B)(C)(D)(E)(F)(G)(H)I = P ◦ I  =  I ◦ P  =  PP ◦ P -1  = II ◦ I  =  I     i.e. I = I -1(ab) ≠ I ,   but    (ab) ◦ (ab)  = (a)(b)i.e.    (ab) = (ab)-1
Conjugation Conjugation of Q by P is defined as  P ◦ Q ◦ P-1  P = (AECH)(BFD)(G)   P-1 = (HCEA)(DFB)(G)   Q =  (AFC)(BG)(D)(EH) 1-2-2-31-2-2-3This is not a coincidence!This is not a coincidence!P ◦ Q ◦ P-1 =  (AC)(B)(DHE)(FG)
Theorem: Cycle structure is invariant under conjugationProof:Suppose Q: ij, that is Q(i) = j.Consider P ◦ Q ◦ P-1 (P(i)).P ◦ Q ◦ P-1 (P(i))	= P ◦ Q ◦ (P-1 ◦ P)(i)			= P ◦ Q(i)			= P(j)i.e.   P ◦ Q ◦ P-1: P(i)P(j)Therefore…If Q has k-cycle (i1, i2 … ik)  then P ◦ Q ◦ P-1 has k-cycle (P(i1), P(i2)…P(ik))								QED
Using Permuation Cycles on EnigmaABSuppose we intercept a message: BOLJRVSQIGPQTMNWJRAKOBYTKMTTGBBRQUPWLHSOLNFEQTHJOVXPlaintext:  abcabcCiphertext: BOLJRVDefine En as the permutation that occurs when Enigma machine is in state n.So, in the first state, aB. In the fourth state, aJE1 = (aB …E4 = (aJ …Now…Recall the effect of the Reflector, which creates 2-letter circuitsSo, if aB, then Ba. So the cycle is closed.E1 = (aB) …E4 = (aJ) …So, we can now compute E4 ◦ E1 = (BJ  …CThese are the variablesa,b,c, not the actual lettersDEFGH
Using Permuation Cycles on EnigmaIf we have many intercepts from the same day, then they were produced with the same day settings. So we can calculate the entire compositions…E4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)E5 ◦ E2 = (ORJCLVHGXKF)(AUYMPZQNDWB)(ES)(IT)E6 ◦ E3 = (BWOIKTZHXB)(EPQJYLVGN)(ARCU)(DSMF)Good news: abc variables have been eliminated!  We’ve found a unique identifier!Bad news:It is one of 10,000,000,000,000,000 possibilities
Explore the nature of EnABEn = P ◦  Rn ◦ P        where P is the plugboard permutation and Rn is rotor permutation when in state nE4 ◦ E1  = P ◦  R4 ◦ P ◦ P ◦  R1 ◦ PNow, recall the plugboard…P = (ab)(cd)(ef)(gh)(ij)(kl)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)All 2-cycles and 1-cycles, therefore  P = P-1   !E4 ◦ E1  	= P ◦  R4 ◦ P ◦ P ◦  R1 ◦ P	= P ◦  R4 ◦ P ◦ P-1  ◦  R1 ◦ P	= P ◦  R4 ◦ (P ◦ P-1 ) ◦  R1 ◦ P 		= P ◦  R4  ◦  R1 ◦ P 		= P ◦  (R4  ◦  R1 ) ◦ P		= P ◦  (R4  ◦  R1 ) ◦ P-1CPRDEFGHConjugation:Cycle structure of E4 ◦ E1 is same as cycle structure of R4 ◦ R1 and is not affected at all by the plugboard!E4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)E5 ◦ E2 = (AUYMPZQNDWB)(CLVHGXKFORJ)(ES)(IT)E6 ◦ E3 = (BWOIKTZHXB)(EPQJYLVGN)(ARCU)(DSMF)1-1-1-1-1-1-10-10    ;    2-2-11-11     ;    4-4-9-9Remember:Keysize(R) ≈ 105Keysize(P) ≈ 1011
Now, where are we?Figuring out En is problem of size 1016  Now, we have Rn, a smaller problem: 105Just barely small enough to attack brute force
Building the Rejewski Dictionary RO	RS	 E4 ◦ E1 	 E5 ◦ E2 	 E6 ◦ E3 1 2 3	AAA 	13-13	1-1-12-12	1-1-12-12 1 2 3	BAA 	1-1-12-12	1-1-12-12	2-2-11-11 1 2 3	CAA 	1-1-12-12;	2-2-11-11	1-1-12-12 1 2 3	DAA 	2-2-11-11	1-1-12-12	13-13 1 2 3	EAA 	1-1-12-12	13-13	13-13 1 2 3	FAA 	13-13	13-13	1-1-2-2-3-3-3-3-4-4 1 2 3	GAA 	13-13	1-1-2-2-3-3-3-3-4-4	2-2-5-5-6-6 1 2 3	HAA 	1-1-2-2-3-3-3-3-4-4	2-2-5-5-6-6	13-13 1 2 3	IAA 	2-2-5-5-6-6	13-13	4-4-9-9 1 2 3	JAA 	13-13	4-4-9-9	1-1-5-5-7-7 1 2 3	KAA 	4-4-9-9	1-1-5-5-7-7	13-13 1 2 3	LAA 	1-1-5-5-7-7	13-13	1-1-2-2-10-10 1 2 3	MAA 	13-13	1-1-2-2-10-10	1-1-1-1-11-11.	.	.	.	..	.	.	.	..	.	.	.	.…2-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 1-1-12-12	KFE 2132-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 2-2-5-5-6-6	ZTF 1322-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 5-5-8-8	GIC 3122-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-12-12	AHH 1322-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-12-12	WLA 3122-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-5-5-7-7	YKG 1322-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13	DXI 2132-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13 	ESY 3212-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13	VHX 2132-2-11-11; 1-1-1-1-1-1-1-1-9-9; 2-2-11-11  	UNV 231…1 setting every 4 minutes,  x 20 hours/day = 300 / day105 / 300 ≈ 1 year to completeGood news; Solved the RO, RS!Bad news: 105 solved, 1011 not solvedCycle structure is not unique…even though 105 << (1012)3 ≈ 1012But most have < 10
Recovering the PlugboardPlugboard is the biggest problem combinatoricallyBut… It is trivial to solveE4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)R4 ◦ R1 = (MGWTREFBJU)(AKZCINLSHY)(P)(D)(O)(Q)(V)(X)(BJUMPWTCFE)(BJUMGWTREF)Plugboard settings:  P/G , C/R , E/F , etc.
Paradox of Decreasing BenefitKeysize# Cables
AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
1939 – Brink of WarPolish deliver Enigma replica and training to England and France Biuro Szyfrów is dismantled
Bletchley ParkHQ of British Government Code and Cypher School (GCCS)
New ChallengesCombinatoricMore rotors to choose fromIncrease # of plugsRing settingsProceduralEliminate Message Key repetitionNavy /  Air Force / Army modsKeysize now 1023
Turing’s SolutionKnown-Plaintext attackHeil HitlerWetterberichtSeeding valuesPlaintext Crib:Ciphertext: Try to place the crib without letter any letter mapping to itselfWETTERBERICHTWETTERBERICHTWETTERBERICHTWETTERBERICHTWETTERBERICHTEXLMBTWZXBITWZCIQP(false hit) = (25/26)length of crib
Finding CyclesWETTERBERICHTEXLMBTWZXBITWE1:  WEE5:  EBE7:  BW
JQFbEE1E1:  WEE5:  EBE7:  BWaWJQJBbEE5cJQLBE7caW
JQFbE1aJQJbE5cJQLE7ca
MVCbE1aMZCbE5cMBDE7ca
MVCbaE1MZCbE5cMBDE7P(false hit) = (1/26)length of cycle-1ac
Turing’s BombeNOT a computerMulti-Enigma Wiring120 rpm  max 6 hrs to solve~70% of days crackedAccurate crib?Location of crib in message?Find cycle in message?Not too many false hits?Crib seedingFake missions – Get spotted18’26”N, 72’49”E = einachtzweisechsnordensiebenzweivierneunosten Reimann zeta zeros
AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
6 : 60,000,000    ::      8 : ?
SecrecyBletchley Park is guttedEnigma machines captured (and distributed!)Top Secret status until 1973!
Marian Rejewski – During and After the War1939 – Romania
1939 – France
French cipher bureau
1940 – Algeria
1940 – Back to France
Rozycki dies in transit

More Related Content

PDF
Post Quantum Cryptography: Technical Overview
PPT
Quantum cryptography
PPTX
Quantum Computers
PPT
Caesar cipher
PDF
Quantum Key Distribution
PPTX
Cryptography with caesar Cipher
PPTX
Quantum cryptography
PDF
Seminar Report on Quantum Key Distribution
Post Quantum Cryptography: Technical Overview
Quantum cryptography
Quantum Computers
Caesar cipher
Quantum Key Distribution
Cryptography with caesar Cipher
Quantum cryptography
Seminar Report on Quantum Key Distribution

What's hot (20)

PDF
Quantum superposition | Overview
PPTX
Bridge problem : Discrete Structure
PPT
Quantum cryptography a modern cryptographic security
PDF
EVOLVING QUANTUM COMPUTERS: Harnessing a Vast Hidden Reality
PDF
Introduction to Qiskit
PPT
Cryptography - A Brief History
PPTX
Discrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
PDF
Graph Theory: Paths & Cycles
PPTX
Quantum computers
PPTX
Quantum Key Distribution Meetup Slides
PDF
Public key cryptography
PPT
Classical Encryption
PPT
Quantum Cryptography
PDF
Presentation about RSA
PPTX
Cryptography
PDF
Aes128 bit project_report
PPTX
Cryptopresentationfinal
PDF
Kubernetes Resource Mis-management - What not to do
PPTX
Post quantum cryptography
PDF
System On Chip
Quantum superposition | Overview
Bridge problem : Discrete Structure
Quantum cryptography a modern cryptographic security
EVOLVING QUANTUM COMPUTERS: Harnessing a Vast Hidden Reality
Introduction to Qiskit
Cryptography - A Brief History
Discrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
Graph Theory: Paths & Cycles
Quantum computers
Quantum Key Distribution Meetup Slides
Public key cryptography
Classical Encryption
Quantum Cryptography
Presentation about RSA
Cryptography
Aes128 bit project_report
Cryptopresentationfinal
Kubernetes Resource Mis-management - What not to do
Post quantum cryptography
System On Chip
Ad

Viewers also liked (20)

PPT
Enigma History
PPTX
Enigma
PPTX
Rotor Cipher and Enigma Machine
PPT
Paper Enigma Machine
PPTX
The imatatation game
PDF
The trans-Turing Machine
PPTX
Alan turing's work before, during & after bletchley park
PPTX
Compensatory projects
PPTX
The enigma machine lesson 2
ODT
Enigma matemàtiques
PPT
The Engima Cipher
PDF
Fund Raising with an Android Enigma Machine Simulator
PDF
Turing machine
PPT
งานคอมพิวเตอร์
PPTX
Audio Cryptography System
PPT
Funny Cats
PPSX
Pin Ups with Funny Cats
PPT
Turing machines
PPTX
Charles de gaulle
PPTX
MatheMatics and Modern World
Enigma History
Enigma
Rotor Cipher and Enigma Machine
Paper Enigma Machine
The imatatation game
The trans-Turing Machine
Alan turing's work before, during & after bletchley park
Compensatory projects
The enigma machine lesson 2
Enigma matemàtiques
The Engima Cipher
Fund Raising with an Android Enigma Machine Simulator
Turing machine
งานคอมพิวเตอร์
Audio Cryptography System
Funny Cats
Pin Ups with Funny Cats
Turing machines
Charles de gaulle
MatheMatics and Modern World
Ad

Similar to Cracking the Enigma Machine - Rejewski, Turing and the Math that saved the world (20)

PDF
RF Module Design - [Chapter 1] From Basics to RF Transceivers
PDF
Multiband Transceivers - [Chapter 1]
PDF
Graph Modification: Beyond the known Boundaries
PDF
Phase diagram at finite T & Mu in strong coupling limit of lattice QCD
PPT
A verifiable random function with short proofs and keys
PDF
[Question Paper] Fundamentals of Digital Computing (Revised Course) [April / ...
PDF
diss_present
PPT
Cs262 2006 lecture6
PDF
Hermite integrators and Riordan arrays
PDF
Declarative Datalog Debugging for Mere Mortals
PDF
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
PPT
AsymptoticAnalysis_TImeComplexity_AA.ppt
PPT
DES Block Cipher Hao Qi
PDF
Metodo Monte Carlo -Wang Landau
PPT
07_Digital timing_&_Pipelining.ppt
PDF
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
PDF
cwit-poster_logo
PDF
RF Circuit Design - [Ch1-1] Sinusoidal Steady-state Analysis
PDF
Circuit Network Analysis - [Chapter2] Sinusoidal Steady-state Analysis
RF Module Design - [Chapter 1] From Basics to RF Transceivers
Multiband Transceivers - [Chapter 1]
Graph Modification: Beyond the known Boundaries
Phase diagram at finite T & Mu in strong coupling limit of lattice QCD
A verifiable random function with short proofs and keys
[Question Paper] Fundamentals of Digital Computing (Revised Course) [April / ...
diss_present
Cs262 2006 lecture6
Hermite integrators and Riordan arrays
Declarative Datalog Debugging for Mere Mortals
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
AsymptoticAnalysis_TImeComplexity_AA.ppt
DES Block Cipher Hao Qi
Metodo Monte Carlo -Wang Landau
07_Digital timing_&_Pipelining.ppt
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
cwit-poster_logo
RF Circuit Design - [Ch1-1] Sinusoidal Steady-state Analysis
Circuit Network Analysis - [Chapter2] Sinusoidal Steady-state Analysis

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
KodekX | Application Modernization Development
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KodekX | Application Modernization Development
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Modernizing your data center with Dell and AMD
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation

Cracking the Enigma Machine - Rejewski, Turing and the Math that saved the world

  • 1. The Math That Saved the WorldBrad Youngbrad@clearpoint.co.ilA Mathematical and Historical Analysis of the Cryptographic Attacks on the Nazi Enigma Machine Marian RejewskiAlan Turing
  • 2. AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
  • 3. WWI CryptologyFirst major war with radio + telegraph Very large volume of communications Hand-ciphersPlayfair, ADFGVX etc.Bigraph substitution + transformationEncryption/DecryptionInefficient …Became bottleneckCryptanalysisDifficult, time-consuming…But successful (mainly)
  • 5. Invention of Enigma MachineArthur ScherbiusEfficient!(oh, and also Secure, by the way)Business, Military versionsEarly 1920’s – very poor salesGerman economy in trouble
  • 6. OopsPublishes history bookReveals the impact of crypto on WWINow, the Germans want Enigma!
  • 7. ABCDEFGHReflector3rd Rotor2nd Rotor1st RotorLightbulbsKeyboardEnigma Schematic
  • 9. ABPressing ‘A’ on the keyboard…CDEF… lights the ‘B’ lightbulbGHNOTE: Because it is a electric circuit, no letter can map to itself. Minor detail combinatorically speaking, but very important for the Turing crack.ReflectorLightbulbs3rd Rotor2nd Rotor1st RotorKeyboardElectric Circuit
  • 10. ABCDEAfter each letter, the first rotor shifts one step.So now, pressing ‘A’ lights a different lightbulb….’F’FGHReflectorLightbulbs3rd Rotor2nd Rotor1st RotorKeyboardRotor Shift
  • 11. ABCDEFSits between keyboard and rotors.Each plug cable swaps signal between two letters.6 cables connect 12 letters. 14 other letters are not plugged at all.GHReflectorLightbulbsPlugboard3rd Rotor2nd Rotor1st RotorKeyboardPlugboard
  • 13. KeysizeABRotor OrderRotor SettingPlugboardWiringI – III - IIVYJA/G, D/Q, J/Z,L/S, M/V, N/T3! = 6263 =17,576C(26,2) x C(24,2) xC(22,2) x C(20,2) xC(18,2) x C(16,2) x 1/6!(26!)3 x C(26,2)…C(2,2)x1/13!C≈ 105DEF≈ 1011≈ 1092GHTotal Key Size ≈ 10108Variable Key Size ≈ 1016
  • 14. German Use of Enigma
  • 15. German Use of EnigmaDay Keys (RO, RS, PB) distributed monthly in key booksFor each message, sender chooses Message Key (Rotor Setting only)Encode Message Key using Day Key, twiceMove rotor to Message Key setting Encode actual messageSet to Day Key(VYJ)Change to Message Key(CIL)CILCILATTACKFROMNORTHATNINETHIRTYBOKJRVSQIGPQTMNWJRAKOBYTKMTKGBBRQ
  • 16. AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
  • 17. Biuro Szyfrów1918 – Polish Independence1919 – Creation (and success) of Cipher Bureau 1926 – Germany goes dark as Enigma is adopted1930 – Bring in the mathematicians (?!?)Marian RejewskiJerzy RóżyckiHenryk Zygalski
  • 18. The Rejewski CrackIntuition,Espionage,Engineering Understand how Enigma worksReverse-engineer the wiringBe able to crack the key each dayPermutational Mathematics
  • 19. The Math of Permutation Cycles P = P-1 =
  • 20. Cycle Notation P = P = (AECH)(BFD)(G) = (BFD)(G) (AECH) = (FDB)(G)(CHAE) P-1 = (HCEA)(DFB)(G) Benefits of cycle notation:ConciseEasier to take inverse(These are benefits of efficiency)
  • 21. Cycle Structure = (AECH)(BFD)(G) P = 4 3 1 = (AFC)(BG)(D)(EH) Q = 3 2 1 2Benefits of cycle notation:ConciseEasier to take inverseGives more info – Cycle Structure (This is a benefit of value-add information)
  • 22. Composition P = = (AECH)(BFD)(G) Q = = (AFC)(BG)(D)(EH) Q ◦ P = Q(P()) = (AHFDGBCE) Q ◦ P ≠ P ◦ Q - NOT Commutative Q ◦ ( P ◦ R ) = ( Q ◦ P ) ◦ R - Associative
  • 23. Identity = (A)(B)(C)(D)(E)(F)(G)(H)I = P ◦ I = I ◦ P = PP ◦ P -1 = II ◦ I = I i.e. I = I -1(ab) ≠ I , but (ab) ◦ (ab) = (a)(b)i.e. (ab) = (ab)-1
  • 24. Conjugation Conjugation of Q by P is defined as P ◦ Q ◦ P-1 P = (AECH)(BFD)(G) P-1 = (HCEA)(DFB)(G) Q = (AFC)(BG)(D)(EH) 1-2-2-31-2-2-3This is not a coincidence!This is not a coincidence!P ◦ Q ◦ P-1 = (AC)(B)(DHE)(FG)
  • 25. Theorem: Cycle structure is invariant under conjugationProof:Suppose Q: ij, that is Q(i) = j.Consider P ◦ Q ◦ P-1 (P(i)).P ◦ Q ◦ P-1 (P(i)) = P ◦ Q ◦ (P-1 ◦ P)(i) = P ◦ Q(i) = P(j)i.e. P ◦ Q ◦ P-1: P(i)P(j)Therefore…If Q has k-cycle (i1, i2 … ik) then P ◦ Q ◦ P-1 has k-cycle (P(i1), P(i2)…P(ik)) QED
  • 26. Using Permuation Cycles on EnigmaABSuppose we intercept a message: BOLJRVSQIGPQTMNWJRAKOBYTKMTTGBBRQUPWLHSOLNFEQTHJOVXPlaintext: abcabcCiphertext: BOLJRVDefine En as the permutation that occurs when Enigma machine is in state n.So, in the first state, aB. In the fourth state, aJE1 = (aB …E4 = (aJ …Now…Recall the effect of the Reflector, which creates 2-letter circuitsSo, if aB, then Ba. So the cycle is closed.E1 = (aB) …E4 = (aJ) …So, we can now compute E4 ◦ E1 = (BJ …CThese are the variablesa,b,c, not the actual lettersDEFGH
  • 27. Using Permuation Cycles on EnigmaIf we have many intercepts from the same day, then they were produced with the same day settings. So we can calculate the entire compositions…E4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)E5 ◦ E2 = (ORJCLVHGXKF)(AUYMPZQNDWB)(ES)(IT)E6 ◦ E3 = (BWOIKTZHXB)(EPQJYLVGN)(ARCU)(DSMF)Good news: abc variables have been eliminated! We’ve found a unique identifier!Bad news:It is one of 10,000,000,000,000,000 possibilities
  • 28. Explore the nature of EnABEn = P ◦ Rn ◦ P where P is the plugboard permutation and Rn is rotor permutation when in state nE4 ◦ E1 = P ◦ R4 ◦ P ◦ P ◦ R1 ◦ PNow, recall the plugboard…P = (ab)(cd)(ef)(gh)(ij)(kl)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)All 2-cycles and 1-cycles, therefore P = P-1 !E4 ◦ E1 = P ◦ R4 ◦ P ◦ P ◦ R1 ◦ P = P ◦ R4 ◦ P ◦ P-1 ◦ R1 ◦ P = P ◦ R4 ◦ (P ◦ P-1 ) ◦ R1 ◦ P = P ◦ R4 ◦ R1 ◦ P = P ◦ (R4 ◦ R1 ) ◦ P = P ◦ (R4 ◦ R1 ) ◦ P-1CPRDEFGHConjugation:Cycle structure of E4 ◦ E1 is same as cycle structure of R4 ◦ R1 and is not affected at all by the plugboard!E4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)E5 ◦ E2 = (AUYMPZQNDWB)(CLVHGXKFORJ)(ES)(IT)E6 ◦ E3 = (BWOIKTZHXB)(EPQJYLVGN)(ARCU)(DSMF)1-1-1-1-1-1-10-10 ; 2-2-11-11 ; 4-4-9-9Remember:Keysize(R) ≈ 105Keysize(P) ≈ 1011
  • 29. Now, where are we?Figuring out En is problem of size 1016 Now, we have Rn, a smaller problem: 105Just barely small enough to attack brute force
  • 30. Building the Rejewski Dictionary RO RS E4 ◦ E1 E5 ◦ E2 E6 ◦ E3 1 2 3 AAA 13-13 1-1-12-12 1-1-12-12 1 2 3 BAA 1-1-12-12 1-1-12-12 2-2-11-11 1 2 3 CAA 1-1-12-12; 2-2-11-11 1-1-12-12 1 2 3 DAA 2-2-11-11 1-1-12-12 13-13 1 2 3 EAA 1-1-12-12 13-13 13-13 1 2 3 FAA 13-13 13-13 1-1-2-2-3-3-3-3-4-4 1 2 3 GAA 13-13 1-1-2-2-3-3-3-3-4-4 2-2-5-5-6-6 1 2 3 HAA 1-1-2-2-3-3-3-3-4-4 2-2-5-5-6-6 13-13 1 2 3 IAA 2-2-5-5-6-6 13-13 4-4-9-9 1 2 3 JAA 13-13 4-4-9-9 1-1-5-5-7-7 1 2 3 KAA 4-4-9-9 1-1-5-5-7-7 13-13 1 2 3 LAA 1-1-5-5-7-7 13-13 1-1-2-2-10-10 1 2 3 MAA 13-13 1-1-2-2-10-10 1-1-1-1-11-11. . . . .. . . . .. . . . .…2-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 1-1-12-12 KFE 2132-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 2-2-5-5-6-6 ZTF 1322-2-11-11; 1-1-1-1-1-1-1-1-4-4-5-5; 5-5-8-8 GIC 3122-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-12-12 AHH 1322-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-12-12 WLA 3122-2-11-11; 1-1-1-1-1-1-1-1-9-9; 1-1-5-5-7-7 YKG 1322-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13 DXI 2132-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13 ESY 3212-2-11-11; 1-1-1-1-1-1-1-1-9-9; 13-13 VHX 2132-2-11-11; 1-1-1-1-1-1-1-1-9-9; 2-2-11-11 UNV 231…1 setting every 4 minutes, x 20 hours/day = 300 / day105 / 300 ≈ 1 year to completeGood news; Solved the RO, RS!Bad news: 105 solved, 1011 not solvedCycle structure is not unique…even though 105 << (1012)3 ≈ 1012But most have < 10
  • 31. Recovering the PlugboardPlugboard is the biggest problem combinatoricallyBut… It is trivial to solveE4 ◦ E1 = (BJUMPWTCFE)(ARDNHSLYZK)(G)(I)(O)(Q)(X)(V)R4 ◦ R1 = (MGWTREFBJU)(AKZCINLSHY)(P)(D)(O)(Q)(V)(X)(BJUMPWTCFE)(BJUMGWTREF)Plugboard settings: P/G , C/R , E/F , etc.
  • 32. Paradox of Decreasing BenefitKeysize# Cables
  • 33. AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
  • 34. 1939 – Brink of WarPolish deliver Enigma replica and training to England and France Biuro Szyfrów is dismantled
  • 35. Bletchley ParkHQ of British Government Code and Cypher School (GCCS)
  • 36. New ChallengesCombinatoricMore rotors to choose fromIncrease # of plugsRing settingsProceduralEliminate Message Key repetitionNavy / Air Force / Army modsKeysize now 1023
  • 37. Turing’s SolutionKnown-Plaintext attackHeil HitlerWetterberichtSeeding valuesPlaintext Crib:Ciphertext: Try to place the crib without letter any letter mapping to itselfWETTERBERICHTWETTERBERICHTWETTERBERICHTWETTERBERICHTWETTERBERICHTEXLMBTWZXBITWZCIQP(false hit) = (25/26)length of crib
  • 39. JQFbEE1E1: WEE5: EBE7: BWaWJQJBbEE5cJQLBE7caW
  • 42. MVCbaE1MZCbE5cMBDE7P(false hit) = (1/26)length of cycle-1ac
  • 43. Turing’s BombeNOT a computerMulti-Enigma Wiring120 rpm  max 6 hrs to solve~70% of days crackedAccurate crib?Location of crib in message?Find cycle in message?Not too many false hits?Crib seedingFake missions – Get spotted18’26”N, 72’49”E = einachtzweisechsnordensiebenzweivierneunosten Reimann zeta zeros
  • 44. AgendaDevelopment of Enigma Machine – Why/How/WhatThe Rejewski CrackThe Turing CrackHistorical Impact
  • 45. 6 : 60,000,000 :: 8 : ?
  • 46. SecrecyBletchley Park is guttedEnigma machines captured (and distributed!)Top Secret status until 1973!
  • 47. Marian Rejewski – During and After the War1939 – Romania
  • 51. 1940 – Back to France
  • 52. Rozycki dies in transit
  • 57. 1942 – Portugal, Gibraltar
  • 59. No security clearance (Vichy France)
  • 60. Polish Army – hand ciphers
  • 62. 1950 – Cable salesman
  • 66. 1973 – Finally learns about ULTRA
  • 67. 1980 – Dies at age 73Alan Turing –Timeline1936-8 – Computability, Turing Machine, Decidability, Riemann1939-45 – Bletchley Park1946 – Automatic Computing Engine1947-48 – Algorithms, Neural Nets, AI1948 – Almost an Olympian1948-50 – Manchester Mark I Mersenne + ??? (Was he on a secret nuclear program?? Might explain the gov’t paranoia)1950 – Turing Test1951 – Mathematical Biology1952 – Arrest1954 – Death at age 41
  • 68. Colossus Computer Cracks Lorenz cipherHigh-level German communicationsHistory of ComputersZ3ColossusENIACMark I
  • 69. NSA
  • 70. Addenda, Errata, AnecdotesWiring analysisHans Thilo-SchmidtTTTTTTTTTTTTEntry wheel orderWhy E1-E6, instead of E0-E5 ?Ring Settings and Rotor Stepping“Turing. Alan Turing.”Other WWII CryptanalysisDisguising ULTRA intelligenceSuggested ReadingDavid Kahn – The CodebreakersSimon Singh – The Code Book