SlideShare a Scribd company logo
1 of 11
Mrs.P.Jayaprabha, HOD/AI&DS
 Encryption: plaintext -> ciphertext
 Decryption: ciphertext -> plaintext
 Cryptographic function: mathematical
function or algorithm used to
encrypt/decrypt
 Key: parameter for a cryptographic function
 Symmetric vs. asymmetric keys
 Alice and Bob want to speak privately over a
public channel
 Eve is always eavesdropping on Alice and Bob
 Mallory has malicious plans to interfere with
Alice and Bob’s private conversation
 Alice and Bob derive a shared secret key over
a public channel (no prior arrangements)
 Publicly agree on two public values, 𝑝 and 𝑔
 Each choose a private value, 𝑎 and 𝑏
 Use clever math to compute a shared secret,
𝑘
 Eve and Mallory never overhear enough
information to derive the shared secret
Let 𝑝 be a large prime number
Let 𝑔 be an integer <𝑝
For every number 𝑛 from 1 … 𝑝 − 1 , inclusive, 𝑔
must have a power 𝑘 such that:
𝑛 = 𝑔𝑘 mod 𝑝
 Solving the 𝑘𝑡ℎ
root mod 𝑝 is considered (but
not proven) hard to do in polynomial time
Solve for 𝑘, given values 𝑝, 𝑔, 𝑎′, 𝑏′ and knowing:
𝑘 = 𝑔𝑎𝑏
= 𝑔𝑏𝑎
𝑎′ = 𝑔𝑎 mod 𝑝
𝑏′
= 𝑔𝑏
mod 𝑝
𝑘 = (𝑏′)𝑎
mod 𝑝
𝑘 = (𝑎′)𝑏 mod 𝑝
 Finding 𝑘 is easy if 𝑎 or 𝑏are known
 Quickly solved by brute force if 𝑝 = 3 and𝑔 = 2
 What if 𝑝 = 6,461,333,867 and 𝑔 = 3,691?
Alice starts the exchangeand tells Bob 𝑝 = 7, 𝑔 = 1
Privately, Alice chooses 𝑎 = 3 and Bob chooses 𝑏 = 5
Alice computes 𝑎′ = 𝑔𝑎 mod 𝑝 and tells Bob the result
𝑎′
= 23
mod 7 = 1
Bob computes 𝑏′
= 𝑔𝑏
mod 𝑝 and tells Alice the result
𝑏′
= 25
mod 7 = 4
Since k = 𝑔𝑏𝑎
, Alice can compute 𝑘 = (𝑏′)𝑎
mod 𝑝
𝑘 = (4)3 mod 7 = 1
Since k = 𝑔𝑎𝑏
, Bob can compute 𝑘 = (𝑎′)𝑏
mod 𝑝
𝑘 = (1)5 mod 7 = 1
Meanwhile, Eve doesn’t know 𝑎 or 𝑏 and can’t easily derive 𝑘
 Alice generates a pair of keys, publishing one
and keeping the other private
 Anyone may use the published key to encrypt
messages intended for Alice
 Only Alice can decrypt messages encrypted
with the public key (unless the private key
was compromised somehow)
 Alice may also use the key pair to prove her
identity
 Computing the product of two prime numbers is
easy (23*17 = 391)
 Factoring the product of two large prime
numbers is “hard”
 Try factoring
123,018,668,453,011,775,513,049,495,838,496
,272,077,285,356,959,533,479,219,732,245,21
5,172,640,050,726,365,751,874,520,219,978,6
46,938,995,647,494,277,406,384,592,519,255,
732,630,345,373,154,826,850,791,702,612,214
,291,346,167,042,921,431,160,222,124,047,92
7,473,779,408,066,535,141,959,745,986,902,1
43,413
 Calculate the product 𝑛 = 𝑝𝑞 where 𝑝 and 𝑞
are very large prime numbers (e.g. tens or
even hundreds of digits long)
 Carefully choose exponents 𝑒 and 𝑑 such that
