SlideShare ist ein Scribd-Unternehmen logo
1 von 33
PUBLIC KEY
CRYPTOSYSTEMS
AND RSA
Christopher Theisen
http://theisencr.github.io/whitewater_pkc/
AGENDA
◦ Encryption
◦ Private Key Cryptosystems
◦ Public Key Cryptosystems
◦ Introduction to RSA
◦ Simple RSA Example
◦ Exercise: Key Generation and Message
◦ Attacks against RSA
ENCRYPTION
◦ Definition: “The process of converting
information or data into a code, with the
goal of preventing unauthorized access.”
◦ Important for protecting data you want to
keep private
◦ Credit cards, personal information, etc.
PRIVATE KEY CRYPTOSYSTEMS
◦ Use of a single, shared key that can
encrypt and decrypt information
◦ Messages are encrypted using the shared
key, then the encrypted message is sent to
the other party
◦ Use Case: sustained messages between
two known parties
PRIVATE KEY CRYPTOSYSTEMS
Public Key Cryptography | RSA | Example | Exercise | Attacks
PUBLIC KEY CRYPTOSYSTEMS
Public Key Cryptography | RSA | Example | Exercise | Attacks
Distinguished from private key:
◦ Private Key: A secret, exclusive key for
encryption and decryption
◦ Public Key: Separate, public key for encryption
and decryption.
◦ Use Case: authentication step and exchange of
shared secret key for further communication
PUBLIC KEY CRYPTOSYSTEMS
Public Key Cryptography | RSA | Example | Exercise | Attacks
PUBLIC KEY - CONFIDENTIALITY
Public Key Cryptography | RSA | Example | Exercise | Attacks
PUBLIC KEY - AUTHENTICATION
Public Key Cryptography | RSA | Example | Exercise | Attacks
PUBLIC KEY – CONFIDENTIALITY AND
AUTHENTICATION
Public Key Cryptography | RSA | Example | Exercise | Attacks
Bob Private Key -> Alice Public Key -----> Alice Private Key -> Bob Public Key
RIVEST-SHAMIR-ADLEMAN (RSA)
◦ Developed by Ron Rivest, Adi Shamir, and
Leonard Adleman
◦ Based on the difficulty of factoring large
prime numbers
◦ Someone with the product of two primes
can encrypt, but only someone who knows
both primes can decrypt.
Public Key Cryptography | RSA | Example | Exercise | Attacks
TRAPDOOR FUNCTION
◦ Easy to compute in one direction,
hard to compute in the other without
special information (the trapdoor)
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – KEY GENERATION
1. Pick two large primes, p and q
p = 11
q = 3
2. Calculate n = pq
n = 11 * 3
n = 33
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – KEY GENERATION
3. Calculate λ(n) = (p-1)(q-1)
λ(n) = (11-1)(3-1)
λ(n) = 10*2
λ(n) = 20
4. Choose a small number e, coprime to λ(n)
e = 3
Alternate: Fix e first (e=3, e=17, e=65,537)
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – KEY GENERATION
5. Find d, satisfying de mod λ(n) = 1
Isolating d:
d = (1 + x* λ(n)) / e, where x is any integer.
x = 0 => d = (1 + 0) / 3 (no)
x = 1 => d = (1 + 20) / 3 = 7 (yes!)
d = 7
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – KEY GENERATION
p = 11
q = 3
n = 33
λ(n) = 20
e = 3
d = 7
Private Key = (n, d) (33, 7)
Public Key = (n, e) (33, 3)
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – MESSAGES
Private Key = <n, d> <33, 7>
Public Key = <n, e> <33, 3>
We want to send the integer “m” as a message.
Sending Messages:
Encryption: c = me mod n
Decryption: m = cd mod n
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – ENCRYPTION
Private Key = <n, d> <33, 7>
Public Key = <n, e> <33, 3>
Encryption: c = me mod n
m = 4
c = 43 mod 33
c = 64 mod 33
c = 31
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA – DECRYPTION
Private Key = <n, d> <33, 7>
Public Key = <n, e> <33, 3>
Decryption: m = cd mod n
c = 31
m = 317 mod 33
m = 27,512,614,111 mod 33
m = 4
Public Key Cryptography | RSA | Example | Exercise | Attacks
RSA - ALGORITHM
Key Generation
1. Pick two large primes, p and q
2. n = pq
3. λ(n) = (p-1)(q-1)
4. Choose a small number e, coprime to λ(n)
5. Find d, satisfying d*e mod λ(n) = 1
Public Key: <n, e> Encryption: c = me mod n
Secret Key: <n, d> Decryption: m = cd mod n
Public Key Cryptography | RSA | Example | Exercise | Attacks
EXERCISE: RSA KEY SIZE
Links to tools for RSA Demo (work in pairs or more):
theisencr.github.io/whitewater_pkc/
Pink generates a public key – “Packed public key” field
Blue copies public key, unpacks, encodes message
“OpenPGP Multi Precision Integer (MPI) of Public Key
(base64)”
Pink copies encoded message, decrypts.
Spend time checking out performance of each step.
Public Key Cryptography | RSA | Example | Exercise | Attacks
EXERCISE: ATTACKS
Imagine Eve wanted to intercept communications that
Bob (Blue) sends to Alice (Pink).
Open an additional Pink tab.
Experiment with “tricking” Bob (Blue) into
communicating with Eve (new Pink).
What’s the key step?
Public Key Cryptography | RSA | Example | Exercise | Attacks
AUTHENTICATING PUBLIC KEYS
◦ You need to trust that Alice’s public key is *really* her
key!
◦ Three approaches:
▫ Certificate Authorities – central repository of
validated keys
▫ Web of Trust – get people to “vote” that your key
is accurate (Distributed Ledger)
▫ Meet in real life and exchange keys
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA: FACTORING CHALLENGE
◦ Brute forcing RSA requires prime factorization
◦ Monetary reward for cracking large RSA values
◦ RSA-XXX: XXX = number of bits
◦ RSA-768: Factored in December 2009 – 2 ½ years
◦ “On a single core 2.2 GHz AMD Opteron processor
with 2 GB RAM, sieving would have taken about
fifteen hundred years”
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA - RANDOMNESS
p = Randomly Chosen
q = Randomly Chosen
n = p and q
λ(n) = p and q
e = chosen from p, q
d = found from e, λ(n)
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA - RANDOMNESS
◦ “Random numbers” are actually pseudo-random
◦ Ways to generate “random” numbers
▫ Seed by time
▫ Seed by execution history - /dev/random
▫ Seed by atmospheric noise
Public Key Cryptography | RSA | Example | Exercise | Attacks
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA - RANDOMNESS
◦ 2012 paper by Heninger et al. at USENIX
▫ “Mining your P’s and Q’s: Detection of
Widespread Weak Keys in Network Devices”
◦ Plain terms: if the P/Q of two keys are the same, you
can determine the other factor of both.
◦ How rare is this?
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA - RANDOMNESS
◦ If you use poor randomness, common factors
(somewhat) common!
◦ Heninger et al. harvested 5 million SSL keys
◦ Found high common factors in 0.5% of the keys
(25,000 keys)
◦ Result: can compute the private keys of those 25,000!
Public Key Cryptography | RSA | Example | Exercise | Attacks
ATTACKING RSA - RANDOMNESS
◦ /dev/urandom: supplies random bytes based on disk
activity, non-blocking
◦ Why would disk activity be not-so-random on devices
like these?
Public Key Cryptography | RSA | Example | Exercise | Attacks
SUMMARY SLIDE
Public Key Cryptography | RSA | Example | Exercise | Attacks
◦ Differences between Private and Public
Key Cryptosystems
◦ Introduction to RSA
◦ Walkthrough of RSA at scale
◦ Attacks against RSA
Class Materials:
theisencr.github.io/whitewater_pkc
theisen.cr@gmail.com
theisencr.github.io

