RSA

CS 426 (Fall 2010)
Public Key Encryption and Digital
Signatures
Review of Secret Key (Symmetric)
Cryptography
• Confidentiality
– stream ciphers (uses PRNG)
– block ciphers with encryption modes
• Integrity
– Cryptographic hash functions
– Message authentication code (keyed hash functions)
• Limitation: sender and receiver must share the
same key
– Needs secure channel for key distribution
– Impossible for two parties having no prior relationship
– Needs many keys for n parties to communicate
Public Key Encryption Overview
• Each party has a PAIR (K, K-1) of keys:
– K is the public key, and used for encryption
– K-1 is the private key, and used for decryption
– Satisfies DK-1[EK[M]] = M
• Knowing the public-key K, it is computationally infeasible
to compute the private key K-1
– How to check (K,K-1) is a pair?
– Offers only computational security. PK Encryption impossible
when P=NP, as deriving K-1 from K is in NP.
• The public-key K may be made publicly available, e.g., in
a publicly available directory
– Many can encrypt, only one can decrypt
• Public-key systems aka asymmetric crypto systems
Public Key Cryptography Early
History
• The concept is proposed in Diffie and Hellman
(1976) “New Directions in Cryptography”
– public-key encryption schemes
– public key distribution systems
• Diffie-Hellman key agreement protocol
– digital signature
• Public-key encryption was proposed in 1970 by
James Ellis
– in a classified paper made public in 1997 by the British
Governmental Communications Headquarters
• Concept of digital signature is still originally due
to Diffie & Hellman
Public Key Encryption Algorithms
• Almost all public-key encryption algorithms use
either number theory and modular arithmetic, or
elliptic curves
• RSA
– based on the hardness of factoring large numbers
• El Gamal
– Based on the hardness of solving discrete logarithm
– Basic idea: public key gx, private key x, to encrypt:
[gy, gxy M].
RSA Algorithm
• Invented in 1978 by Ron Rivest, Adi Shamir
and Leonard Adleman
– Published as R L Rivest, A Shamir, L Adleman, "On
Digital Signatures and Public Key Cryptosystems",
Communications of the ACM, vol 21 no 2, pp120-126,
Feb 1978
• Security relies on the difficulty of factoring large
composite numbers
• Essentially the same algorithm was discovered
in 1973 by Clifford Cocks, who works for the
British intelligence
RSA Public Key Crypto System
Key generation:
1. Select 2 large prime numbers of about the same
size, p and q
Typically each p, q has between 512 and 2048 bits
2. Compute n = pq, and (n) = (q-1)(p-1)
3. Select e, 1<e< (n), s.t. gcd(e, (n)) = 1
Typically e=3 or e=65537
4. Compute d, 1< d< (n) s.t. ed  1 mod (n)
Knowing (n), d easy to compute.
Public key: (e, n)
Private key: d
RSA Description (cont.)
Encryption
Given a message M, 0 < M < n M  Zn {0}
use public key (e, n)
compute C = Me mod n C  Zn {0}
Decryption
Given a ciphertext C, use private key (d)
Compute Cd mod n = (Me mod n)d mod n = Med
mod n = M
Plaintext: M
C = Me mod (n=pq)
Ciphertext: C
Cd mod n
From n, difficult to figure out p,q
From (n,e), difficult to figure d.
From (n,e) and C, difficult to figure out M s.t. C = Me
RSA Example
• p = 11, q = 7, n = 77, (n) = 60
• d = 13, e = 37 (ed = 481; ed mod 60 = 1)
• Let M = 15. Then C  Me mod n
– C  1537 (mod 77) = 71
• M  Cd mod n
– M  7113 (mod 77) = 15
RSA Example 2
• Parameters:
– p = 3, q = 5, q= pq = 15
– (n) = ?
• Let e = 3, what is d?
• Given M=2, what is C?
• How to decrypt?
RSA Security
• Security depends on the difficulty of factoring n
– Factor n => (n) => compute d from (e, (n))
• The length of n=pq reflects the strength
– 700-bit n factored in 2007
– 768 bit factored in 2009
• 1024 bit for minimal level of security today
– likely to be breakable in near future
• Minimal 2048 bits recommended for current usage
• NIST suggests 15360-bit RSA keys are equivalent in
strength to 256-bit
• RSA speed is quadratic in key length
Real World Usage of Public Key
Encryption
• Often used to encrypt a symmetric key
– To encrypt a message M under a public key (n,e), generate a
new AES key K, compute [RSA(n,e,K), AES(K,M)]
• Plain RSA does not satisfy IND requirement.
– How to break it?
• One often needs padding, e.g., Optimal Asymmetric
Encryption Padding (OAEP)
– Roughly, to encrypt M, chooses random r, encode M as
M’ = [X = M  H1(r) , Y= r  H2(X) ]
where H1 and H2 are cryptographic hash functions, then encrypt
it as (M’) e mod n
– Note that given M’=[X,Y], r = Y  H2(X), and M = X  H1(r)
Digital Signatures: The Problem
• Consider the real-life example where a person pays by
credit card and signs a bill; the seller verifies that the
signature on the bill is the same with the signature on
the card
• Contracts, they are valid if they are signed.
• Signatures provide non-repudiation.
– ensuring that a party in a dispute cannot repudiate, or refute the
validity of a statement or contract.
• Can we have a similar service in the electronic world?
– Does Message Authentication Code provide non-repudiation?
Why?
Digital Signatures
• MAC: One party generates MAC, one party verifies
integrity.
• Digital signatures: One party generates signature,
many parties can verify.
• Digital Signature: a data string which associates a
message with some originating entity.
• Digital Signature Scheme:
– a signing algorithm: takes a message and a (private) signing
key, outputs a signature
– a verification algorithm: takes a (public) key verification key, a
message, and a signature
• Provides:
– Authentication, Data integrity, Non-Repudiation
Digital Signatures and Hash
• Very often digital signatures are used
with hash functions, hash of a
message is signed, instead of the
message.
• Hash function must be:
– Pre-image resistant
– Weak collision resistant
– Strong collision resistant
RSA Signatures
Key generation (as in RSA encryption):
• Select 2 large prime numbers of about the
same size, p and q
• Compute n = pq, and  = (q - 1)(p - 1)
• Select a random integer e, 1 < e < , s.t.
gcd(e, ) = 1
• Compute d, 1 < d <  s.t. ed  1 mod 
Public key: (e, n) used for verification
Secret key: d, used for generation
RSA Signatures (cont.)
Signing message M
• Verify 0 < M < n
• Compute S = Md mod n
Verifying signature S
• Use public key (e, n)
• Compute Se mod n = (Md mod n)e mod n = M
Note: in practice, a hash of the message is signed
and not the message itself.
The Big Picture
Secrecy /
Confidentiality
Stream ciphers
Block ciphers +
encryption modes
Public key
encryption: RSA,
El Gamal, etc.
Authenticity /
Integrity
Message
Authentication
Code
Digital Signatures:
RSA, DSA, etc.
Secret Key
Setting
Public Key
Setting
Readings for This Lecture
• Differ & Hellman:
– New Directions in Cryptography
Coming Attractions …
• Key management and certificates
1 von 21