we can publish the key 𝑘𝑝𝑢𝑏 = (𝑛, 𝑒) and retain
the corresponding private key𝑘𝑝𝑟𝑖𝑣 = (𝑛, 𝑑)
 Choose an 𝑒 such that 𝑒 < 𝑛 and 𝑒 is coprime
to 𝑝 − 1 𝑞 − 1
 How? For each 𝑒 in {2 … 𝑝𝑞}, test whether
GCD 𝑒, 𝑝 − 1 𝑞 − 1 = 1 until true.*
 Choose a𝑑 such that 𝑒𝑑 − 1 is divisible by
𝑝 − 1 𝑞 − 1
 Now publish 𝑘𝑝𝑢𝑏 = (𝑛, 𝑒) and retain the
private key𝑘𝑝𝑟𝑖𝑣 = (𝑛, 𝑑)
*Euclid’s or Stein’s algorithm are typically used to compute
the GCD.

More Related Content

Similar to Cryptography-Diffie Hellman Key Exchange Algorithm.pptx

Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Sri Prasanna
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptxRavikumarVadana
 
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALPROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALDrupalCamp Kyiv
 
Elliptic Curves in Cryptography
Elliptic Curves in CryptographyElliptic Curves in Cryptography
Elliptic Curves in CryptographyCSNP
 
Number theory and cryptography
Number theory and cryptographyNumber theory and cryptography
Number theory and cryptographyYasser Ali
 
Authentication (Distributed computing)
Authentication (Distributed computing)Authentication (Distributed computing)
Authentication (Distributed computing)Sri Prasanna
 
With Math - Diffie-Hellman Rick.ppt
With Math - Diffie-Hellman Rick.pptWith Math - Diffie-Hellman Rick.ppt
With Math - Diffie-Hellman Rick.pptishaankumar39
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptographywtyru1989
 
rsa.pdf
rsa.pdfrsa.pdf
rsa.pdfBuCu3
 
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...44CON
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang ConcurrencyBarry Ezell
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key SignaturesDavid Evans
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computersSpeck&Tech
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2Tutun Juhana
 

Similar to Cryptography-Diffie Hellman Key Exchange Algorithm.pptx (19)

Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Secure Communication (Distributed computing)
Secure Communication (Distributed computing)
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptx
 
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALPROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
 
Elliptic Curves in Cryptography
Elliptic Curves in CryptographyElliptic Curves in Cryptography
Elliptic Curves in Cryptography
 
Number theory and cryptography
Number theory and cryptographyNumber theory and cryptography
Number theory and cryptography
 
Authentication (Distributed computing)
Authentication (Distributed computing)Authentication (Distributed computing)
Authentication (Distributed computing)
 
With Math - Diffie-Hellman Rick.ppt
With Math - Diffie-Hellman Rick.pptWith Math - Diffie-Hellman Rick.ppt
With Math - Diffie-Hellman Rick.ppt
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptography
 
rsa.pdf
rsa.pdfrsa.pdf
rsa.pdf
 
Active Attacks on DH Key Exchange
Active Attacks on DH Key ExchangeActive Attacks on DH Key Exchange
Active Attacks on DH Key Exchange
 
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang Concurrency
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computers
 
Analysis of Shared RSA Modulus
Analysis of Shared RSA ModulusAnalysis of Shared RSA Modulus
Analysis of Shared RSA Modulus
 
Crypt
CryptCrypt
Crypt
 
Other public key systems
Other public key systemsOther public key systems
Other public key systems
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 

