SlideShare une entreprise Scribd logo
1  sur  22
CSCI 172/283
Fall 2010
Public Key Cryptography
Public Key Cryptography
 New paradigm introduced by Diffie and Hellman
 The mailbox analogy:
 Bob has a locked mailbox
 Alice can insert a letter into the box, but can’t unlock
it to take mail out
 Bob has the key and can take mail out
 Encrypt messages to Bob with Bob’s public key
 Can freely distribute
 Bob decrypts his messages with his private key
 Only Bob knows this
Requirements
 How should a public key scheme work?
 Three main conditions
 It must be computationally easy to encrypt or
decrypt a message given the appropriate key
 It must be computationally infeasible to derive the
private key from the public key
 It must be computationally infeasible to determine
the private key from chosen plaintext attack
 Attacker can pick any message, have it encrypted, and
obtain the ciphertext
Exchanging keys
 Alice and Bob want to communicate using a block
cipher to encrypt their messages, but don’t have
shared key
 How do Alice and Bob get a shared key?
Solution 1
 Alice sends the key along with her encrypted
message
 Eve sees encrypted message and key
 Uses key to decrypt message
Solution 2
 Alice sends the key at some time prior to sending
Bob the encrypted message
 Eve has to wait longer
 If she saw the key transmission, she has the key
 Uses key to decrypt message
Solution 3 – Use public key
crypto
 Diffie Hellman Key Exchange
 All users share common modulus, p, and element
g
 g ≠ 0, g ≠ 1, and g ≠ p-1
 Alice chooses her private key, kA
 Computes KA = gkA mod p and sends it to Bob in the
clear
 Bob chooses his private key, kB
 Computes KB = gkB mod p and sends it to Alice in
the clear
 When Alice and Bob want to agree on a shared
key, they compute a shared secret S
 SA,B = KB
kA mod p
 S = K kB mod p
Why does DH work?
 SA,B = SB,A
 (gkA) kB mod p = (gkB) kA mod p
 Eve knows
 g and p
 KA and KB
 Why can’t Eve compute the secret?
 This was the first public key cryptography scheme
SA,B = KB
kA mod p
SB,A = KA
kB mod p
Hard problems
 Public key cryptosystems are based on hard
problems
 DH is based on the Discrete Logarithm Problem
(DLP)
 Given:
 Multiplicative group G
 Element a in G
 Output b
 Find:
 Unique solution to ax = b in G
 x is loga b
 No polynomial time algorithm exists to solve this*
*On classical computers
Could it fail?
 Eve could fool Alice and Bob
 Man in the middle / bucket brigade
Alice
Bob
Eve
My key is
KA
My key is
K’A
My key is
KB
My key is
K’B
Alice has no guarantee that the person she’s establishing
a key with is actually Bob
RSA
 Rivest-Shamir-Adleman
 Probably the most well-known public key scheme
 First, some background
Euler’s Totient
 Totient function (n)
 Number of positive numbers less than n that are
relatively prime to n
 Two numbers are relatively prime when their greatest
common divisor is 1
 Example: (10) = 4
 1, 3, 7, 9
 Example: (7) = 6
 1, 2, 3, 4, 5, 6
 If n is prime, (n) = n-1
RSA keys
 Choose 2 large primes, p and q
 N = pq
 (N) = (p-1)(q-1)
 Choose e < N such that gcd(e, (N))=1
 d such that ed = 1 mod (N)
 Public key: {N, e}
 Private key: {d}
 p and q must also be kept secret
RSA encryption/decryption
 Alice wants to send Bob message m
 She knows his public key, {N,e}
Alice
Bob
c = me mod N
c
m = cd mod N
Toy example
 p=7, q=11
 N=77
 (N) = (6)(10) = 60
 Bob chooses e=17
 Uses extended Euclidean algorithm to find inverse
of e mod 60
 Finds d=53
 Bob makes {N, e} public
Toy example (continued)
 Alice wants to send Bob “HELLO WORLD”
 Represent each letter as a number 00(A) to 25(Z)
 26 is a space
 Calculates:
 0717 mod 77 = 28, 0417 mod 77 = 16, …, 0317 mod