Recomendados

RSA algorithm von
RSA algorithmRSA algorithm
RSA algorithmArpana shree
12K views13 Folien
Rsa Crptosystem von
Rsa CrptosystemRsa Crptosystem
Rsa CrptosystemAmlan Patel
3.3K views17 Folien
Rsa von
RsaRsa
RsaNavneet Sharma
1.1K views23 Folien
Rsa algorithm key generation von
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation swarnapatil
6.8K views12 Folien
RSA Algorithm von
RSA AlgorithmRSA Algorithm
RSA AlgorithmSrinadh Muvva
888 views14 Folien
RSA Algorithm - Public Key Cryptography von
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyMd. Shafiul Alam Sagor
543 views23 Folien

Más contenido relacionado

Was ist angesagt?

Asymmetric Cryptography von
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric CryptographyUTD Computer Security Group
1.8K views31 Folien
Public key cryptography and RSA von
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSAShafaan Khaliq Bhatti
6.4K views21 Folien
Public Key Cryptography and RSA algorithm von
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmIndra97065
16.2K views27 Folien
RSA ALGORITHM von
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHMShashank Shetty
51.2K views28 Folien
Rsa cryptosystem von
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystemAbhishek Gautam
4.2K views37 Folien
Cs8792 cns - unit v von
Cs8792   cns - unit vCs8792   cns - unit v
Cs8792 cns - unit vArthyR3
442 views89 Folien

Was ist angesagt?(20)

