CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.

Slides:



Advertisements
Similar presentations
CMSC 414 Computer (and Network) Security Lecture 4 Jonathan Katz.
Advertisements

CS555Topic 191 Cryptography CS 555 Topic 19: Formalization of Public Key Encrpytion.
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
7. Asymmetric encryption-
CMSC 414 Computer (and Network) Security Lecture 5 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
CMSC 456 Introduction to Cryptography
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
The RSA Cryptosystem Dan Boneh Stanford University.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
A Designer’s Guide to KEMs Alex Dent
Asymmetric Cryptography part 1 & 2 Haya Shulman Many thanks to Amir Herzberg who donated some of the slides from
CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 16 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 23 Jonathan Katz.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
1 Introduction to Information Security , Spring 2015 Lecture 7: Applied cryptography: asymmetric Eran Tromer Slides credit: John Mitchell, Stanford.
Public Key Model 8. Cryptography part 2.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2014 Nitesh Saxena.
Cryptography Lecture 8 Stefan Dziembowski
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Application of Elliptic Curves to Cryptography
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Lecture 3.4: Public Key Cryptography IV CS 436/636/736 Spring 2013 Nitesh Saxena.
4 th lecture.  Message to be encrypted: HELLO  Key: XMCKL H E L L O message 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message + 23 (X) 12 (M) 2 (C) 10 (K) 11.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
Public-Key Encryption
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept Part I: Introduction to Number Theory Part II: Advanced Cryptography.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Chapter 3 (B) – Key Management; Other Public Key Cryptosystems.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
CS555Spring 2012/Topic 71 Cryptography CS 555 Topic 7: Stream Ciphers and CPA Security.
Tae-Joon Kim Jong yun Jun
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1 Diffie-Hellman (Key Exchange) Protocol Rocky K. C. Chang 9 February 2007.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
1 Introduction to Information Security , Spring 2016 Lecture 4: Applied cryptography: asymmetric Zvi Ostfeld Slides credit: Eran Tromer.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Cryptography Lecture 26.
Cryptography Lecture 12.
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Topic 30: El-Gamal Encryption
Cryptography Lecture 25.
Cryptography Lecture 22.
Cryptography Lecture 21.
Cryptography Lecture 25.
Cryptography Lecture 24.
Cryptography Lecture 23.
Presentation transcript:

CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz

Review: El Gamal encryption  (Some aspects of the actual scheme are simplified)  Key generation –Choose a large prime p, and an element g  Z p * –Choose random x  {0, …, p-2}, set h=g x –The public key is (p, g, h), and the private key is x  Encryption –View the message m as an element of Z p * –Choose random r  {0, …, p-2} –The ciphertext is (g r, h r  m)  To decrypt ciphertext (c 1, c 2 ) output c 2 /c 1 x –Correctness?

Security?  Security of El Gamal encryption is based on the decisional Diffie-Hellman assumption  Best current algorithm for the decisional Diffie- Hellman problem in Z p * runs in time ≈ exp(|p| 1/3 ) –So if p is a 1024-bit prime, best current attack on El Gamal encryption requires time ≈ 2 60  In other groups, the Diffie-Hellman problem is currently ‘harder’ –E.g., for elliptic curve groups, best current algorithms require time exp(|p|/2) –Can use 120-bit primes to get 2 60 security

RSA background  N=pq, p and q distinct, odd primes   (N) = (p-1)(q-1) = |Z N * | –Easy to compute  (N) given the factorization of N –Hard to compute  (N) without the factorization of N  For all x  Z N *, it holds that x  (N) = 1 mod N  If ed=1 mod  (N), then for all m: (m e ) d = m mod N I.e., given d, we can compute e th roots

We have an asymmetry!  Let e be relatively prime to  (N) –Needed so that ed=1 mod  (N) has a solution  Given e and the factors of N, can compute d and hence compute e th roots  Without the factorization of N, no apparent way to compute e th roots

