SlideShare a Scribd company logo
Understanding the Magic:
Teaching Cryptography with
Just the Right Amount of
Mathematics
Joshua Holden
Rose-Hulman Institute of Technology
http://www.rose-hulman.edu/~holden
Joint Meetings, 9 January 2004
What am I going to show you?
• Pohlig-Hellman exponentiation cipher
• Fermat’s Little Theorem
• Necessary ideas for RSA
• One way to mix mathematics and cryptog-
raphy
• A neat “magic trick”?
1
What comes before?
• Shift ciphers
• Modular arithmetic
• Multiplicative ciphers
• Euclidean algorithm and multiplicative in-
verses
• Block ciphers (e.g. Hill cipher)
• Private-key vs. public-key ciphers
2
Pohlig-Hellman exponentiation cipher (1978)
• Private key block cipher
• m letters → 2m-digit number
• Example: m = 2, blocks are 4 digit num-
bers
2 ca → 0200
2 ts → 1918
2 an → 0013
2 dd → 0303
2 og → 1406
2 sx → 1803
3
Encryption
• Pick a prime number larger than the largest
possible block
• e.g. p > 2525, say p = 3001
• Pick a key, e
• Shift ciphers: add key.
Multiplicative ciphers: multiply by key.
Exponential cipher: C ≡ Pe mod p.
(C is ciphertext block; P is plaintext block)
4
• Let e = 7, then
2 (0200)7 ≡ 1640 mod 3001
2 (1918)7 ≡ 0213 mod 3001
2 (0013)7 ≡ 0608 mod 3001
2 (0303)7 ≡ 1140 mod 3001
2 (1406)7 ≡ 2918 mod 3001
2 (1823)7 ≡ 0094 mod 3001
5
Decryption
• Now we have ciphertext. Recipient needs
to recover plaintext P.
• Need to be able to take e-th roots!
• C1/e mod p doesn’t make sense.
• Need an inverse of some sort. What sort?
• Need a number d such that Cd ≡ P mod p
⇔ (Pe)d ≡ P mod p
⇔ Ped ≡ P mod p
⇔ PedP−1 ≡ 1 mod p
⇔ Ped−1 ≡ 1 mod p
• So it’s very important to know what num-
bers x have Px ≡ 1 mod p
6
Theorem (Fermat’s Little Theorem, 1640) If
p is a prime number and a is a positive
integer, p a, then ap−1 ≡ 1 mod p.
“Proof by Example” 36 ≡ 1 mod 7
Start with 1,2,3,4,5,6.
Multiply each by 3 mod 7: 3,6,2,5,1,4.
Second row is a rearrangement of the first!
So 1 · 2 · 3 · 4 · 5 · 6 ≡ 3 · 6 · 2 · 5 · 1 · 4 mod 7
≡ (3 · 1)(3 · 2)(3 · 3)(3·)(3 · 5)(3 · 6) mod 7
≡ 36 · 1 · 2 · 3 · 4 · 5 · 6 mod 7.
All of k = 1, 2, 3, 4, 5, 6 have gcd(k, 7) = 1,
so can multiply by their inverses to cancel.
Thus 1 ≡ 36 mod 7
Real Proof (if desired) (pretty much the same!)
7
Now what do we need to decrypt?
• Need Ped−1 ≡ 1 mod p
• This works if ed−1 = k(p−1) because then
Ped−1 ≡ Pk(p−1) mod p
≡ (P(p−1))k mod p
≡ 1k mod p
≡ 1 mod p
• ed − 1 = k(p − 1) means ed ≡ 1 mod p − 1
⇔ d ≡ e mod p − 1 (not mod p!)
• So for decryption we figure out
d ≡ e mod p − 1
using gcd(e, p − 1), which had better = 1
and let P ≡ Cd ≡ Ce mod p
8
• Luckily, if p = 3001, e = 7,
then gcd(7, 3000) = 1 so we can decrypt
• d ≡ e ≡ 2143 mod p − 1 = 3000 (using the
Euclidean algorithm)
2 (1640)2143 ≡ 0200 mod 3001 → ca
2 (0213)2143 ≡ 1918 mod 3001 → ts
2 (0608)2143 ≡ 0013 mod 3001 → an
2 (1140)2143 ≡ 0303 mod 3001 → dd
2 (2918)2143 ≡ 1406 mod 3001 → og
2 (0094)2143 ≡ 1823 mod 3001 → sx
• Magic! But now you know the trick.
9
What comes next?
• Security: the discrete log problem
• Exponentiation with composite moduli
• Where Fermat’s Little Theorem breaks
• The Euler phi function
• Euler’s Theorem
• RSA
• Fast exponentiation
• Fast primality testing
• . . .
10