Weitere ähnliche Inhalte

Was ist angesagt?

2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSADr.Florence Dayana
 
Cryptography and RSA algorithm
Cryptography and RSA algorithmCryptography and RSA algorithm
Cryptography and RSA algorithmSaifil Momin
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptographyRutvik Mehta
 
Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Phan Minh
 
computer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationcomputer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationAlex Punnen
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONraf_slide
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securitypatisa
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareProf. Swapnil V. Kaware
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmVinayak Raja
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE Qualcomm
 
Network Security & Cryptography
Network Security & CryptographyNetwork Security & Cryptography
Network Security & CryptographyDr. Himanshu Gupta
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyMd. Shafiul Alam Sagor
 
A Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in CryptographyA Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in Cryptographyijtsrd
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography rinnocente
 

Was ist angesagt? (20)

2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
Cryptography and RSA algorithm
Cryptography and RSA algorithmCryptography and RSA algorithm
Cryptography and RSA algorithm
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptography
 
Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5
 
computer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationcomputer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentation
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil Kaware
 
Cryptography and Network security # Lecture 5
Cryptography and Network security # Lecture 5Cryptography and Network security # Lecture 5
Cryptography and Network security # Lecture 5
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA Algorithm
 
public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
 
Cryptography Attacks and Applications
Cryptography Attacks and ApplicationsCryptography Attacks and Applications
Cryptography Attacks and Applications
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
 