Cryptography-Diffie Hellman Key Exchange Algorithm.pptx

  • 2.  Encryption: plaintext -> ciphertext  Decryption: ciphertext -> plaintext  Cryptographic function: mathematical function or algorithm used to encrypt/decrypt  Key: parameter for a cryptographic function  Symmetric vs. asymmetric keys
  • 3.  Alice and Bob want to speak privately over a public channel  Eve is always eavesdropping on Alice and Bob  Mallory has malicious plans to interfere with Alice and Bob’s private conversation
  • 4.  Alice and Bob derive a shared secret key over a public channel (no prior arrangements)  Publicly agree on two public values, 𝑝 and 𝑔  Each choose a private value, 𝑎 and 𝑏  Use clever math to compute a shared secret, 𝑘  Eve and Mallory never overhear enough information to derive the shared secret
  • 5. Let 𝑝 be a large prime number Let 𝑔 be an integer <𝑝 For every number 𝑛 from 1 … 𝑝 − 1 , inclusive, 𝑔 must have a power 𝑘 such that: 𝑛 = 𝑔𝑘 mod 𝑝  Solving the 𝑘𝑡ℎ root mod 𝑝 is considered (but not proven) hard to do in polynomial time
  • 6. Solve for 𝑘, given values 𝑝, 𝑔, 𝑎′, 𝑏′ and knowing: 𝑘 = 𝑔𝑎𝑏 = 𝑔𝑏𝑎 𝑎′ = 𝑔𝑎 mod 𝑝 𝑏′ = 𝑔𝑏 mod 𝑝 𝑘 = (𝑏′)𝑎 mod 𝑝 𝑘 = (𝑎′)𝑏 mod 𝑝  Finding 𝑘 is easy if 𝑎 or 𝑏are known  Quickly solved by brute force if 𝑝 = 3 and𝑔 = 2  What if 𝑝 = 6,461,333,867 and 𝑔 = 3,691?
  • 7. Alice starts the exchangeand tells Bob 𝑝 = 7, 𝑔 = 1 Privately, Alice chooses 𝑎 = 3 and Bob chooses 𝑏 = 5 Alice computes 𝑎′ = 𝑔𝑎 mod 𝑝 and tells Bob the result 𝑎′ = 23 mod 7 = 1 Bob computes 𝑏′ = 𝑔𝑏 mod 𝑝 and tells Alice the result 𝑏′ = 25 mod 7 = 4 Since k = 𝑔𝑏𝑎 , Alice can compute 𝑘 = (𝑏′)𝑎 mod 𝑝 𝑘 = (4)3 mod 7 = 1 Since k = 𝑔𝑎𝑏 , Bob can compute 𝑘 = (𝑎′)𝑏 mod 𝑝 𝑘 = (1)5 mod 7 = 1 Meanwhile, Eve doesn’t know 𝑎 or 𝑏 and can’t easily derive 𝑘
  • 8.  Alice generates a pair of keys, publishing one and keeping the other private  Anyone may use the published key to encrypt messages intended for Alice  Only Alice can decrypt messages encrypted with the public key (unless the private key was compromised somehow)  Alice may also use the key pair to prove her identity
  • 9.  Computing the product of two prime numbers is easy (23*17 = 391)  Factoring the product of two large prime numbers is “hard”  Try factoring 123,018,668,453,011,775,513,049,495,838,496 ,272,077,285,356,959,533,479,219,732,245,21 5,172,640,050,726,365,751,874,520,219,978,6 46,938,995,647,494,277,406,384,592,519,255, 732,630,345,373,154,826,850,791,702,612,214 ,291,346,167,042,921,431,160,222,124,047,92 7,473,779,408,066,535,141,959,745,986,902,1 43,413
  • 10.  Calculate the product 𝑛 = 𝑝𝑞 where 𝑝 and 𝑞 are very large prime numbers (e.g. tens or even hundreds of digits long)  Carefully choose exponents 𝑒 and 𝑑 such that we can publish the key 𝑘𝑝𝑢𝑏 = (𝑛, 𝑒) and retain the corresponding private key𝑘𝑝𝑟𝑖𝑣 = (𝑛, 𝑑)
  • 11.  Choose an 𝑒 such that 𝑒 < 𝑛 and 𝑒 is coprime to 𝑝 − 1 𝑞 − 1  How? For each 𝑒 in {2 … 𝑝𝑞}, test whether GCD 𝑒, 𝑝 − 1 𝑞 − 1 = 1 until true.*  Choose a𝑑 such that 𝑒𝑑 − 1 is divisible by 𝑝 − 1 𝑞 − 1  Now publish 𝑘𝑝𝑢𝑏 = (𝑛, 𝑒) and retain the private key𝑘𝑝𝑟𝑖𝑣 = (𝑛, 𝑑) *Euclid’s or Stein’s algorithm are typically used to compute the GCD.