Public Key Cryptography and RSA algorithm von Indra97065
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
Indra9706516.2K views
Cs8792 cns - unit v von ArthyR3
Cs8792   cns - unit vCs8792   cns - unit v
Cs8792 cns - unit v
ArthyR3442 views
Cryptography using rsa cryptosystem von Samdish Arora
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
Samdish Arora1.7K views
Cs8792 cns - Public key cryptosystem (Unit III) von ArthyR3
Cs8792   cns - Public key cryptosystem (Unit III)Cs8792   cns - Public key cryptosystem (Unit III)
Cs8792 cns - Public key cryptosystem (Unit III)
ArthyR3820 views
Digital Signature Standard von Sou Jana
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
Sou Jana519 views
Computer Security Lecture 2: Classical Encryption Techniques 1 von Benha University
Computer Security Lecture 2: Classical Encryption Techniques 1Computer Security Lecture 2: Classical Encryption Techniques 1
Computer Security Lecture 2: Classical Encryption Techniques 1
Benha University2.4K views
Cryptography Fundamentals von Duy Do Phan
Cryptography FundamentalsCryptography Fundamentals
Cryptography Fundamentals
Duy Do Phan2.4K views
Intro to modern cryptography von zahid-mian
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
zahid-mian2.5K views
Cryptography and network security Nit701 von Amit Pathak
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
Amit Pathak1.3K views

Similar a RSA

New ppt.ppt von
New ppt.pptNew ppt.ppt
New ppt.pptssuser4030a8
2 views21 Folien
3 pkc+rsa von
3 pkc+rsa3 pkc+rsa
3 pkc+rsaShashank Mishra
472 views24 Folien
Introduction to cryptography von
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptographySuresh Thammishetty
1.8K views31 Folien
Common Crypto Pitfalls von
Common Crypto PitfallsCommon Crypto Pitfalls
Common Crypto PitfallsAmirali Sanatinia
372 views39 Folien
Ch9 von
Ch9Ch9
Ch9Mahender Kumar
1.9K views37 Folien
PUBLIC KEY & RSA.ppt von
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptRizwanBasha12
22 views20 Folien

Similar a RSA(20)

OS ppt Modified.pptx von StudyvAbhi
OS ppt Modified.pptxOS ppt Modified.pptx
OS ppt Modified.pptx
StudyvAbhi2 views
Information and network security 33 rsa algorithm von Vaibhav Khanna
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
Vaibhav Khanna96 views
Simple Overview of PKI and Digital signature by Tarek_Gaber von Tarek Gaber
Simple Overview of PKI and Digital signature by Tarek_GaberSimple Overview of PKI and Digital signature by Tarek_Gaber
Simple Overview of PKI and Digital signature by Tarek_Gaber
Tarek Gaber696 views
Cryptography and network security von Nagendra Um
Cryptography and network securityCryptography and network security
Cryptography and network security
Nagendra Um14.7K views
RSA & MD5 algorithm von Siva Rushi
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
Siva Rushi12.6K views
CRYPTOGRAPHY (2).pdf von BhuvanaR13
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
BhuvanaR1332 views
RSA Algorithem and information about rsa von Mohsin Ali
RSA Algorithem and information about rsaRSA Algorithem and information about rsa
RSA Algorithem and information about rsa
Mohsin Ali213 views

Último

Ansari: Practical experiences with an LLM-based Islamic Assistant von
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic AssistantM Waleed Kadous
12 views29 Folien
Basic Design Flow for Field Programmable Gate Arrays von
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate ArraysUsha Mehta
10 views21 Folien
GDSC Mikroskil Members Onboarding 2023.pdf von
GDSC Mikroskil Members Onboarding 2023.pdfGDSC Mikroskil Members Onboarding 2023.pdf
GDSC Mikroskil Members Onboarding 2023.pdfgdscmikroskil
72 views62 Folien
unit 1.pptx von
unit 1.pptxunit 1.pptx
unit 1.pptxrrbornarecm
5 views53 Folien
IRJET-Productivity Enhancement Using Method Study.pdf von
IRJET-Productivity Enhancement Using Method Study.pdfIRJET-Productivity Enhancement Using Method Study.pdf
IRJET-Productivity Enhancement Using Method Study.pdfSahilBavdhankar
10 views4 Folien
sam_software_eng_cv.pdf von
sam_software_eng_cv.pdfsam_software_eng_cv.pdf
sam_software_eng_cv.pdfsammyigbinovia
19 views5 Folien

Último(20)

