SlideShare a Scribd company logo
Public Key Cryptography
and the
RSA Algorithm
Cryptography and Network Security
by William Stallings
Lecture slides by Lawrie Brown
Edited by Dick Steflik
Private-Key Cryptography
• traditional private/secret/single key cryptography
uses one key
• Key is shared by both sender and receiver
• if the key is disclosed communications are
compromised
• also known as symmetric, both parties are equal
• hence does not protect sender from receiver forging a
message & claiming is sent by sender
Public-Key Cryptography
• probably most significant advance in the 3000
•
•
•
•

year history of cryptography
uses two keys – a public key and a private key
asymmetric since parties are not equal
uses clever application of number theory concepts
to function
complements rather than replaces private key
cryptography
Public-Key Cryptography
• public-key/two-key/asymmetric cryptography
involves the use of two keys:

• a public-key, which may be known by anybody, and
can be used to encrypt messages, and verify
signatures
• a private-key, known only to the recipient, used to
decrypt messages, and sign (create) signatures

• is asymmetric because
• those who encrypt messages or verify signatures
cannot decrypt messages or create signatures
Public-Key Cryptography
Why Public-Key Cryptography?
• developed to address two key issues:
• key distribution – how to have secure

communications in general without having to
trust a KDC with your key
• digital signatures – how to verify a message
comes intact from the claimed sender

• public invention due to Whitfield Diffie &
Martin Hellman at Stanford U. in 1976
• known earlier in classified community
Public-Key Characteristics
• Public-Key algorithms rely on two keys

with the characteristics that it is:
• computationally infeasible to find decryption

key knowing only algorithm & encryption key
• computationally easy to en/decrypt messages
when the relevant (en/decrypt) key is known
• either of the two related keys can be used for
encryption, with the other used for decryption
(in some schemes)
Public-Key Cryptosystems
Public-Key Applications
• can classify uses into 3 categories:
• encryption/decryption (provide secrecy)
• digital signatures (provide authentication)
• key exchange (of session keys)
• some algorithms are suitable for all uses,
others are specific to one
Security of Public Key Schemes

• like private key schemes brute force exhaustive
•
•
•
•
•

search attack is always theoretically possible
but keys used are too large (>512bits)
security relies on a large enough difference in
difficulty between easy (en/decrypt) and hard
(cryptanalyse) problems
more generally the hard problem is known, its just
made too hard to do in practise
requires the use of very large numbers
hence is slow compared to private key schemes
RSA
• by Rivest, Shamir & Adleman of MIT in 1977
• best known & widely used public-key scheme
• based on exponentiation in a finite (Galois) field
over integers modulo a prime
• nb. exponentiation takes O((log n)3) operations (easy)

• uses large integers (eg. 1024 bits)
• security due to cost of factoring large numbers
• nb. factorization takes O(e log n log log n) operations (hard)
RSA Key Setup
• each user generates a public/private key pair by:
• selecting two large primes at random - p, q
• computing their system modulus N=p.q
• note ø(N)=(p-1)(q-1)

• selecting at random the encryption key e
• where 1<e<ø(N), gcd(e,ø(N))=1

• solve following equation to find decryption key d
• e.d=1 mod ø(N) and 0≤d≤N

• publish their public encryption key: KU={e,N}
• keep secret private decryption key: KR={d,p,q}
RSA Use
• to encrypt a message M the sender:
• obtains public key of recipient KU={e,N}
• computes: C=Me mod N, where 0≤M<N
• to decrypt the ciphertext C the owner:
• uses their private key KR={d,p,q}
• computes: M=Cd mod N
• note that the message M must be smaller
than the modulus N (block if needed)
Why RSA Works
• because of Euler's Theorem:
• aø(n)mod N = 1
• where gcd(a,N)=1

• in RSA have:
•
•
•
•

N=p.q
ø(N)=(p-1)(q-1)
carefully chosen e & d to be inverses mod ø(N)
hence e.d=1+k.ø(N) for some k

• hence :

Cd = (Me)d = M1+k.ø(N) = M1.(Mø(N))q = M1.(1)q = M1 =
M mod N
RSA Example
1.
2.
3.
4.
5.