Network Security & Cryptography
Network Security & CryptographyNetwork Security & Cryptography
Network Security & Cryptography
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
A Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in CryptographyA Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
 

Ähnlich wie Public Key Cryptosystems and RSA

RSA Algorithem and information about rsa
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsaMohsin Ali
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryptionphanleson
 
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfBhuvanaR13
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptxSou Jana
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptRizwanBasha12
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxwerip98386
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.pptChandraB15
 
Using NP Problems to Share Keys in Secret-Key Cryptography
Using NP Problems to Share Keys in Secret-Key CryptographyUsing NP Problems to Share Keys in Secret-Key Cryptography
Using NP Problems to Share Keys in Secret-Key Cryptographyiosrjce
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxVishwanathMahalle
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSASrilal Buddika
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securityNagendra Um
 

Ähnlich wie Public Key Cryptosystems and RSA (20)

Ch09
Ch09Ch09
Ch09
 
RSA Algorithem and information about rsa
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsa
 
Rsa
RsaRsa
Rsa
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
 
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
 
Rsa
RsaRsa
Rsa
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
 
Data security using rsa
Data security using rsaData security using rsa
Data security using rsa
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
G017625052
G017625052G017625052
G017625052
 
Using NP Problems to Share Keys in Secret-Key Cryptography
Using NP Problems to Share Keys in Secret-Key CryptographyUsing NP Problems to Share Keys in Secret-Key Cryptography
Using NP Problems to Share Keys in Secret-Key Cryptography
 
CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
Rsa
RsaRsa
Rsa
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 

Mehr von Chris Theisen

Metrics for Security Effort Prioritization
Metrics for Security Effort PrioritizationMetrics for Security Effort Prioritization
Metrics for Security Effort PrioritizationChris Theisen
 
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...Chris Theisen
 
Prioritizing Security Efforts with a Risk-Based Attack Surface Approximation
Prioritizing Security Efforts with a Risk-Based Attack Surface ApproximationPrioritizing Security Efforts with a Risk-Based Attack Surface Approximation
Prioritizing Security Efforts with a Risk-Based Attack Surface ApproximationChris Theisen
 
Software Security Education at Scale
Software Security Education at ScaleSoftware Security Education at Scale
Software Security Education at ScaleChris Theisen
 
Automated Attack Surface Approximation [FSE - SRC 2015]
Automated Attack Surface Approximation [FSE - SRC 2015]Automated Attack Surface Approximation [FSE - SRC 2015]
Automated Attack Surface Approximation [FSE - SRC 2015]Chris Theisen
 
Attack Surface Analytics [ISSRE-DSW 15]
Attack Surface Analytics [ISSRE-DSW 15]Attack Surface Analytics [ISSRE-DSW 15]
Attack Surface Analytics [ISSRE-DSW 15]Chris Theisen
 
Science of Security Industry Day - October 2015
Science of Security Industry Day - October 2015Science of Security Industry Day - October 2015
Science of Security Industry Day - October 2015Chris Theisen
 
Approximating Attack Surfaces with Stack Traces [ICSE 15]
Approximating Attack Surfaces with Stack Traces [ICSE 15]Approximating Attack Surfaces with Stack Traces [ICSE 15]
Approximating Attack Surfaces with Stack Traces [ICSE 15]Chris Theisen
 

Mehr von Chris Theisen (8)