Ansari: Practical experiences with an LLM-based Islamic Assistant von M Waleed Kadous
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic Assistant
M Waleed Kadous12 views
Basic Design Flow for Field Programmable Gate Arrays von Usha Mehta
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate Arrays
Usha Mehta10 views
GDSC Mikroskil Members Onboarding 2023.pdf von gdscmikroskil
GDSC Mikroskil Members Onboarding 2023.pdfGDSC Mikroskil Members Onboarding 2023.pdf
GDSC Mikroskil Members Onboarding 2023.pdf
gdscmikroskil72 views
IRJET-Productivity Enhancement Using Method Study.pdf von SahilBavdhankar
IRJET-Productivity Enhancement Using Method Study.pdfIRJET-Productivity Enhancement Using Method Study.pdf
IRJET-Productivity Enhancement Using Method Study.pdf
SahilBavdhankar10 views
REACTJS.pdf von ArthyR3
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR339 views
AWS Certified Solutions Architect Associate Exam Guide_published .pdf von Kiran Kumar Malik
AWS Certified Solutions Architect Associate Exam Guide_published .pdfAWS Certified Solutions Architect Associate Exam Guide_published .pdf
AWS Certified Solutions Architect Associate Exam Guide_published .pdf
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R... von IJCNCJournal
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...
IJCNCJournal5 views
Integrating Sustainable Development Goals (SDGs) in School Education von SheetalTank1
Integrating Sustainable Development Goals (SDGs) in School EducationIntegrating Sustainable Development Goals (SDGs) in School Education
Integrating Sustainable Development Goals (SDGs) in School Education
SheetalTank113 views
MongoDB.pdf von ArthyR3
MongoDB.pdfMongoDB.pdf
MongoDB.pdf
ArthyR351 views
Programmable Logic Devices : SPLD and CPLD von Usha Mehta
Programmable Logic Devices : SPLD and CPLDProgrammable Logic Devices : SPLD and CPLD
Programmable Logic Devices : SPLD and CPLD
Usha Mehta27 views