Select primes: p=17 & q=11
Compute n = pq =17Ă—11=187
Compute ø(n)=(p–1)(q-1)=16×10=160
Select e : gcd(e,160)=1; choose e=7
Determine d: de=1 mod 160 and d < 160
Value is d=23 since 23Ă—7=161= 10Ă—160+1
6. Publish public key KU={7,187}
7. Keep secret private key KR={23,17,11}
RSA Example cont
• sample RSA encryption/decryption is:
• given message M = 88 (nb. 88<187)
• encryption:
C = 887 mod 187 = 11

• decryption:
M = 1123 mod 187 = 88
Exponentiation
•
•
•
•

can use the Square and Multiply Algorithm
a fast, efficient algorithm for exponentiation
concept is based on repeatedly squaring base
and multiplying in the ones that are needed to
compute the result
• look at binary representation of exponent
• only takes O(log2 n) multiples for number n
• eg. 75 = 74.71 = 3.7 = 10 mod 11
• eg. 3129 = 3128.31 = 5.3 = 4 mod 11
Exponentiation
RSA Key Generation
• users of RSA must:
• determine two primes at random - p, q
• select either e or d and compute the other

• primes p,q must not be easily derived from
modulus N=p.q

• means must be sufficiently large
• typically guess and use probabilistic test

• exponents e, d are inverses, so use Inverse
algorithm to compute the other
RSA Security
• three approaches to attacking RSA:
• brute force key search (infeasible given size of
numbers)
• mathematical attacks (based on difficulty of
computing ø(N), by factoring modulus N)
• timing attacks (on running of decryption)
Factoring Problem
• mathematical approach takes 3 forms:
• factor N=p.q, hence find ø(N) and then d
• determine ø(N) directly and find d
• find d directly

• currently believe all equivalent to factoring
• have seen slow improvements over the years
• as of Aug-99 best is 130 decimal digits (512) bit with GNFS

• biggest improvement comes from improved algorithm
• cf “Quadratic Sieve” to “Generalized Number Field Sieve”

• barring dramatic breakthrough 1024+ bit RSA secure
• ensure p, q of similar size and matching other constraints
Timing Attacks
• developed in mid-1990’s
• exploit timing variations in operations
• eg. multiplying by small vs large number
• or IF's varying which instructions executed

• infer operand size based on time taken
• RSA exploits time taken in exponentiation
• countermeasures
• use constant exponentiation time
• add random delays
• blind values used in calculations
Summary
• have considered:
• principles of public-key cryptography
• RSA algorithm, implementation, security

More Related Content

What's hot

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
 
Asymmetric Cryptography
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric Cryptography
UTD Computer Security Group
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
Joon Young Park
 
Rsa
RsaRsa
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
Samdish Arora
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
Abhishek Gautam
 
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHYRSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
Qualcomm
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
rinnocente
 
(Crypto) DES And RSA Algorithms Overview
(Crypto) DES And RSA Algorithms Overview(Crypto) DES And RSA Algorithms Overview
(Crypto) DES And RSA Algorithms Overview
EL Bachir Nouni
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
Shafaan Khaliq Bhatti
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric Encryption
Abdul Manaf Vellakodath
 
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 Encryption & Hash functions
Public Key Encryption & Hash functionsPublic Key Encryption & Hash functions
Public Key Encryption & Hash functions
Dr.Florence Dayana
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
Amlan Patel
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
Kathirvel Ayyaswamy
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authentication
CAS
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
swarnapatil
 

What's hot (20)

RSA Algorithem and information about rsa
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsa
 
Asymmetric Cryptography
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric Cryptography
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Rsa
RsaRsa
Rsa
 
rsa-1
rsa-1rsa-1
rsa-1
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Rsa
RsaRsa
Rsa
 
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHYRSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
RSA - ENCRYPTION ALGORITHM CRYPTOGRAPHY
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
 
(Crypto) DES And RSA Algorithms Overview
(Crypto) DES And RSA Algorithms Overview(Crypto) DES And RSA Algorithms Overview
(Crypto) DES And RSA Algorithms Overview
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric Encryption
 
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
Cryptography Cryptography
Cryptography
 
Public Key Encryption & Hash functions
Public Key Encryption & Hash functionsPublic Key Encryption & Hash functions
Public Key Encryption & Hash functions
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authentication
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
 