Metrics for Security Effort Prioritization
Metrics for Security Effort PrioritizationMetrics for Security Effort Prioritization
Metrics for Security Effort Prioritization
 
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...
Risk-Based Attack Surface Approximation: How Much Data is Enough? [ICSE - SEI...
 
Prioritizing Security Efforts with a Risk-Based Attack Surface Approximation
Prioritizing Security Efforts with a Risk-Based Attack Surface ApproximationPrioritizing Security Efforts with a Risk-Based Attack Surface Approximation
Prioritizing Security Efforts with a Risk-Based Attack Surface Approximation
 
Software Security Education at Scale
Software Security Education at ScaleSoftware Security Education at Scale
Software Security Education at Scale
 
Automated Attack Surface Approximation [FSE - SRC 2015]
Automated Attack Surface Approximation [FSE - SRC 2015]Automated Attack Surface Approximation [FSE - SRC 2015]
Automated Attack Surface Approximation [FSE - SRC 2015]
 
Attack Surface Analytics [ISSRE-DSW 15]
Attack Surface Analytics [ISSRE-DSW 15]Attack Surface Analytics [ISSRE-DSW 15]
Attack Surface Analytics [ISSRE-DSW 15]
 
Science of Security Industry Day - October 2015
Science of Security Industry Day - October 2015Science of Security Industry Day - October 2015
Science of Security Industry Day - October 2015
 
Approximating Attack Surfaces with Stack Traces [ICSE 15]
Approximating Attack Surfaces with Stack Traces [ICSE 15]Approximating Attack Surfaces with Stack Traces [ICSE 15]
Approximating Attack Surfaces with Stack Traces [ICSE 15]
 

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Kürzlich hochgeladen (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Public Key Cryptosystems and RSA

  • 1. PUBLIC KEY CRYPTOSYSTEMS AND RSA Christopher Theisen http://theisencr.github.io/whitewater_pkc/
  • 2. AGENDA ◦ Encryption ◦ Private Key Cryptosystems ◦ Public Key Cryptosystems ◦ Introduction to RSA ◦ Simple RSA Example ◦ Exercise: Key Generation and Message ◦ Attacks against RSA
  • 3. ENCRYPTION ◦ Definition: “The process of converting information or data into a code, with the goal of preventing unauthorized access.” ◦ Important for protecting data you want to keep private ◦ Credit cards, personal information, etc.
  • 4. PRIVATE KEY CRYPTOSYSTEMS ◦ Use of a single, shared key that can encrypt and decrypt information ◦ Messages are encrypted using the shared key, then the encrypted message is sent to the other party ◦ Use Case: sustained messages between two known parties
  • 5. PRIVATE KEY CRYPTOSYSTEMS Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 6. PUBLIC KEY CRYPTOSYSTEMS Public Key Cryptography | RSA | Example | Exercise | Attacks Distinguished from private key: ◦ Private Key: A secret, exclusive key for encryption and decryption ◦ Public Key: Separate, public key for encryption and decryption. ◦ Use Case: authentication step and exchange of shared secret key for further communication
  • 7. PUBLIC KEY CRYPTOSYSTEMS Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 8. PUBLIC KEY - CONFIDENTIALITY Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 9. PUBLIC KEY - AUTHENTICATION Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 10. PUBLIC KEY – CONFIDENTIALITY AND AUTHENTICATION Public Key Cryptography | RSA | Example | Exercise | Attacks Bob Private Key -> Alice Public Key -----> Alice Private Key -> Bob Public Key
  • 11. RIVEST-SHAMIR-ADLEMAN (RSA) ◦ Developed by Ron Rivest, Adi Shamir, and Leonard Adleman ◦ Based on the difficulty of factoring large prime numbers ◦ Someone with the product of two primes can encrypt, but only someone who knows both primes can decrypt. Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 12. TRAPDOOR FUNCTION ◦ Easy to compute in one direction, hard to compute in the other without special information (the trapdoor) Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 13. RSA – KEY GENERATION 1. Pick two large primes, p and q p = 11 q = 3 2. Calculate n = pq n = 11 * 3 n = 33 Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 14. RSA – KEY GENERATION 3. Calculate λ(n) = (p-1)(q-1) λ(n) = (11-1)(3-1) λ(n) = 10*2 λ(n) = 20 4. Choose a small number e, coprime to λ(n) e = 3 Alternate: Fix e first (e=3, e=17, e=65,537) Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 15. RSA – KEY GENERATION 5. Find d, satisfying de mod λ(n) = 1 Isolating d: d = (1 + x* λ(n)) / e, where x is any integer. x = 0 => d = (1 + 0) / 3 (no) x = 1 => d = (1 + 20) / 3 = 7 (yes!) d = 7 Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 16. RSA – KEY GENERATION p = 11 q = 3 n = 33 λ(n) = 20 e = 3 d = 7 Private Key = (n, d) (33, 7) Public Key = (n, e) (33, 3) Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 17. RSA – MESSAGES Private Key = <n, d> <33, 7> Public Key = <n, e> <33, 3> We want to send the integer “m” as a message. Sending Messages: Encryption: c = me mod n Decryption: m = cd mod n Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 18. RSA – ENCRYPTION Private Key = <n, d> <33, 7> Public Key = <n, e> <33, 3> Encryption: c = me mod n m = 4 c = 43 mod 33 c = 64 mod 33 c = 31 Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 19. RSA – DECRYPTION Private Key = <n, d> <33, 7> Public Key = <n, e> <33, 3> Decryption: m = cd mod n c = 31 m = 317 mod 33 m = 27,512,614,111 mod 33 m = 4 Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 20. RSA - ALGORITHM Key Generation 1. Pick two large primes, p and q 2. n = pq 3. λ(n) = (p-1)(q-1) 4. Choose a small number e, coprime to λ(n) 5. Find d, satisfying d*e mod λ(n) = 1 Public Key: <n, e> Encryption: c = me mod n Secret Key: <n, d> Decryption: m = cd mod n Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 21. EXERCISE: RSA KEY SIZE Links to tools for RSA Demo (work in pairs or more): theisencr.github.io/whitewater_pkc/ Pink generates a public key – “Packed public key” field Blue copies public key, unpacks, encodes message “OpenPGP Multi Precision Integer (MPI) of Public Key (base64)” Pink copies encoded message, decrypts. Spend time checking out performance of each step. Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 22. EXERCISE: ATTACKS Imagine Eve wanted to intercept communications that Bob (Blue) sends to Alice (Pink). Open an additional Pink tab. Experiment with “tricking” Bob (Blue) into communicating with Eve (new Pink). What’s the key step? Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 23. AUTHENTICATING PUBLIC KEYS ◦ You need to trust that Alice’s public key is *really* her key! ◦ Three approaches: ▫ Certificate Authorities – central repository of validated keys ▫ Web of Trust – get people to “vote” that your key is accurate (Distributed Ledger) ▫ Meet in real life and exchange keys Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 24. ATTACKING RSA Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 25. ATTACKING RSA: FACTORING CHALLENGE ◦ Brute forcing RSA requires prime factorization ◦ Monetary reward for cracking large RSA values ◦ RSA-XXX: XXX = number of bits ◦ RSA-768: Factored in December 2009 – 2 ½ years ◦ “On a single core 2.2 GHz AMD Opteron processor with 2 GB RAM, sieving would have taken about fifteen hundred years” Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 26. ATTACKING RSA - RANDOMNESS p = Randomly Chosen q = Randomly Chosen n = p and q λ(n) = p and q e = chosen from p, q d = found from e, λ(n) Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 27. ATTACKING RSA - RANDOMNESS ◦ “Random numbers” are actually pseudo-random ◦ Ways to generate “random” numbers ▫ Seed by time ▫ Seed by execution history - /dev/random ▫ Seed by atmospheric noise Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 28. Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 29. ATTACKING RSA - RANDOMNESS ◦ 2012 paper by Heninger et al. at USENIX ▫ “Mining your P’s and Q’s: Detection of Widespread Weak Keys in Network Devices” ◦ Plain terms: if the P/Q of two keys are the same, you can determine the other factor of both. ◦ How rare is this? Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 30. ATTACKING RSA - RANDOMNESS ◦ If you use poor randomness, common factors (somewhat) common! ◦ Heninger et al. harvested 5 million SSL keys ◦ Found high common factors in 0.5% of the keys (25,000 keys) ◦ Result: can compute the private keys of those 25,000! Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 31. ATTACKING RSA - RANDOMNESS ◦ /dev/urandom: supplies random bytes based on disk activity, non-blocking ◦ Why would disk activity be not-so-random on devices like these? Public Key Cryptography | RSA | Example | Exercise | Attacks
  • 32. SUMMARY SLIDE Public Key Cryptography | RSA | Example | Exercise | Attacks ◦ Differences between Private and Public Key Cryptosystems ◦ Introduction to RSA ◦ Walkthrough of RSA at scale ◦ Attacks against RSA

Hinweis der Redaktion

  1. Factoring = breaking a number into smaller numbers