77 = 75
 Sends Bob 28 16 44 44 42 38 22 42 19 44 75
 He decrypts each number with his private key and
gets “HELLO WORLD”
What could go wrong?
 What was wrong with the toy example?
 Eve can easily find the encryption of each letter and
use that as a key to Alice’s message
 Even without knowing the public key, can use
statistics to find likely messages
 Like cryptogram puzzles
How it should really happen
 p and q should be at least 512 bits each
 N at least 1024 bits
 The message “HELLO WORLD” would be
converted into one very large integer
 That integer would be raised to the public/private
exponent
 For short message, pad them with a random
string
Is this key yours?
 How to bind a key to an identity?
PK Paradigm
 Genkey(some info)
 Creates Kpub and Kpriv
 Encrypt with Kpub
 Decrypt with Kpriv
 Certificate binds key to individual
IBE
 Identity-Based Encryption
 Kpub is well-known
 Known to be bound to owner
 Name, email, SSN, etc.
 Owner requests a private key from CA
 No certificates required
Conclusion by xkcd
http://xkcd.com/538/

Contenu connexe

Similaire à CS283-PublicKey.ppt

Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptographywtyru1989
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2Tutun Juhana
 
aacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxaacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxImXaib
 
Zero Knowledge Proofs: What they are and how they work
Zero Knowledge Proofs: What they are and how they workZero Knowledge Proofs: What they are and how they work
Zero Knowledge Proofs: What they are and how they workAll Things Open
 
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
 
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdf
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdfBob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdf
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdffashiionbeutycare
 
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdf
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdfRSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdf
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdfALASEEMKOTA
 
cryptography and encryption and decryption
cryptography and encryption and decryptioncryptography and encryption and decryption
cryptography and encryption and decryptionNirajKumar620142
 
Cupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829aCupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829ajsk1950
 
Network Security
Network SecurityNetwork Security
Network Securityhj43us
 

Similaire à CS283-PublicKey.ppt (20)

Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptography
 
b
bb
b
 
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
 
Crypt
CryptCrypt
Crypt
 
aacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxaacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptx
 
Zero Knowledge Proofs: What they are and how they work
Zero Knowledge Proofs: What they are and how they workZero Knowledge Proofs: What they are and how they work
Zero Knowledge Proofs: What they are and how they work
 
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
 
Cryptography
CryptographyCryptography
Cryptography
 
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdf
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdfBob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdf
Bob has a public RSA key (n = 77, e = 13). He sends Alice a message m.pdf
 
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdf
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdfRSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdf
RSA cryptosytem Alice and Bob set up an RSA cryptosystem Bob choose.pdf
 
Security
Security Security
Security
 
cryptography and encryption and decryption
cryptography and encryption and decryptioncryptography and encryption and decryption
cryptography and encryption and decryption
 
public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
 
Cupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829aCupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829a
 
Network Security
Network SecurityNetwork Security
Network Security
 
Ch7 2ed
Ch7 2edCh7 2ed
Ch7 2ed
 
keyex.pptx
keyex.pptxkeyex.pptx
keyex.pptx
 
Internet security
Internet securityInternet security
Internet security
 

Dernier

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 

Dernier (20)

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 

