SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
Suresh Thammishetty
 
Cryptography and RSA algorithm
Cryptography and RSA algorithmCryptography and RSA algorithm
Cryptography and RSA algorithm
Saifil Momin
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptography
Rutvik Mehta
 
Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5
Phan 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-presentation
Alex Punnen
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
raf_slide
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
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
Prof. Swapnil V. Kaware
 
Cryptography and Network security # Lecture 5
Cryptography and Network security # Lecture 5Cryptography and Network security # Lecture 5
Cryptography and Network security # Lecture 5
Kabul Education University
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA Algorithm
Vinayak Raja
 
public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
Information Security Awareness Group
 
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
 
Cryptography Attacks and Applications
Cryptography Attacks and ApplicationsCryptography Attacks and Applications
Cryptography Attacks and Applications
UTD Computer Security Group
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
NIVEDHINIMANIVANNAN
 
Network Security & Cryptography
Network Security & CryptographyNetwork Security & Cryptography
Network Security & Cryptography
Dr. Himanshu Gupta
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
Md. 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 Cryptography
ijtsrd
 
Cryptography
CryptographyCryptography
Cryptography
sharmili priyadarsini
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
rinnocente
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Cryptography and RSA algorithm
Cryptography and RSA algorithmCryptography and RSA algorithm
Cryptography and RSA algorithm
Saifil Momin
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptography
Rutvik Mehta
 
Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5
Phan 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-presentation
Alex Punnen
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
raf_slide
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
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
Prof. 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 Algorithm
Vinayak 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 & Cryptography
Dr. Himanshu Gupta
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
Md. 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 Cryptography
ijtsrd
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
rinnocente
 

Similar to Public Key Cryptosystems and RSA (20)

Ch09
Ch09Ch09
Ch09
Joe Christensen
 
RSA Algorithem and information about rsa
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsa
Mohsin Ali
 
Rsa
RsaRsa
Rsa
ismaelhaider
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
phanleson
 
international security system data threats
international security system data threatsinternational security system data threats
international security system data threats
gacop74666
 
PRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITYPRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
Encryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
Encryption and Decription of a Text Using Rivest-Shamir-Adleman AlgorithmEncryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
Encryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
slcfw4571
 
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
BhuvanaR13
 
Rsa
RsaRsa
Rsa
Navneet Sharma
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
Sou Jana
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
DHANABALSUBRAMANIAN
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
RizwanBasha12
 
Data security using rsa
Data security using rsaData security using rsa
Data security using rsa
LAKSHMI TEJA SAYABARAPU
 
RSA Algorithm and its implementation in C++.pptx
RSA Algorithm and its implementation in C++.pptxRSA Algorithm and its implementation in C++.pptx
RSA Algorithm and its implementation in C++.pptx
bani30122004
 
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
werip98386
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
ChandraB15
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
Amlan Patel
 
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
iosrjce
 
G017625052
G017625052G017625052
G017625052
IOSR Journals
 
CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
GopinathSamydurai
 
RSA Algorithem and information about rsa
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsa
Mohsin Ali
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
phanleson
 
international security system data threats
international security system data threatsinternational security system data threats
international security system data threats
gacop74666
 
PRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITYPRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
Encryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
Encryption and Decription of a Text Using Rivest-Shamir-Adleman AlgorithmEncryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
Encryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm
slcfw4571
 
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
BhuvanaR13
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
Sou Jana
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
RizwanBasha12
 
RSA Algorithm and its implementation in C++.pptx
RSA Algorithm and its implementation in C++.pptxRSA Algorithm and its implementation in C++.pptx
RSA Algorithm and its implementation in C++.pptx
bani30122004
 
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
werip98386
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
ChandraB15
 
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
iosrjce
 
Ad

More from Chris Theisen (8)

Metrics for Security Effort Prioritization
Metrics for Security Effort PrioritizationMetrics for Security Effort Prioritization
Metrics for Security Effort Prioritization
Chris 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 Approximation
Chris Theisen
 
Software Security Education at Scale
Software Security Education at ScaleSoftware Security Education at Scale
Software Security Education at Scale
Chris 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 2015
Chris 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
 
Metrics for Security Effort Prioritization
Metrics for Security Effort PrioritizationMetrics for Security Effort Prioritization
Metrics for Security Effort Prioritization
Chris 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 Approximation
Chris Theisen
 
Software Security Education at Scale
Software Security Education at ScaleSoftware Security Education at Scale
Software Security Education at Scale
Chris 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 2015
Chris 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
 
Ad

Recently uploaded (20)

Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 

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

Editor's Notes

  • #12: Factoring = breaking a number into smaller numbers