RSA

  • 1. CS 426 (Fall 2010) Public Key Encryption and Digital Signatures
  • 2. Review of Secret Key (Symmetric) Cryptography • Confidentiality – stream ciphers (uses PRNG) – block ciphers with encryption modes • Integrity – Cryptographic hash functions – Message authentication code (keyed hash functions) • Limitation: sender and receiver must share the same key – Needs secure channel for key distribution – Impossible for two parties having no prior relationship – Needs many keys for n parties to communicate
  • 3. Public Key Encryption Overview • Each party has a PAIR (K, K-1) of keys: – K is the public key, and used for encryption – K-1 is the private key, and used for decryption – Satisfies DK-1[EK[M]] = M • Knowing the public-key K, it is computationally infeasible to compute the private key K-1 – How to check (K,K-1) is a pair? – Offers only computational security. PK Encryption impossible when P=NP, as deriving K-1 from K is in NP. • The public-key K may be made publicly available, e.g., in a publicly available directory – Many can encrypt, only one can decrypt • Public-key systems aka asymmetric crypto systems
  • 4. Public Key Cryptography Early History • The concept is proposed in Diffie and Hellman (1976) “New Directions in Cryptography” – public-key encryption schemes – public key distribution systems • Diffie-Hellman key agreement protocol – digital signature • Public-key encryption was proposed in 1970 by James Ellis – in a classified paper made public in 1997 by the British Governmental Communications Headquarters • Concept of digital signature is still originally due to Diffie & Hellman
  • 5. Public Key Encryption Algorithms • Almost all public-key encryption algorithms use either number theory and modular arithmetic, or elliptic curves • RSA – based on the hardness of factoring large numbers • El Gamal – Based on the hardness of solving discrete logarithm – Basic idea: public key gx, private key x, to encrypt: [gy, gxy M].
  • 6. RSA Algorithm • Invented in 1978 by Ron Rivest, Adi Shamir and Leonard Adleman – Published as R L Rivest, A Shamir, L Adleman, "On Digital Signatures and Public Key Cryptosystems", Communications of the ACM, vol 21 no 2, pp120-126, Feb 1978 • Security relies on the difficulty of factoring large composite numbers • Essentially the same algorithm was discovered in 1973 by Clifford Cocks, who works for the British intelligence
  • 7. RSA Public Key Crypto System Key generation: 1. Select 2 large prime numbers of about the same size, p and q Typically each p, q has between 512 and 2048 bits 2. Compute n = pq, and (n) = (q-1)(p-1) 3. Select e, 1<e< (n), s.t. gcd(e, (n)) = 1 Typically e=3 or e=65537 4. Compute d, 1< d< (n) s.t. ed  1 mod (n) Knowing (n), d easy to compute. Public key: (e, n) Private key: d
  • 8. RSA Description (cont.) Encryption Given a message M, 0 < M < n M  Zn {0} use public key (e, n) compute C = Me mod n C  Zn {0} Decryption Given a ciphertext C, use private key (d) Compute Cd mod n = (Me mod n)d mod n = Med mod n = M
  • 9. Plaintext: M C = Me mod (n=pq) Ciphertext: C Cd mod n From n, difficult to figure out p,q From (n,e), difficult to figure d. From (n,e) and C, difficult to figure out M s.t. C = Me
  • 10. RSA Example • p = 11, q = 7, n = 77, (n) = 60 • d = 13, e = 37 (ed = 481; ed mod 60 = 1) • Let M = 15. Then C  Me mod n – C  1537 (mod 77) = 71 • M  Cd mod n – M  7113 (mod 77) = 15
  • 11. RSA Example 2 • Parameters: – p = 3, q = 5, q= pq = 15 – (n) = ? • Let e = 3, what is d? • Given M=2, what is C? • How to decrypt?
  • 12. RSA Security • Security depends on the difficulty of factoring n – Factor n => (n) => compute d from (e, (n)) • The length of n=pq reflects the strength – 700-bit n factored in 2007 – 768 bit factored in 2009 • 1024 bit for minimal level of security today – likely to be breakable in near future • Minimal 2048 bits recommended for current usage • NIST suggests 15360-bit RSA keys are equivalent in strength to 256-bit • RSA speed is quadratic in key length
  • 13. Real World Usage of Public Key Encryption • Often used to encrypt a symmetric key – To encrypt a message M under a public key (n,e), generate a new AES key K, compute [RSA(n,e,K), AES(K,M)] • Plain RSA does not satisfy IND requirement. – How to break it? • One often needs padding, e.g., Optimal Asymmetric Encryption Padding (OAEP) – Roughly, to encrypt M, chooses random r, encode M as M’ = [X = M  H1(r) , Y= r  H2(X) ] where H1 and H2 are cryptographic hash functions, then encrypt it as (M’) e mod n – Note that given M’=[X,Y], r = Y  H2(X), and M = X  H1(r)
  • 14. Digital Signatures: The Problem • Consider the real-life example where a person pays by credit card and signs a bill; the seller verifies that the signature on the bill is the same with the signature on the card • Contracts, they are valid if they are signed. • Signatures provide non-repudiation. – ensuring that a party in a dispute cannot repudiate, or refute the validity of a statement or contract. • Can we have a similar service in the electronic world? – Does Message Authentication Code provide non-repudiation? Why?
  • 15. Digital Signatures • MAC: One party generates MAC, one party verifies integrity. • Digital signatures: One party generates signature, many parties can verify. • Digital Signature: a data string which associates a message with some originating entity. • Digital Signature Scheme: – a signing algorithm: takes a message and a (private) signing key, outputs a signature – a verification algorithm: takes a (public) key verification key, a message, and a signature • Provides: – Authentication, Data integrity, Non-Repudiation
  • 16. Digital Signatures and Hash • Very often digital signatures are used with hash functions, hash of a message is signed, instead of the message. • Hash function must be: – Pre-image resistant – Weak collision resistant – Strong collision resistant
  • 17. RSA Signatures Key generation (as in RSA encryption): • Select 2 large prime numbers of about the same size, p and q • Compute n = pq, and  = (q - 1)(p - 1) • Select a random integer e, 1 < e < , s.t. gcd(e, ) = 1 • Compute d, 1 < d <  s.t. ed  1 mod  Public key: (e, n) used for verification Secret key: d, used for generation
  • 18. RSA Signatures (cont.) Signing message M • Verify 0 < M < n • Compute S = Md mod n Verifying signature S • Use public key (e, n) • Compute Se mod n = (Md mod n)e mod n = M Note: in practice, a hash of the message is signed and not the message itself.
  • 19. The Big Picture Secrecy / Confidentiality Stream ciphers Block ciphers + encryption modes Public key encryption: RSA, El Gamal, etc. Authenticity / Integrity Message Authentication Code Digital Signatures: RSA, DSA, etc. Secret Key Setting Public Key Setting
  • 20. Readings for This Lecture • Differ & Hellman: – New Directions in Cryptography
  • 21. Coming Attractions … • Key management and certificates