More Related Content

What's hot

Finding exponential equations
Finding exponential equationsFinding exponential equations
Finding exponential equations
Shaun Wilson
 
Domain & Range (from graph) - Mohd Noor
Domain & Range (from graph) - Mohd NoorDomain & Range (from graph) - Mohd Noor
Domain & Range (from graph) - Mohd Noor
Mohd. Noor Abdul Hamid
 
10 minutes quiz
10 minutes quiz10 minutes quiz
10 minutes quiz
nurliyanazakaria
 
Algebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomialsAlgebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomials
TyoCakti
 
Algebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomialsAlgebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomials
ChiquitaEvitaFatimah
 
Solving exponential equations
Solving exponential equationsSolving exponential equations
Solving exponential equations
Shaun Wilson
 
0807 ch 8 day 7
0807 ch 8 day 70807 ch 8 day 7
0807 ch 8 day 7
festivalelmo
 
June 2011 1-2
June 2011 1-2June 2011 1-2
June 2011 1-2
leroy walker
 
IntrRSCode
IntrRSCodeIntrRSCode
IntrRSCode
aniruddh Tyagi
 
Logs Nov 10 09
Logs Nov 10 09Logs Nov 10 09
Logs Nov 10 09
ingroy
 
Bch and reed solomon codes generation in frequency domain
Bch and reed solomon codes generation in frequency domainBch and reed solomon codes generation in frequency domain
Bch and reed solomon codes generation in frequency domain
Madhumita Tamhane
 
Mate tarea - 2º
Mate   tarea - 2ºMate   tarea - 2º
Mate tarea - 2º
brisagaela29
 
Additional math 1999
Additional math   1999Additional math   1999
Additional math 1999
MUSAKILAVE
 
March 6
March 6March 6
March 6
khyps13
 
Solutions on log examples
Solutions on log examplesSolutions on log examples
Solutions on log examples
Kristino Ikaw
 
Inequalities math
Inequalities mathInequalities math
Inequalities math
Ayaan Alam
 
Day 4worked
Day 4workedDay 4worked
Day 4worked
Jonna Ramsey
 
Functions
FunctionsFunctions
Functions
Patricia Rossouw
 
Factoring Polynomials
Factoring PolynomialsFactoring Polynomials
Factoring Polynomials
itutor
 
Cryptology Caesar Cipher
Cryptology Caesar CipherCryptology Caesar Cipher
Cryptology Caesar Cipher
Nakib Akash
 

What's hot (20)

Finding exponential equations
Finding exponential equationsFinding exponential equations
Finding exponential equations
 
Domain & Range (from graph) - Mohd Noor
Domain & Range (from graph) - Mohd NoorDomain & Range (from graph) - Mohd Noor
Domain & Range (from graph) - Mohd Noor
 
10 minutes quiz
10 minutes quiz10 minutes quiz
10 minutes quiz
 
Algebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomialsAlgebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomials
 
Algebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomialsAlgebra presentation on topic modulus function and polynomials
Algebra presentation on topic modulus function and polynomials
 
