1 Lect. 13 : Public Key Encryption RSA ElGamal. 2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in.

Slides:



Advertisements
Similar presentations
CS555Topic 191 Cryptography CS 555 Topic 19: Formalization of Public Key Encrpytion.
Advertisements

Asymmetric-Key Cryptography
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
7. Asymmetric encryption-
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
A Designer’s Guide to KEMs Alex Dent
Public Encryption: RSA
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
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.
CS470, A.SelcukRSA1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Public Key Algorithms 4/17/2017 M. Chatterjee.
1 CIS 5371 Cryptography 9. Data Integrity Techniques.
“RSA”. RSA  by Rivest, Shamir & Adleman of MIT in 1977  best known & widely used public-key scheme  RSA is a block cipher, plain & cipher text are.
Introduction to Public Key Cryptography
Public Key Model 8. Cryptography part 2.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
8. Data Integrity Techniques
1 Lect. 15 : Digital Signatures RSA, ElGamal, DSA, KCDSA, Schnorr.
The RSA Algorithm Rocky K. C. Chang, March
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Network Security (A Very Brief Introduction)
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2014 Nitesh Saxena.
10.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 Symmetric-Key Cryptography.
Cryptography Lecture 8 Stefan Dziembowski
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
RSA and its Mathematics Behind
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Introduction to Information Security Lecture 4: Public Key Cryptography & Digital Signature Prof. Kwangjo Kim.
A Method for Obtaining Digital Signatures and Public-key Cryptosystems
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
RSA Public Key Crypto System. About RSA Announced in 1977 by Ronald Rivest, Adi Shamir, and Leonard Adleman Relies on the relative ease of finding large.
1 Public-Key Cryptography and Message Authentication.
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 
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Network Security Lecture 18 Presented by: Dr. Munam Ali Shah.
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.
Attacking RSA Brian Winant Reference “Twenty Years of Attacks on the RSA Cryptosystem” By Dan Boneh In Notices of the American Mathematical.
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.
Tae-Joon Kim Jong yun Jun
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Introduction to Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
COM 5336 Lecture 8 Digital Signatures
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Attacks on Public Key Encryption Algorithms
Public Key Cryptosystem
Asymmetric-Key Cryptography
Public Key Encryption and Digital Signatures
Cryptography Lecture 26.
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Real-world Security of Public Key Crypto
Introduction to Cryptography
Cryptography Lecture 25.
The RSA Public-Key Encryption Algorithm
LAB 3: Digital Signature
Presentation transcript:

1 Lect. 13 : Public Key Encryption RSA ElGamal

2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in 1977 by Ron Rivest, Adi Shamir and Leonard Adleman at MIT  It is believed to be secure and still widely used

3 RSA Public Key Systems  Key generation  Choose two large (512 bits or more) primes p & q  Compute modulus n = pq, and  (n) = (p-1)(q-1)  Pick an integer e relatively prime to  (n), gcd(e,  (n))=1  Compute d such that ed = 1 mod  (n)  Public key (n, e) : publish  Private key d : keep secret (may discard p & q)  Special Property  (m e mod n) d mod n = (m d mod n) e mod n for 0 < m < n  Encryption / Decryption  E: c = m e mod n for 0 < m < n  D: m = c d mod n  Proof) C d = (M e ) d = M ed = M k  (n) +1 = M {M  (n) } k = M

4 RSA as a Trapdoor One-way Function Message m Ciphertext c c = f(m) = m e mod n m = f -1 (c) = c d mod n Public key Private key (trapdoor information) n = pq (p & q: primes) ed = 1 mod (p-1)(q-1)

5 RSA Public Key Systems  Example: Key Generation –p=3, q=11 –n = pq = 33,  (n) =(p-1)(q-1) = 2 x10 = 20 –e = 3 s.t. gcd(e,  (n) )=(3,20)=1 –Choose d s.t. ed =1 mod  (n), 3d = 1 mod 20, d=7 –Public key ={e,n}={3,33}, private key ={d}={7} Encryption –M =5 –C = M e mod n = 5 3 mod 33 =26 Decryption –M =C d mod n = 26 7 mod 33= 5

6 RSA Public Key Systems  Exercise 3: Provide an example of RSA key generation, encryption, and decryption for 1) p=17, q=23 (by hand calculation) 2) p=2357, q=2551 (using big number calculator) 3) p= , q= (using big number calculator) 1. Key generation 2. Encryption 3. Decryption

7 Selecting Primes p and q for RSA  How to select primes p and q ? 1.|p|  |q| to avoid ECM (Elliptic Curve Method for factoring) 2.p-q must be large to avoid trial division 3.p and q are strong prime  p-1 has large prime factor r (pollard’s p-1)  p+1 has large prime factor (William’s p+1)  r-1 has large prime factor (cyclic attack)

8 Security of RSA  Common Modulus attack:  If multiple entities share the same modulus n=pq with different pairs of (e i, d i ), it is not secure. Do not share the same modulus!  Cryptanalysis: If the same message M was encrypted to different users User u 1 : C 1 = M e 1 mod n User u 2 : C 2 = M e 2 mod n If gcd(e 1,e 2 )=1, there are a and b s.t. ae 1 + be 2 = 1 mod n Then, (C 1 ) a (C 2 ) b mod n = (M e 1 ) a (M e 2 ) b mod n = M ae 1 +be 2 mod n = M mod n