Viewers also liked

RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
Sathish Kumar
 
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan PalacioElliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Information Security Awareness Group
 
Ch02...1
Ch02...1Ch02...1
Ch02...1nathanurag
 
Ch01
Ch01Ch01
Ch01n C
 
Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
Information Security Awareness Group
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONraf_slide
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & Analysis
Pawandeep Kaur
 
Hash Function
Hash FunctionHash Function
Hash Function
Siddharth Srivastava
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniquesMohd Arif
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securitypatisa
 

Viewers also liked (14)

RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan PalacioElliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
 
Chap4
Chap4Chap4
Chap4
 
Ch02...1
Ch02...1Ch02...1
Ch02...1
 
Ch01
Ch01Ch01
Ch01
 
Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
 
Ch08
Ch08Ch08
Ch08
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & Analysis
 
Hash Function
Hash FunctionHash Function
Hash Function
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Ch14
Ch14Ch14
Ch14
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 

Similar to RSA

18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
SunnyAnchews
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
RizwanBasha12
 
Cyptography and network security unit 3-1
Cyptography and network security unit 3-1Cyptography and network security unit 3-1
Cyptography and network security unit 3-1
AsrithaKorupolu
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
DHANABALSUBRAMANIAN
 
Security - ch3.pptx
Security - ch3.pptxSecurity - ch3.pptx
Security - ch3.pptx
GebrehanaAlemaw
 
Security - ch3.pptx
Security - ch3.pptxSecurity - ch3.pptx
Security - ch3.pptx
HabtamuHaileMichael2
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
Sou Jana
 
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
VishwanathMahalle
 
Encryption techniques
Encryption techniquesEncryption techniques
Encryption techniques
MohitManna
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptographySuresh Thammishetty
 
RSA
RSARSA
Network security
Network securityNetwork security
Network security
ABHISHEK KUMAR
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
Vaibhav Khanna
 
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
CryptographyCryptography
Cryptography
Rutuja Solkar
 
CNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecurityCNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic Security
Sam Bowne
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
ChandraB15
 

Similar to RSA (20)

CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
 
Cyptography and network security unit 3-1
Cyptography and network security unit 3-1Cyptography and network security unit 3-1
Cyptography and network security unit 3-1
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
Security - ch3.pptx
Security - ch3.pptxSecurity - ch3.pptx
Security - ch3.pptx
 
Security - ch3.pptx
Security - ch3.pptxSecurity - ch3.pptx
Security - ch3.pptx
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
Ch09
Ch09Ch09
Ch09
 
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
 
Encryption techniques
Encryption techniquesEncryption techniques
Encryption techniques
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
RSA
RSARSA
RSA
 
Network security
Network securityNetwork security
Network security
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Cryptography
CryptographyCryptography
Cryptography
 
CNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecurityCNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic Security
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 