Solving exponential equations
Solving exponential equationsSolving exponential equations
Solving exponential equations
 
0807 ch 8 day 7
0807 ch 8 day 70807 ch 8 day 7
0807 ch 8 day 7
 
June 2011 1-2
June 2011 1-2June 2011 1-2
June 2011 1-2
 
IntrRSCode
IntrRSCodeIntrRSCode
IntrRSCode
 
Logs Nov 10 09
Logs Nov 10 09Logs Nov 10 09
Logs Nov 10 09
 
Bch and reed solomon codes generation in frequency domain
Bch and reed solomon codes generation in frequency domainBch and reed solomon codes generation in frequency domain
Bch and reed solomon codes generation in frequency domain
 
Mate tarea - 2º
Mate   tarea - 2ºMate   tarea - 2º
Mate tarea - 2º
 
Additional math 1999
Additional math   1999Additional math   1999
Additional math 1999
 
March 6
March 6March 6
March 6
 
Solutions on log examples
Solutions on log examplesSolutions on log examples
Solutions on log examples
 
Inequalities math
Inequalities mathInequalities math
Inequalities math
 
Day 4worked
Day 4workedDay 4worked
Day 4worked
 
Functions
FunctionsFunctions
Functions
 
Factoring Polynomials
Factoring PolynomialsFactoring Polynomials
Factoring Polynomials
 
Cryptology Caesar Cipher
Cryptology Caesar CipherCryptology Caesar Cipher
Cryptology Caesar Cipher
 

Similar to Understanding the Magic: Teaching Cryptography with Just the Right Amount of Mathematics

Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsComputing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Dharmalingam Ganesan
 
wilson's and fermat little theorem .ppt
wilson's and fermat little theorem  .pptwilson's and fermat little theorem  .ppt
wilson's and fermat little theorem .ppt
JayLagman3
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
 
Ch08
Ch08Ch08
Slides to RSA Presentation
Slides to RSA PresentationSlides to RSA Presentation
Slides to RSA Presentation
David Boyhan, JD, CIPP
 
1 chapter1 introduction
1 chapter1 introduction1 chapter1 introduction
1 chapter1 introduction
SSE_AndyLi
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private Variables
Dharmalingam Ganesan
 
Chap7 2 Ecc Intro
Chap7 2 Ecc IntroChap7 2 Ecc Intro
Chap7 2 Ecc Intro
Edora Aziz
 
Eulers totient
Eulers totientEulers totient
Eulers totient
SampadaZalte
 
The Mathematics of RSA Encryption
The Mathematics of RSA EncryptionThe Mathematics of RSA Encryption
The Mathematics of RSA Encryption
Nathan F. Dunn
 
Number system
Number systemNumber system
Number system
Diksha Shivpure
 
14-applications-of-number-theory.ppt
14-applications-of-number-theory.ppt14-applications-of-number-theory.ppt
14-applications-of-number-theory.ppt
IdcIdk1
 
RSA final notation change2
RSA final notation change2RSA final notation change2
RSA final notation change2
Coleman Gorham
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
Shashank Shetty
 
Lecture6 rsa
Lecture6 rsaLecture6 rsa
Lecture6 rsa
Nghique Nguyen
 
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberSimple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Tarek Gaber
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private Keys
Dharmalingam Ganesan
 
1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx
pallavidhade2
 
Lect no 13 ECC.ppt
Lect no 13 ECC.pptLect no 13 ECC.ppt
Lect no 13 ECC.ppt
DEEPAK948083
 
Lect no 13 ECC.ppt
Lect no 13 ECC.pptLect no 13 ECC.ppt
Lect no 13 ECC.ppt
DEEPAK948083
 

Similar to Understanding the Magic: Teaching Cryptography with Just the Right Amount of Mathematics (20)

Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsComputing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
 
wilson's and fermat little theorem .ppt
wilson's and fermat little theorem  .pptwilson's and fermat little theorem  .ppt
wilson's and fermat little theorem .ppt
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
 
