Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CIS 5371 Cryptography 8. Asymmetric encryption-.

Similar presentations


Presentation on theme: "1 CIS 5371 Cryptography 8. Asymmetric encryption-."— Presentation transcript:

1 1 CIS 5371 Cryptography 8. Asymmetric encryption-

2 Public Key Cryptography Alice Bob Alice and Bob want to exchange a private key in public.

3 Public Key Cryptography The Diffie-Hellman protocol

4 Alice g a mod p Bob g b mod p The private key is: g ab mod p where p is a prime and g is a generator of Z p *

5 Example  p = 43, g = 3,  Alice and Bob share (p,g) = (43,3).  Alice picks her (secret) exponent: a random a = 8  U [0:42].  Alice sends Bob: 3 8  25 (mod 43).  Bob picks his (secret) exponent: a random b = 37  U [0:42].  Bob sends Alice: 3 37  20 (mod 43).  The secret key agreed between the two is: 9  20 8  25 37 (mod 43).

6 Man-in-the-middle attack Alice picks a  U Z p * and sends Malice (“Bob”): g a (mod p) Malice (“Alice”) picks m  Z p * and sends Bob: g m (mod p) Bob picks b  U Z p * and sends Malice (“Bob) Bob: g b (mod p) Malice (“Bob”) sends Alice: g m (mod p) Alice computes: k 1  (g m ) a (mod p) Bob computes: k 2  (g m ) b (mod p)

7 The Computational Diffie-Hellman Problem, CDH

8 The Computational Diffie-Hellman Assumption A CDH solver is a PPT algorithm that solves the CDH problem. The CDH Assumption is that, for any CDH solver there exists a negligible function negl such that: ―for an arbitrary instance of the CDH problem, the CDH solver will succeed with probability  negl for all sufficiently large inputs.

9 The Decisional Diffie-Hellman Problem, DDH INPUT –The description of a finite cyclic group G of prime order q –A generator element g of G – g a, g b, g c  G, for some integers 0 < a,b,c< q. OUTPUT –1 ---Decision that g c = g ab or –0 ---Decision that g c  g ab

10 The Decisional Diffie-Hellman Assumption A DDH solver is a PPT algorithm that solves the DDH problem. The DDH Assumption is that, for any DDH solver, there exists a negligible function negl such that: ―for an arbitrary instance of the DDH problem, the DDH solver will succeed with probability  negl for all sufficiently large inputs.

11 The Discrete Logarithm Problem The Discrete Logarithm Problem -- DL INPUT –The description of a finite cyclic group G of order q (say Z p * ) –A generator element g of G – h  G. OUTPUT –The unique integer a < p such that h = g a mod p. We call the integer a the discrete logarithm of h in base g and write: a = log g h mod p.

12 The Discrete Logarithm Assumption A DL solver is a PPT algorithm that solves the DL problem. The DL Assumption is that, for any DL solver, there exists a negligible function negl such that: ―for an arbitrary instance of the DL problem, the DDH solver will succeed with probability  negl for all sufficiently large inputs.

13 The RSA cryptosystem Alice performs the following steps  Choose p, q large primes with |p|  |q|.  Compute N = pq.  Compute  (N) = (p-1)(q-1).  Choose a random integer e <  (N) such that gcd(e,  (N)) = 1 and compute the integer d such that ed = 1 (mod  (N)).  Make (N,e) the public key, keep (N,d) as private key, and discard p,q and  (N).

14 The RSA cryptosystem

15 Check We have: ed = 1 (mod  (N)), so ed = 1 + t  (N). Therefore, D d (E e (m)) = (m e ) d = m ed = m t  (N)+1 = (m  (n) ) t  m = 1  m = m mod n

16 Example Let p = 101, q = 113. Then N = 11413.  (N) = 100 x 112 = 11200 = 2 6 5 2 7 For encryption use e = 3533. Alice computes: d = 6531 such that ed =1 mod 11200 (using the Extended Euclidean Algorithm). Alice publishes: N = 11413, e = 3533. Suppose Bob wants to encrypt: 9726. Bob computes 9726 3533 mod 11413 = 5761 Bob sends Alice the ciphertext 5761. To decrypt it Alice computes the plaintext: 5761 6597 (mod 11413) = 9726

17 Implementation 1. Generate two large primes: p,q 2. N  pq and  (N)= (p-1)(q-1) 3. Choose random e: with 1 < e <  (N) & gcd(e,  (N))=1 4. d  e -1 mod f (n) 5. The public key is (N,e) and the private key is (N,d )