9 Security of RSA  Cycling attack If f(f( …f(M)))=f(M) where f(M) = M e mod n ? If a given ciphertext appears after some iterations, we can recover the plaintext at collusion point. Let C=M e mod n If (((C e ) e )…) e mod n = C e^k mod n = C, then C e^(k-1) mod n = M  Multiplicative attack (homomorphic property of RSA) (M 1 e ) (M 2 e ) mod n = (M 1 x M 2 ) e mod n

10 Security of Public Key Encryption Schemes  Security goals  One-wayness (OW): the adversary who sees a ciphertext is not able to compute the corresponding message  Indistinguishability (IND): observing a ciphertext, the adversary learns nothing about the plaintext. Also known as semantic security.  Non-malleability (NM): observing a ciphertext for a message m, the adversary cannot derive another ciphertext for a meaningful plaintext m’ related to m  Original RSA encryption is not secure  In IND: deterministic encryption  In NM: for example, from c=m e, c’ = 2 e c = (2m) e is easily obtained. It cannot be used in bidding scenario.

11 Security of Public Key Encryption Schemes  Indistinguishability m 0, m 1 b  R {0,1} PKE(pk, sk) Challenge: C=E(m b ) Guess b? The adversary win if he guess b correctly with a probability significantly greater than 1/2

12 Security of Public Key Encryption Schemes  Assume the existence of Decryption Oracle  Mimics an attacker’s access to the decryption device  Attack models  Chosen Plaintext Attack (CPA): the adversary can encrypt any plaintext of his choice. In public key encryption this is always possible.  Non-adaptive Chosen Ciphertext Attack (CCA1): the attacker has access to the decryption oracle before he sees a ciphertext that he wishes to manipulate (lunchtime attack)  Adaptive Chosen Ciphertext Attack (CCA2): the attacker has access to the decryption oracle before and after he sees a ciphertext c that he wishes to manipulate (but, he is not allowed to query the oracle about the target ciphertext c.)

RSA Padding  RSA encryption without padding  Deterministic encryption (same plaintext  same ciphertext)  Multiplicative property: m 1 e. m 2 e = (m 1 m 2 ) e mod n  Lots of attacks possible  Redundancy checking is essential for security  RSA encryption with OAEP  RSA encryption after OAEP (Optimal Asymmetric Encryption Padding)  Proposed by Bellare and Rogaway  Probabilistic encoding of message before encryption  RSA becomes a probabilistic encryption  Secure against IND-CCA2

14 RSA with OAEP  OAEP  RSA encryption s=m  G(r) t=r  H(s) r=t  H(s) m=s  G(r) Encryption padding Decryption padding c=E(s,t) RSA encryption  RSA decryption  OAEP (s,t)=D(c) RSA decryption + m r s t + H G n-bit message l-bit random value G H Hash function (Random oracle) r : l-bit random value OAEP looks like a kind of Feistel network.

15 RSA Encryption with RSA-OAEP Padding EM = Padding string:all 0x00 mLen   k - 2 hLen - 2   Parameter : Hash, MGF  Input : M, L, (n, e) Random string, seedLen = hLen MGF(Seed, Len) = Hash(Seed || 0) || Hash(Seed || 1) ||... Hash(Seed || t) DB =  Hash L M M 01 lHashPS MaskedDB MGF Seed masked Seed MGF  00 C = (EM) e mod n (Optional) Label In PKCS #1 v2.0, v2.1

16 Diffie-Hellman / ElGamal-type Systems  Domain parameter generation  Based on the hardness of DLP  Generate a large (1024 bits or more) prime p  Find a generator g that generates the cyclic group Z p *  Domain parameter = {p, g}  Key generation  Pick a random integer x  [1, p-1]  Compute y = g x mod p  Public key (p, g, y) : publish  Private key x : keep secret  Applications  Public key encryption  Digital signatures  Key agreement

17 ElGamal Encryption Scheme  Keys & parameters  Domain parameter = {p, g}  Choose x  [1, p-1] and compute y = g x mod p  Public key (p, g, y)  Private key x  Encryption: m  (C 1, C 2 )  Pick a random integer k  [1, p-1]  Compute C 1 = g k mod p  Compute C 2 = m  y k mod p  Decryption  m = C 2  C 1 -x mod p  C 2  C 1 -x = (m  y k )  (g k ) -x = m  (g x ) k  (g k ) -x = m mod p

18 ElGamal Encryption Scheme -- Example  Key Generation  Let p=23, g=7  Private key x=9  Public key y = g x mod p = 7 9 mod 23 = 15  Encryption: m  (C 1, C 2 )  Let m=20  Pick a random number k=3  Compute C 1 = g k mod p = 7 3 mod 23 = 21  Compute C 2 = m  y k mod p = 20  15 3 mod 23 = 20  17 mod 23 = 18  Send (C 1,C 2 ) = (21,18) as a ciphertext  Decryption  m = C 2 / C 1 x mod p = 18 / 21 9 mod 23 = 18 / 17 mod 23 = 20