Ch08
Ch08Ch08
Ch08
 
Slides to RSA Presentation
Slides to RSA PresentationSlides to RSA Presentation
Slides to RSA Presentation
 
1 chapter1 introduction
1 chapter1 introduction1 chapter1 introduction
1 chapter1 introduction
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private Variables
 
Chap7 2 Ecc Intro
Chap7 2 Ecc IntroChap7 2 Ecc Intro
Chap7 2 Ecc Intro
 
Eulers totient
Eulers totientEulers totient
Eulers totient
 
The Mathematics of RSA Encryption
The Mathematics of RSA EncryptionThe Mathematics of RSA Encryption
The Mathematics of RSA Encryption
 
Number system
Number systemNumber system
Number system
 
14-applications-of-number-theory.ppt
14-applications-of-number-theory.ppt14-applications-of-number-theory.ppt
14-applications-of-number-theory.ppt
 
RSA final notation change2
RSA final notation change2RSA final notation change2
RSA final notation change2
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Lecture6 rsa
Lecture6 rsaLecture6 rsa
Lecture6 rsa
 
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberSimple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private Keys
 
1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx
 
Lect no 13 ECC.ppt
Lect no 13 ECC.pptLect no 13 ECC.ppt
Lect no 13 ECC.ppt
 
Lect no 13 ECC.ppt
Lect no 13 ECC.pptLect no 13 ECC.ppt
Lect no 13 ECC.ppt
 

More from Joshua Holden

The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
Joshua Holden
 
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
Joshua Holden
 
Statistics for fixed points of x ↦ x^x mod p
Statistics for fixed points of x  ↦ x^x mod pStatistics for fixed points of x  ↦ x^x mod p
Statistics for fixed points of x ↦ x^x mod p
Joshua Holden
 
Teaching the Group Theory of Permutation Ciphers
Teaching the Group Theory of Permutation CiphersTeaching the Group Theory of Permutation Ciphers
Teaching the Group Theory of Permutation Ciphers
Joshua Holden
 
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
Joshua Holden
 
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
Joshua Holden
 
A statistical look at maps of the discrete logarithm
A statistical look at maps of the discrete logarithmA statistical look at maps of the discrete logarithm
A statistical look at maps of the discrete logarithm
Joshua Holden
 
Mapping the discrete logarithm
Mapping the discrete logarithmMapping the discrete logarithm
Mapping the discrete logarithm
Joshua Holden
 
Fixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power mapFixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power map
Joshua Holden
 
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
Joshua Holden
 
A Good Hash Function is Hard to Find, and Vice Versa
A Good Hash Function is Hard to Find, and Vice VersaA Good Hash Function is Hard to Find, and Vice Versa
A Good Hash Function is Hard to Find, and Vice Versa
Joshua Holden
 
How Do You Say 'Cryptography' in Romanian?
How Do You Say 'Cryptography' in Romanian?How Do You Say 'Cryptography' in Romanian?
How Do You Say 'Cryptography' in Romanian?
Joshua Holden
 
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
Joshua Holden
 
Math in Your Hands
Math in Your HandsMath in Your Hands
Math in Your Hands
Joshua Holden
 
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
Joshua Holden
 
How to Paint Your Way out of a Maze
How to Paint Your Way out of a MazeHow to Paint Your Way out of a Maze
How to Paint Your Way out of a Maze
Joshua Holden
 
Blackwork embroidery and algorithms for maze traversals
Blackwork embroidery and algorithms for maze traversalsBlackwork embroidery and algorithms for maze traversals
Blackwork embroidery and algorithms for maze traversals
Joshua Holden
 
Mathematical Cryptography
Mathematical CryptographyMathematical Cryptography
Mathematical Cryptography
Joshua Holden
 