18 Cost In Z n : Cost of a modular multiplication (x  y) mod n is O (k 2 ), where k = |log 2 n| Cost of a modular exponentiation x z (mod n) is O (k 2 log 2 z) = O (k 2 log 2 n)

19 Cryptanalysis of Public-key cryptosystems Active attacks on cryptosystems Chosen-Plaintext Attack (CPA): –The attacker chooses plaintexts and obtains the corresponding ciphertexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext. Chosen-Ciphertext Attack (CCA1): –The attacker chooses a number of ciphertexts and obtains the corresponding plaintexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext. Adaptive Chosen-Ciphertext Attack (CCA2): –This is a CCS1 attack in which the attacker can adaptively choose ciphertexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext.

20 The RSA Problem INPUT –N = pq with p,q prime nmbers. –e an integer such that gcd(e,(p-1)(q-1)) =1 –c  Z N. OUTPUT –The unique integer m  Z N such that m e  c (mod N )

21 The RSA Assumption An RSA solver is a PPT algorithm that solves the RSA problem. The RSA Assumption is that, for any RSA solver, there exists a negligible function negl such that: ―for an arbitrary instance of the RSA problem, the RSA solver will succeed with probability  negl for all sufficiently large inputs.

22 The Integer Factorization Problem The IF Problem (IF) INPUT –N an odd composite integer with at least two distinct prime factors. OUTPUT –A prime p such that p | N.

23 The IF Assumption An integer factorizer is a PPT algorithm that solves the IF problem. The IF Assumption is that, for any IF solver, there exists a negligible function negl such that: ―for an arbitrary instance of the IF problem, the IF solver will succeed with probability  negl for all sufficiently large inputs.

24 Security of RSA 1. Relation to IF problem Recovering the plaintext m from an RSA ciphertext c is easy if factoring is possible. 2. Relation to RSA problem Recovering the plaintext m from an RSA ciphertext c is easy if the RSA problem is easy. 3. Relation between IF and RSA problems If the IF problem is easy then the RSA problem is easy. The converse is likely not to be true.

25 The Rabin cryptosystem Alice performs the following steps  Choose p, q large primes with |p| = |q|.  Compute N = pq.  Pick a random integer b  U Z n *  Make (N,b) public key, keep (p,q) as private key.

26 The Rabin cryptosystem Encryption Let m  Z n * be the confidential message that Bob wants to send to Alice. Bob computes the ciphertext: c  m(m+b) mod N. Bob sends Alice: c Decryption To decrypt the ciphertext c Alice solves the quadratic equation: m 2 + bm –c  0 (mod N), for m < N.

27 The Rabin cryptosystem

28 Remarks Suppose p  q  3 (mod 4), n = pq. Let y  x 2 (mod n). Then: Because.

29 Remarks (continued) It follows that: is a square root of y modulo p. A similar argument applies for the other prime q. So we get the quadratic residues modulo p and modulo q. We then get the quadratic residue modulo n by using the Chinese Remainder Theorem.

30 Example Suppose n = 77. Then e (x) = x 2 mod 77 d (y) = mod 77 Suppose Bob wants to decrypt y = 23

31 Example, continued Using the Chinese Remainder Theorem we compute the 4 square roots of 23 modulo 77 to be:

32 The Rabin Problem

33 Security of Rabin 1. Relation to factoring. Recovering the plaintext m from a Rabin ciphertext c is easy if the IF problem is easy. 3. Relation between factoring and the Rabin problem Under CPA attacks the Rabin system is secure iff the IF problem is hard. Under CCA attacks the Rabin problem is completely insecure.

34 Security of Rabin

35 The ELGamal cryptosystem

36 The ElGamal cryptosystem

37

38 Example

39 Security of ElGamal 1. Relation to the DL Recovering the plaintext m from an ElGamal ciphertext c is easy if the DL problem is easy. 2. ELGamal and the CDH problem For messages that are uniformly distributed, the ElGamal encryption system is secure against CPAs iff the CDA problem is hard.

40 Security of ElGamal For messages that are uniformly distributed, the ElGamal encryption system is secure against CPAs iff the CDH problem is hard.

41 Security of ElGamal


Download ppt "1 CIS 5371 Cryptography 8. Asymmetric encryption-."

Similar presentations


Ads by Google