CS283-PublicKey.ppt

  • 1. CSCI 172/283 Fall 2010 Public Key Cryptography
  • 2. Public Key Cryptography  New paradigm introduced by Diffie and Hellman  The mailbox analogy:  Bob has a locked mailbox  Alice can insert a letter into the box, but can’t unlock it to take mail out  Bob has the key and can take mail out  Encrypt messages to Bob with Bob’s public key  Can freely distribute  Bob decrypts his messages with his private key  Only Bob knows this
  • 3. Requirements  How should a public key scheme work?  Three main conditions  It must be computationally easy to encrypt or decrypt a message given the appropriate key  It must be computationally infeasible to derive the private key from the public key  It must be computationally infeasible to determine the private key from chosen plaintext attack  Attacker can pick any message, have it encrypted, and obtain the ciphertext
  • 4. Exchanging keys  Alice and Bob want to communicate using a block cipher to encrypt their messages, but don’t have shared key  How do Alice and Bob get a shared key?
  • 5. Solution 1  Alice sends the key along with her encrypted message  Eve sees encrypted message and key  Uses key to decrypt message
  • 6. Solution 2  Alice sends the key at some time prior to sending Bob the encrypted message  Eve has to wait longer  If she saw the key transmission, she has the key  Uses key to decrypt message
  • 7. Solution 3 – Use public key crypto  Diffie Hellman Key Exchange  All users share common modulus, p, and element g  g ≠ 0, g ≠ 1, and g ≠ p-1  Alice chooses her private key, kA  Computes KA = gkA mod p and sends it to Bob in the clear  Bob chooses his private key, kB  Computes KB = gkB mod p and sends it to Alice in the clear  When Alice and Bob want to agree on a shared key, they compute a shared secret S  SA,B = KB kA mod p  S = K kB mod p
  • 8. Why does DH work?  SA,B = SB,A  (gkA) kB mod p = (gkB) kA mod p  Eve knows  g and p  KA and KB  Why can’t Eve compute the secret?  This was the first public key cryptography scheme SA,B = KB kA mod p SB,A = KA kB mod p
  • 9. Hard problems  Public key cryptosystems are based on hard problems  DH is based on the Discrete Logarithm Problem (DLP)  Given:  Multiplicative group G  Element a in G  Output b  Find:  Unique solution to ax = b in G  x is loga b  No polynomial time algorithm exists to solve this* *On classical computers
  • 10. Could it fail?  Eve could fool Alice and Bob  Man in the middle / bucket brigade Alice Bob Eve My key is KA My key is K’A My key is KB My key is K’B Alice has no guarantee that the person she’s establishing a key with is actually Bob
  • 11. RSA  Rivest-Shamir-Adleman  Probably the most well-known public key scheme  First, some background
  • 12. Euler’s Totient  Totient function (n)  Number of positive numbers less than n that are relatively prime to n  Two numbers are relatively prime when their greatest common divisor is 1  Example: (10) = 4  1, 3, 7, 9  Example: (7) = 6  1, 2, 3, 4, 5, 6  If n is prime, (n) = n-1
  • 13. RSA keys  Choose 2 large primes, p and q  N = pq  (N) = (p-1)(q-1)  Choose e < N such that gcd(e, (N))=1  d such that ed = 1 mod (N)  Public key: {N, e}  Private key: {d}  p and q must also be kept secret
  • 14. RSA encryption/decryption  Alice wants to send Bob message m  She knows his public key, {N,e} Alice Bob c = me mod N c m = cd mod N
  • 15. Toy example  p=7, q=11  N=77  (N) = (6)(10) = 60  Bob chooses e=17  Uses extended Euclidean algorithm to find inverse of e mod 60  Finds d=53  Bob makes {N, e} public
  • 16. Toy example (continued)  Alice wants to send Bob “HELLO WORLD”  Represent each letter as a number 00(A) to 25(Z)  26 is a space  Calculates:  0717 mod 77 = 28, 0417 mod 77 = 16, …, 0317 mod 77 = 75  Sends Bob 28 16 44 44 42 38 22 42 19 44 75  He decrypts each number with his private key and gets “HELLO WORLD”
  • 17. What could go wrong?  What was wrong with the toy example?  Eve can easily find the encryption of each letter and use that as a key to Alice’s message  Even without knowing the public key, can use statistics to find likely messages  Like cryptogram puzzles
  • 18. How it should really happen  p and q should be at least 512 bits each  N at least 1024 bits  The message “HELLO WORLD” would be converted into one very large integer  That integer would be raised to the public/private exponent  For short message, pad them with a random string
  • 19. Is this key yours?  How to bind a key to an identity?
  • 20. PK Paradigm  Genkey(some info)  Creates Kpub and Kpriv  Encrypt with Kpub  Decrypt with Kpriv  Certificate binds key to individual
  • 21. IBE  Identity-Based Encryption  Kpub is well-known  Known to be bound to owner  Name, email, SSN, etc.  Owner requests a private key from CA  No certificates required