Modular Arithmetic and Trap Door Ciphers
Modular Arithmetic and Trap Door CiphersModular Arithmetic and Trap Door Ciphers
Modular Arithmetic and Trap Door Ciphers
Joshua Holden
 
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
Joshua Holden
 

More from Joshua Holden (20)

The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
The Interplay Between Art and Math: Lessons from a STEM-based Art and Math co...
 
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
Between the Two Cultures: Teaching Math and Art to Engineers (and Scientists ...
 
Statistics for fixed points of x ↦ x^x mod p
Statistics for fixed points of x  ↦ x^x mod pStatistics for fixed points of x  ↦ x^x mod p
Statistics for fixed points of x ↦ x^x mod p
 
Teaching the Group Theory of Permutation Ciphers
Teaching the Group Theory of Permutation CiphersTeaching the Group Theory of Permutation Ciphers
Teaching the Group Theory of Permutation Ciphers
 
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
Granny’s Not So Square, After All: Hyperbolic Tilings with Truly Hyperbolic C...
 
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
Stitching Graphs and Painting Mazes: Problems in Generalizations of Eulerian ...
 
A statistical look at maps of the discrete logarithm
A statistical look at maps of the discrete logarithmA statistical look at maps of the discrete logarithm
A statistical look at maps of the discrete logarithm
 
Mapping the discrete logarithm
Mapping the discrete logarithmMapping the discrete logarithm
Mapping the discrete logarithm
 
Fixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power mapFixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power map
 
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
Braids, Cables, and Cells II: Representing Art and Craft with Mathematics and...
 
A Good Hash Function is Hard to Find, and Vice Versa
A Good Hash Function is Hard to Find, and Vice VersaA Good Hash Function is Hard to Find, and Vice Versa
A Good Hash Function is Hard to Find, and Vice Versa
 
How Do You Say 'Cryptography' in Romanian?
How Do You Say 'Cryptography' in Romanian?How Do You Say 'Cryptography' in Romanian?
How Do You Say 'Cryptography' in Romanian?
 
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
Braids, Cables, and Cells: An intersection of Mathematics, Computer Science, ...
 
Math in Your Hands
Math in Your HandsMath in Your Hands
Math in Your Hands
 
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
Braids, Cables, and Cells I: An Interesting Intersection of Mathematics, Comp...
 
How to Paint Your Way out of a Maze
How to Paint Your Way out of a MazeHow to Paint Your Way out of a Maze
How to Paint Your Way out of a Maze
 
Blackwork embroidery and algorithms for maze traversals
Blackwork embroidery and algorithms for maze traversalsBlackwork embroidery and algorithms for maze traversals
Blackwork embroidery and algorithms for maze traversals
 
Mathematical Cryptography
Mathematical CryptographyMathematical Cryptography
Mathematical Cryptography
 
Modular Arithmetic and Trap Door Ciphers
Modular Arithmetic and Trap Door CiphersModular Arithmetic and Trap Door Ciphers
Modular Arithmetic and Trap Door Ciphers
 
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
The Pohlig-Hellman Exponentiation Cipher as a Bridge Between Classical and Mo...
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 

Understanding the Magic: Teaching Cryptography with Just the Right Amount of Mathematics

  • 1. Understanding the Magic: Teaching Cryptography with Just the Right Amount of Mathematics Joshua Holden Rose-Hulman Institute of Technology http://www.rose-hulman.edu/~holden Joint Meetings, 9 January 2004
  • 2. What am I going to show you? • Pohlig-Hellman exponentiation cipher • Fermat’s Little Theorem • Necessary ideas for RSA • One way to mix mathematics and cryptog- raphy • A neat “magic trick”? 1
  • 3. What comes before? • Shift ciphers • Modular arithmetic • Multiplicative ciphers • Euclidean algorithm and multiplicative in- verses • Block ciphers (e.g. Hill cipher) • Private-key vs. public-key ciphers 2
  • 4. Pohlig-Hellman exponentiation cipher (1978) • Private key block cipher • m letters → 2m-digit number • Example: m = 2, blocks are 4 digit num- bers 2 ca → 0200 2 ts → 1918 2 an → 0013 2 dd → 0303 2 og → 1406 2 sx → 1803 3
  • 5. Encryption • Pick a prime number larger than the largest possible block • e.g. p > 2525, say p = 3001 • Pick a key, e • Shift ciphers: add key. Multiplicative ciphers: multiply by key. Exponential cipher: C ≡ Pe mod p. (C is ciphertext block; P is plaintext block) 4
  • 6. • Let e = 7, then 2 (0200)7 ≡ 1640 mod 3001 2 (1918)7 ≡ 0213 mod 3001 2 (0013)7 ≡ 0608 mod 3001 2 (0303)7 ≡ 1140 mod 3001 2 (1406)7 ≡ 2918 mod 3001 2 (1823)7 ≡ 0094 mod 3001 5
  • 7. Decryption • Now we have ciphertext. Recipient needs to recover plaintext P. • Need to be able to take e-th roots! • C1/e mod p doesn’t make sense. • Need an inverse of some sort. What sort? • Need a number d such that Cd ≡ P mod p ⇔ (Pe)d ≡ P mod p ⇔ Ped ≡ P mod p ⇔ PedP−1 ≡ 1 mod p ⇔ Ped−1 ≡ 1 mod p • So it’s very important to know what num- bers x have Px ≡ 1 mod p 6
  • 8. Theorem (Fermat’s Little Theorem, 1640) If p is a prime number and a is a positive integer, p a, then ap−1 ≡ 1 mod p. “Proof by Example” 36 ≡ 1 mod 7 Start with 1,2,3,4,5,6. Multiply each by 3 mod 7: 3,6,2,5,1,4. Second row is a rearrangement of the first! So 1 · 2 · 3 · 4 · 5 · 6 ≡ 3 · 6 · 2 · 5 · 1 · 4 mod 7 ≡ (3 · 1)(3 · 2)(3 · 3)(3·)(3 · 5)(3 · 6) mod 7 ≡ 36 · 1 · 2 · 3 · 4 · 5 · 6 mod 7. All of k = 1, 2, 3, 4, 5, 6 have gcd(k, 7) = 1, so can multiply by their inverses to cancel. Thus 1 ≡ 36 mod 7 Real Proof (if desired) (pretty much the same!) 7
  • 9. Now what do we need to decrypt? • Need Ped−1 ≡ 1 mod p • This works if ed−1 = k(p−1) because then Ped−1 ≡ Pk(p−1) mod p ≡ (P(p−1))k mod p ≡ 1k mod p ≡ 1 mod p • ed − 1 = k(p − 1) means ed ≡ 1 mod p − 1 ⇔ d ≡ e mod p − 1 (not mod p!) • So for decryption we figure out d ≡ e mod p − 1 using gcd(e, p − 1), which had better = 1 and let P ≡ Cd ≡ Ce mod p 8
  • 10. • Luckily, if p = 3001, e = 7, then gcd(7, 3000) = 1 so we can decrypt • d ≡ e ≡ 2143 mod p − 1 = 3000 (using the Euclidean algorithm) 2 (1640)2143 ≡ 0200 mod 3001 → ca 2 (0213)2143 ≡ 1918 mod 3001 → ts 2 (0608)2143 ≡ 0013 mod 3001 → an 2 (1140)2143 ≡ 0303 mod 3001 → dd 2 (2918)2143 ≡ 1406 mod 3001 → og 2 (0094)2143 ≡ 1823 mod 3001 → sx • Magic! But now you know the trick. 9
  • 11. What comes next? • Security: the discrete log problem • Exponentiation with composite moduli • Where Fermat’s Little Theorem breaks • The Euler phi function • Euler’s Theorem • RSA • Fast exponentiation • Fast primality testing • . . . 10