Download presentation
Presentation is loading. Please wait.
Published bySucianty Tedjo Modified over 6 years ago
1
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Cryptography CS 555 Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
2
Recap Plain RSA Public Key (pk): N = pq, e such that GCD e,π π =1
π π = πβ1 πβ1 for distinct primes p and q Secret Key (sk): N, d such that ed=1 mod π π Encrypt(pk=(N,e),m) = π π πππ π Decrypt(sk=(N,d),c) = π π
πππ π Decryption Works because π π mod N = π ππ mod N = π [ππ πππ π π΅ ] mod N = π mod N
3
RSA-Assumption RSA-Experiment: RSA-INVA,n
Run KeyGeneration(1n) to obtain (N,e,d) Pick uniform yβ β€ N β Attacker A is given N, e, y and outputs xβ β€ N β Attacker wins (RSA-INVA,n=1) if π₯ π =y mod N βπππ π΄ βπ (negligible) s.t Pr RSAβINVA,n =1 β€π(π)
4
(Plain) RSA Discussion
We have not introduced security models like CPA-Security or CCA-security for Public Key Cryptosystems However, notice that (Plain) RSA Encryption is stateless and deterministic. ο Plain RSA is not secure against chosen-plaintext attacks Plain RSA is also highly vulnerable to chosen-ciphertext attacks Attacker intercepts ciphertext c of secret message m Attacker generates ciphertext cβ for secret message 2m Attacker asks for decryption of cβ to obtain 2m Divide by 2 to recover original message m
5
(Plain) RSA Discussion
However, notice that (Plain) RSA Encryption is stateless and deterministic. ο Plain RSA is not secure against chosen-plaintext attacks In a public key setting the attacker does have access to an encryption oracle Encrypted messages with low entropy are vulnerable to a brute-force attack. If m < B then attacker can recover m after at most B queries to encryption oracle (using public key)
6
More Weaknesses: Plain RSA with small e
(Small Messages) If me < N then we can decrypt c = me mod N directly e.g., m=c(1/e) (Partially Known Messages) If an attacker knows first 1-(1/e) bits of secret message π= π 1 ?? then he can recover m given ππ§ππ«π²π©π(ππ,π)= π π mod N Theorem[Coppersmith]: If p(x) is a polynomial of degree e then in polynomial time (in log(N), e) we can find all m such that p(m) = 0 mod N and |m|<N(1/e)
7
More Weaknesses: Plain RSA with small e
Theorem[Coppersmith]: If p(x) is a polynomial of degree e then in polynomial time (in log(N), e) we can find all m such that p(m) = 0 mod N and |m|<N(1/e) Example: e = 3, π=π1 π2 and attacker knows π1 2π πππ‘π and π= π1 π2 π mod N, but not π2 π πππ‘π π π₯ = 2 π π1+π₯ 3 βπ Polynomial has a small root mod N at x= π2 and coppersmithβs method will find it!
8
Recovering Encrypted Message faster than Brute-Force
Claim: Let m < 2n be a secret message. For some constant πΌ= 1 2 +π. We can recover m in in time π=2 πΌπ with high probability. For r=1,β¦,T let xr= π π βπ πππ π , where π βπ = π β1 π πππ π Sort π= π,ππ π=π π» (by the xr values) For s=1,β¦,T if π π πππ π =π₯π for some r then return ππ πππ π
9
Recovering Encrypted Message faster than Brute-Force
For r=1,β¦,T let xr= π π βπ πππ π , where π βπ = π β1 π πππ π Sort π= π,ππ π=π π» (by the xr values) For s=1,β¦,T if π π πππ π =π₯π for some r then return ππ πππ π Analysis: ππ πππ π = π π₯π π πππ π = π π π βπ π πππ π = π π βππ π π πππ π = π π β1 π πππ π =m
10
Recovering Encrypted Message faster than Brute-Force
For r=1,β¦,T let xr= π π βπ πππ π , where π βπ = π β1 π πππ π Sort π= π,ππ π=π π» (by the xr values) For s=1,β¦,T if π π πππ π =π₯π for some r then return ππ πππ π Fact: some constant πΌ= 1 2 +π setting π=2 πΌπ with high probability we will find a pair s and xr with π π πππ π =π₯π.
11
Recovering Encrypted Message faster than Brute-Force
Claim: Let m < 2n be a secret message. For some constant πΌ= 1 2 +π. We can recover m in in time π=2 πΌπ with high probability. Roughly π΅ steps to find a secret message m < B
12
(Recap) Finite Groups Definition: A (finite) group is a (finite) set πΎ with a binary operation β (over G) for which we have (Closure:) For all g,hβπΎ we have gβhβπΎ (Identity:) There is an element eβπΎ such that for all gβπΎ we have gβe=g=eβg (Inverses:) For each element gβπΎ we can find hβπΎ such that gβh=e. We say that h is the inverse of g. (Associativity: ) For all g1,g2,g3βπΎ we have g1βg2 βg3=g1β g2βg3 We say that the group is abelian if (Commutativity:) For all g,hβπΎ we have gβh= hβg
13
Finite Abelian Groups (Examples)
Example 1: β€ π when β denotes addition modulo N Identity: 0, since 0 β x =[0+x mod N] = [x mod N]. Inverse of x? Set x-1=N-x so that [x-1+x mod N] = [N-x+x mod N] = 0. Example 2: β€ π β when β denotes multiplication modulo N Identity: 1, since 1β x =[1(x) mod N] = [x mod N]. Inverse of x? Run extended GCD to obtain integers a and b such that ππ₯+ππ= gcd π₯,π =1 Observe that: x-1 = a. Why?
14
Cyclic Group Let πΎ be a group with order m= πΎ with a binary operation β (over G) and let gβπΎ be given consider the set π = π0,π1,π2,β¦ Fact: π defines a subgroup of πΎ. Identity: π0 Closure: ππβππ= π π+π β π g is called a βgeneratorβ of the subgroup. Fact: Let r= π then π π =ππ if and only if π=π πππ π. Also m is divisible by r.
15
Finite Abelian Groups (Examples)
Fact: Let p be a prime then β€ πβ1 β is a cyclic group of order p-1. Note: A generator g of this group must have gcd(g,p-1)=1 Example (non-generator): p=7, g=2 <2>={1,2,4} Example (generator): p=7, g=5 <2>={1,5,4,6,2,3}
16
Discrete Log Experiment DLogA,G(n)
Run G(1n) to obtain a cyclic group πΎ of order q (with π =π) and a generator g such that <g>=πΎ. Select hβπΎ uniformly at random. Attacker A is given πΎ, q, g, h and outputs integer x. Attacker wins (DLogA,G(n)=1) if and only if gx=h. We say that the discrete log problem is hard relative to generator G if βπππ π΄ βπ (negligible) s.t Pr DLogA,n =1 β€π(π)
17
Diffie-Hellman Problems
Computational Diffie-Hellman Problem (CDH) Attacker is given h1= π π₯ 1 βπΎ and h2= π π₯ 2 βπΎ. Attackers goal is to find π π₯ 1 π₯ 2 = h1 π₯ 2 = h2 π₯ 1 CDH Assumption: For all PPT A there is a negligible function negl upper bounding the probability that A succeeds Decisional Diffie-Hellman Problem (DDH) Let z0= π π₯ 1 π₯ 2 and let z1= π π , where x1,x2 and r are random Attacker is given π π₯ 1 , π π₯ 2 and π§π (for a random bit b) Attackers goal is to guess b DDH Assumption: For all PPT A there is a negligible function negl such that A succeeds with probability at most Β½ + negl(n).
18
Secure key-agreement with DDH
Alice publishes π π₯π΄ and Bob publishes π π₯π΅ Alice and Bob can both compute πΎ π΄,π΅ =π π₯π΅ π₯π΄ but to Eve this key is indistinguishable from a random group element (by DDH) Remark: Protocol is vulnerable to Man-In-The-Middle Attacks if Bob cannot validate π π₯π΄ .
19
Can we find a cyclic group where DDH holds?
Example 1: β€ π β where p is a random n-bit prime. CDH is believed to be hard DDH is *not* hard (Exercise 13.15) Theorem: πΏππ‘ p=rq+1 be a random n-bit prime where q is a large π- bit prime then the set of rth residues modulo p is a cyclic subgroup of order q. Then πΎ= [βπ πππ π] βββ€ π β is a cyclic subgroup of β€ π β of order q. Remark 1: DDH is believed to hold for such a group Remark 2: It is easy to generate uniform elements Remark 3: Any element (besides 1) is a generator of πΎ
20
Can we find a cyclic group where DDH holds?
Theorem: πΏππ‘ p=rq+1 be a random n-bit prime where q is a large π-bit prime then the set of rth residues modulo p is a cyclic subgroup of order q. Then πΎ= [βπ πππ π] βββ€ π β is a cyclic subgroup of β€ π β of order q. Closure: βπππ= βπ π Inverse of βπ is β β1 π βπΎ Size βπ π₯ = β [ππ₯ πππ ππ] = βπ π₯ =β π[π₯ πππ π] = βπ [π₯ πππ π] πππ π Remark: Two known attacks (Section 9.2). First runs in time π π =π 2 π/2 Second runs in time 2 π 3 π log π 2/3
21
Can we find a cyclic group where DDH holds?
Remark: Two known attacks (Section 9.2). First runs in time π π =π 2 π/2 Second runs in time 2 π 3 π log π 2/3 , where n is bit length of p Goal: Set π and n to balance attacks π=π 3 π log π 2/3 How to sample p=rq+1? First sample a random π-bit prime q and Repeatedly check if rq+1 is prime for a random n- π bit value r
22
Can we find a cyclic group where DDH holds?
Elliptic Curves Example: Let p be a prime (p > 3) and let A, B be constants. Consider the equation π¦2=π₯3+π΄π₯+π΅ πππ π And let πΈ β€ π = π₯,π¦ β β€ π 2 π¦2=π₯3+π΄π₯+π΅ πππ π βͺ πͺ Note: πͺ is defined to be an additive identity π₯,π¦ +πͺ= π₯,π¦ What is π₯1,π¦1 + π₯2,π¦2 ?
23
Elliptic Curve Example
ππ,ππ (x3,y3) Formally, let π= π¦1βπ¦2 π₯1βπ₯2 πππ π be the slope. Then the line passing through ππ,ππ and ππ,ππ has the equation π¦=π π₯βπ₯1 +π¦1 πππ π ππ,ππ (x3,-y3)= ππ,ππ + ππ,ππ
24
Elliptic Curve Example
ππ,ππ (x3,y3) ππ,ππ Formally, let π= π¦1βπ¦2 π₯1βπ₯2 πππ π Be the slope. Then the line passing through ππ,ππ and ππ,ππ has the equation π¦=π π₯βπ₯1 +π¦1 πππ π π π₯βπ₯1 +π¦1 2 =π₯3+π΄π₯+π΅ πππ π (x3,-y3)= ππ,ππ + ππ,ππ π₯3=[π2βπ₯1βπ₯2 πππ π] π¦3=[π π₯3βπ₯1 +π¦1 πππ π]
25
Elliptic Curve Example
ππ,ππ πͺ= ππ,ππ + ππ,ππ ππ,ππ
26
Can we find a cyclic group where DDH holds?
Elliptic Curves Example: Let p be a prime (p > 3) and let A, B be constants. Consider the equation π¦2=π₯3+π΄π₯+π΅ πππ π And let πΈ β€ π = π₯,π¦ β β€ π 2 π¦2=π₯3+π΄π₯+π΅ πππ π βͺ πͺ Fact: πΈ β€ π defines an abelian group For appropriate curves the DDH assumption is believed to hold If you make up your own curve there is a good chance it is brokenβ¦ NIST has a list of recommendations
27
Next Week: Spring Break!
Next class on Monday, March 20th. Read Katz and Lindell 8.4 DDH Applications
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.