Hardness of computing e th roots?  The RSA problem: –Given N, e, and c, compute c 1/e mod N  If factoring is easy, then the RSA problem is easy  We know of no other way to solve the RSA problem besides factoring N –But we do not know how to prove that the RSA problem is as hard as factoring  The upshot: we believe factoring is hard, and we believe the RSA problem is hard

How hard is factoring?  Best current algorithms for factoring N=pq a product of two equal-length primes, run in time ≈ exp(|N| 1/3 )  So need |N| ≈ 1024 for reasonable security  Currently |N| ≈ 2048 recommended for good security margins

We have an asymmetry!  Given d (which can be computed from e and the factorization of N), possible to compute e th roots  Without the factorization of N, no apparent way to compute e th roots  Let’s use this to encrypt…

RSA key generation  Generate random p, q of sufficient length  Compute N=pq and  (N) = (p-1)(q-1)  Compute e and d such that ed = 1 mod  (N) –e must be relatively prime to  (N) –Typical choice: e = 3; other choices possible  Public key = (N, e); private key = (N, d)

“Textbook RSA” encryption  Public key (N, e); private key (N, d)  To encrypt a message m  Z N *, compute c = m e mod N  To decrypt a ciphertext c, compute m = c d mod N  Correctness…  …what about security?

Textbook RSA is insecure!  It is deterministic!  Furthermore, it can be shown that the ciphertext leaks specific information about the plaintext

Padded RSA  Introduce randomization…  Public key (N, e); private key (N, d) –Say |N| = 1024 bits  To encrypt m  {0,1} 895, –Choose random r  {0,1} 128 –Compute c = (r | m) e mod N  Decryption done in the natural way…  Essentially this is standardized as PKCS #1 v1.5

Hybrid encryption  Public-key encryption is “slow”  Encrypting “block-by-block” would be inefficient for long messages  Hybrid encryption gives the functionality of public-key encryption at the (asymptotic) efficiency of private-key encryption!

Hybrid encryption Enc’ message Enc k “encapsulated key” “encrypted message” ciphertext Enc = public-key encryption scheme Enc’ = private-key encryption scheme pk random!

Security  If public-key component and private-key component are secure against chosen-plaintext attacks, then hybrid encryption is secure against chosen-plaintext attacks

Extension  How should hybrid encryption be done when sending the same message to multiple recipients (e.g., encryption)?

Malleability  All the public-key encryption schemes we have seen so far are malleable –Given ciphertext c that encrypts (unknown) message m, possible to generate a ciphertext c’ that encrypts a related message m’  In the public-key setting, security against chosen- ciphertext attacks implies non-malleability  In many scenarios, malleability/chosen-ciphertext attacks are problematic –E.g., auction example; password example; Bleichenbacher attack…

Bleichenbacher’s attack  RSA PKCS #1 v1.5 is actually defined as: c = (00 || 02 || r || 0 || m) e mod N  When decrypting, return an error if formatting is not obeyed  This enables a chosen-ciphertext attack that relies only on the ability to detect errors upon decryption

Bleichenbacher’s attack c = Enc pk (m) c1c1 error/no error c 999 error/no error … If the {c i } are carefully constructed, this information is enough to determine m!

Malleability  All the public-key encryption schemes we have seen so far are malleable –Given a ciphertext c that encrypts an (unknown) message m, possible to generate a ciphertext c’ that encrypts a related message m’  Note: the problem is not integrity (there is no integrity in public-key encryption, anyway), but malleability and/or the ability to conduct a chosen- ciphertext attack

Malleability in private-key setting  Malleability is an issue in the private-key setting as well –Recall that CBC, OFB, CTR mode are all vulnerable to chosen-ciphertext attacks, and are all malleable  Authenticated encryption schemes (e.g., “encrypt- then-authenticate”) are secure against chosen- ciphertext attacks (and non-malleable)