RSA

  • 1. Public Key Cryptography and the RSA Algorithm Cryptography and Network Security by William Stallings Lecture slides by Lawrie Brown Edited by Dick Steflik
  • 2. Private-Key Cryptography • traditional private/secret/single key cryptography uses one key • Key is shared by both sender and receiver • if the key is disclosed communications are compromised • also known as symmetric, both parties are equal • hence does not protect sender from receiver forging a message & claiming is sent by sender
  • 3. Public-Key Cryptography • probably most significant advance in the 3000 • • • • year history of cryptography uses two keys – a public key and a private key asymmetric since parties are not equal uses clever application of number theory concepts to function complements rather than replaces private key cryptography
  • 4. Public-Key Cryptography • public-key/two-key/asymmetric cryptography involves the use of two keys: • a public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures • a private-key, known only to the recipient, used to decrypt messages, and sign (create) signatures • is asymmetric because • those who encrypt messages or verify signatures cannot decrypt messages or create signatures
  • 6. Why Public-Key Cryptography? • developed to address two key issues: • key distribution – how to have secure communications in general without having to trust a KDC with your key • digital signatures – how to verify a message comes intact from the claimed sender • public invention due to Whitfield Diffie & Martin Hellman at Stanford U. in 1976 • known earlier in classified community
  • 7. Public-Key Characteristics • Public-Key algorithms rely on two keys with the characteristics that it is: • computationally infeasible to find decryption key knowing only algorithm & encryption key • computationally easy to en/decrypt messages when the relevant (en/decrypt) key is known • either of the two related keys can be used for encryption, with the other used for decryption (in some schemes)
  • 9. Public-Key Applications • can classify uses into 3 categories: • encryption/decryption (provide secrecy) • digital signatures (provide authentication) • key exchange (of session keys) • some algorithms are suitable for all uses, others are specific to one
  • 10. Security of Public Key Schemes • like private key schemes brute force exhaustive • • • • • search attack is always theoretically possible but keys used are too large (>512bits) security relies on a large enough difference in difficulty between easy (en/decrypt) and hard (cryptanalyse) problems more generally the hard problem is known, its just made too hard to do in practise requires the use of very large numbers hence is slow compared to private key schemes
  • 11. RSA • by Rivest, Shamir & Adleman of MIT in 1977 • best known & widely used public-key scheme • based on exponentiation in a finite (Galois) field over integers modulo a prime • nb. exponentiation takes O((log n)3) operations (easy) • uses large integers (eg. 1024 bits) • security due to cost of factoring large numbers • nb. factorization takes O(e log n log log n) operations (hard)
  • 12. RSA Key Setup • each user generates a public/private key pair by: • selecting two large primes at random - p, q • computing their system modulus N=p.q • note ø(N)=(p-1)(q-1) • selecting at random the encryption key e • where 1<e<ø(N), gcd(e,ø(N))=1 • solve following equation to find decryption key d • e.d=1 mod ø(N) and 0≤d≤N • publish their public encryption key: KU={e,N} • keep secret private decryption key: KR={d,p,q}
  • 13. RSA Use • to encrypt a message M the sender: • obtains public key of recipient KU={e,N} • computes: C=Me mod N, where 0≤M<N • to decrypt the ciphertext C the owner: • uses their private key KR={d,p,q} • computes: M=Cd mod N • note that the message M must be smaller than the modulus N (block if needed)
  • 14. Why RSA Works • because of Euler's Theorem: • aø(n)mod N = 1 • where gcd(a,N)=1 • in RSA have: • • • • N=p.q ø(N)=(p-1)(q-1) carefully chosen e & d to be inverses mod ø(N) hence e.d=1+k.ø(N) for some k • hence : Cd = (Me)d = M1+k.ø(N) = M1.(Mø(N))q = M1.(1)q = M1 = M mod N
  • 15. RSA Example 1. 2. 3. 4. 5. Select primes: p=17 & q=11 Compute n = pq =17Ă—11=187 Compute ø(n)=(p–1)(q-1)=16Ă—10=160 Select e : gcd(e,160)=1; choose e=7 Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23Ă—7=161= 10Ă—160+1 6. Publish public key KU={7,187} 7. Keep secret private key KR={23,17,11}
  • 16. RSA Example cont • sample RSA encryption/decryption is: • given message M = 88 (nb. 88<187) • encryption: C = 887 mod 187 = 11 • decryption: M = 1123 mod 187 = 88
  • 17. Exponentiation • • • • can use the Square and Multiply Algorithm a fast, efficient algorithm for exponentiation concept is based on repeatedly squaring base and multiplying in the ones that are needed to compute the result • look at binary representation of exponent • only takes O(log2 n) multiples for number n • eg. 75 = 74.71 = 3.7 = 10 mod 11 • eg. 3129 = 3128.31 = 5.3 = 4 mod 11
  • 19. RSA Key Generation • users of RSA must: • determine two primes at random - p, q • select either e or d and compute the other • primes p,q must not be easily derived from modulus N=p.q • means must be sufficiently large • typically guess and use probabilistic test • exponents e, d are inverses, so use Inverse algorithm to compute the other
  • 20. RSA Security • three approaches to attacking RSA: • brute force key search (infeasible given size of numbers) • mathematical attacks (based on difficulty of computing ø(N), by factoring modulus N) • timing attacks (on running of decryption)
  • 21. Factoring Problem • mathematical approach takes 3 forms: • factor N=p.q, hence find ø(N) and then d • determine ø(N) directly and find d • find d directly • currently believe all equivalent to factoring • have seen slow improvements over the years • as of Aug-99 best is 130 decimal digits (512) bit with GNFS • biggest improvement comes from improved algorithm • cf “Quadratic Sieve” to “Generalized Number Field Sieve” • barring dramatic breakthrough 1024+ bit RSA secure • ensure p, q of similar size and matching other constraints
  • 22. Timing Attacks • developed in mid-1990’s • exploit timing variations in operations • eg. multiplying by small vs large number • or IF's varying which instructions executed • infer operand size based on time taken • RSA exploits time taken in exponentiation • countermeasures • use constant exponentiation time • add random delays • blind values used in calculations
  • 23. Summary • have considered: • principles of public-key cryptography • RSA algorithm, implementation, security

Editor's Notes

  1. So far all the cryptosystems discussed have been private/secret/single key (symmetric) systems. All classical, and modern block and stream ciphers are of this form.
  2. Will now discuss the radically different public key systems, in which two keys are used. Anyone knowing the public key can encrypt messages or verify signatures, but cannot decrypt messages or create signatures, counter-intuitive though this may seem. It works by the clever use of number theory problems that are easy one way but hard the other. Note that public key schemes are neither more secure than private key (security depends on the key size for both), nor do they replace private key schemes (they are too slow to do so), rather they complement them.
  3. Stallings Fig 9-1.
  4. The idea of public key schemes, and the first practical scheme, which was for key distribution only, was published in 1977 by Diffie &amp; Hellman. The concept had been previously described in a classified report in 1970 by James Ellis (UK CESG) - and subsequently declassified in 1987. See History of Non-secret Encryption (at CESG). Its interesting to note that they discovered RSA first, then Diffie-Hellman, opposite to the order of public discovery!
  5. Public key schemes utilise problems that are easy (P type) one way but hard (NP type) the other way, eg exponentiation vs logs, multiplication vs factoring. Consider the following analogy using padlocked boxes: traditional schemes involve the sender putting a message in a box and locking it, sending that to the receiver, and somehow securely also sending them the key to unlock the box. The radical advance in public key schemes was to turn this around, the receiver sends an unlocked box to the sender, who puts the message in the box and locks it (easy - and having locked it cannot get at the message), and sends the locked box to the receiver who can unlock it (also easy), having the key. An attacker would have to pick the lock on the box (hard).
  6. Stallings Fig 9-4. Here see various components of public-key schemes used for both secrecy and authentication. Note that separate key pairs are used for each of these – receiver owns and creates secrecy keys, sender owns and creates authentication keys.
  7. Public key schemes are no more or less secure than private key schemes - in both cases the size of the key determines the security. Note also that you can&apos;t compare key sizes - a 64-bit private key scheme has very roughly similar security to a 512-bit RSA - both could be broken given sufficient resources. But with public key schemes at least there&apos;s usually a firmer theoretical basis for determining the security since its based on well-known and well studied number theory problems.
  8. RSA is the best known, and by far the most widely used general public key encryption algorithm.
  9. This key setup is done once (rarely) when a user establishes (or replaces) their public key. The exponent e is usually fairly small, just must be relatively prime to ø(N). Need to compute its inverse to find d. It is critically important that the private key KR={d,p,q} is kept secret, since if any part becomes known, the system can be broken. Note that different users will have different moduli N.
  10. Can show that RSA works as a direct consequence of Euler’s Theorem.
  11. Here walk through example using “trivial” sized numbers. Selecting primes requires the use of primality tests. Finding d as inverse of e mod ø(n) requires use of Inverse algorithm (see Ch4)
  12. Rather than having to laborious repeatedly multiply, can use the &quot;square and multiply&quot; algorithm with modulo reductions to implement all exponentiations quickly and efficiently (see next).
  13. Both the prime generation and the derivation of a suitable pair of inverse exponents may involve trying a number of alternatives, but theory shows the number is not large.
  14. See Stallings Table 9-3 for progress in factoring. Best current algorithm is the “Generalized Number Field Sieve” (GNFS), which replaced the earlier “Quadratic Sieve” in mid-1990’s. Do have an even more powerful and faster algorithm - the “Special Number Field Sieve” (SNFS) which currently only works with numbers of a particular form (not RSA like). However expect it may in future be used with all forms. Numbers of size 1024+ bits look reasonable at present, and the factors should be of similar size