Download presentation
Presentation is loading. Please wait.
Published byHester McCarthy Modified over 6 years ago
1
Course Business Homework 4 Released Bonus Problems (10 Points)
Second bonus problem (5 pts) is easiest to solve with Mathematica Homework 3 Grades Minimum Value 65.00 Maximum Value 100.00 Range 35.00 Average 86.59 Median 90.00 Standard Deviation 9.31
2
Cryptography CS 555 Week 12: Discrete Log Attacks + NIST Recommendations for Concrete Security Parameters Key Management Formalizing Public Key Encryption El Gamal Readings: Katz and Lindell Chapter 10 & Chapter , 11.4 Fall 2018
3
Week 12: Topic 0: Discrete Log Attacks + NIST Recommendations for Concrete Security Parameters
4
Factoring Algorithms (Summary)
Pollardβs p-1 Algorithm Works when π=ππ where (p-1) has only βsmallβ prime factors Defense: Ensure that p (resp. q) is a strong prime (p-1) has no βsmallβ prime factors. Note: A random prime is strong with high probability. Pollardβs Rho Algorithm General purpose factoring algorithm Core: Low Space Cycle Detection Time: T(N)=π 4 π polπ¦πππ(π) NaΓ―ve Algorithm takes time π π polπ¦πππ(π) to factor Quadratic Sieve Time: 2 π log π log log π = 2 π π log π (sub-exponential, but not polynomial time) Preprocessing + Linear Algebra: find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π?
5
Quadratic Sieve Algorithm
Runs in sub-exponential time 2 π log π log log π = 2 π π log π Still not polynomial time but 2 π log π is sub-exponential and grows much slower than 2 π/4 . Core Idea: Find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π
6
Quadratic Sieve Algorithm
Core Idea: Find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π (1) and π₯β Β±π¦ mod π 2 Claim: gcd(x-y,N)β π,π N=pq divides π₯ 2 β π¦ 2 = π₯βπ¦ π₯+π¦ . (by (1)). π₯βπ¦ π₯+π¦ β 0 (by (2)). N does not divide π₯βπ¦ (by (2)). N does not divide π₯+π¦ . (by (2)). p is a factor of exactly one of the terms π₯βπ¦ and π₯+π¦ . (q is a factor of the other term)
7
Quadratic Sieve Algorithm
Core Idea: Find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π Key Question: How to find such an x,yβ β€ π β ? Step 1: (Initialize j=0 ); For x= π +1, π +2,β¦, π +π,β¦ qβ π +π 2 πππ π = 2π π +π2 πππ π Check if q is B-smooth (all prime factors of q are in {p1,β¦,pk} where pk < B). If q is B smooth then factor q, increment j and define qjβπ= π=1 π π π π π,π , and xjβπ₯
8
Quadratic Sieve Algorithm
Example: π΅β 2 π ln π ππ π<π π ππ π΅βπππππ‘β β π/ ln π β π/ ln π Time Between Increments: π ln π π ln π < 2 π ln π Quadratic Sieve Algorithm Core Idea: Find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π Key Question: How to find such an x,yβ β€ π β ? Step 1: (Initialize j=0 ); For x= π +1, π +2,β¦, π +π,β¦ qβ π +π 2 πππ π = 2π π +π2 πππ π Check if q is B-smooth (all prime factors of q are in {p1,β¦,pk} where pk < B). If q is B smooth then factor q, increment j and define qjβπ= π=1 π π π π π,π , and xjβπ₯
9
Quadratic Sieve Algorithm
Example: π΅β 2 π ln π Time Per Equation: 2 π ln π Total Time: π΅ 2 π ln π < 2 2 π ln π Core Idea: Find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π Key Question: How to find such an x,yβ β€ π β ? Step 2: Once we have β>π equations of the form qjβπ= π=1 π π π π π,π , We can use linear algebra to find subset S such that for each πβ€π we have πβπ π π,π =0 πππ 2.
10
Quadratic Sieve Algorithm
Key Question: How to find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π? Step 2: Once we have β>π equations of the form qjβπ= π=1 π π π π π,π , We can use linear algebra to find a subset S such that for each iβ€k we have πβπ π π,π =0 πππ 2. Thus, πβπ qj = π=1 π π π πβπ π π,π = π=1 π π π πβπ π π,π =π¦2
11
Quadratic Sieve Algorithm
Key Question: How to find x,yβ β€ π β such that π₯ 2 = π¦ 2 mod π and π₯β Β±π¦ mod π? Thus, πβπ qj = π=1 π π π πβπ π π,π = π=1 π π π πβπ π π,π =π¦2 But we also have πβπ qj = πβπ π₯π2 = πβπ π₯π 2 =π₯2 πππ π
12
Quadratic Sieve Algorithm (Summary)
Appropriate parameter tuning yields sub-exponential time algorithm 2 π log π log log π = 2 π π log π Still not polynomial time but 2 π log π grows much slower than 2 π/4 .
13
Discrete Log Attacks Pohlig-Hellman Algorithm
Given a cyclic group πΎ of non-prime order q=| πΎ |=rp Reduce discrete log problem to discrete problem(s) for subgroup(s) of order p (or smaller). Preference for prime order subgroups in cryptography Baby-step/Giant-Step Algorithm Solve discrete logarithm in time π π ππππ¦πππ(π) Pollardβs Rho Algorithm Bonus: Constant memory! Index Calculus Algorithm Similar to quadratic sieve Runs in sub-exponential time 2 π log π log log π Specific to the group β€ π β (e.g., attack doesnβt work against elliptic-curve groups)
14
Discrete Log Attacks Pohlig-Hellman Algorithm
Given a cyclic group πΎ of non-prime order q=| πΎ |=rp Reduce discrete log problem to discrete problem(s) for subgroup(s) of order p (or smaller). Preference for prime order subgroups in cryptography Let πΎ= π and h= π π₯ βπΎ be given. For simplicity assume that r is prime and r < p. Observe that ππ generates a subgroup of size p and that hrβ ππ . Solve discrete log problem in subgroup ππ with input hr. Find z such that hr=πππ§ο ππ§=ππ₯ mod p. Observe that ππ generates a subgroup of size r and that hpβ ππ . Solve discrete log problem in subgroup ππ with input hp. Find y such that hp=ππ¦πο pπ§=ππ₯ mod r. Chinese Remainder Theorem h= π π₯ where xβ π§ mod π , [π¦ mod π]
15
Discrete Log Attacks Baby-step/Giant-Step Algorithm
Solve discrete logarithm in time π π ππππ¦πππ(π) Requires memory π π ππππ¦πππ(π) Pollardβs Rho Algorithm Bonus: Constant memory! Key Idea: Low-Space Birthday Attack (*) using our collision resistant hash function π» π,β π₯ 1 , π₯ 2 = π π₯ 1 β π₯ 2 π» π,β π¦ 1 , π¦ 2 = π» π,β π₯ 1 , π₯ 2 β β π¦ 2 β π₯ 2 = π π₯ 1 β π¦ 1 ββ= π π₯ 1 β π¦ π¦ 2 β π₯ 2 β1 (*) A few small technical details to address
16
Discrete Log Attacks Baby-step/Giant-Step Algorithm
Remark: We used discrete-log problem to construct collision resistant hash functions. Security Reduction showed that attack on collision resistant hash function yields attack on discrete log. ο Generic attack on collision resistant hash functions (e.g., low space birthday attack) yields generic attack on discrete log. Baby-step/Giant-Step Algorithm Solve discrete logarithm in time π π ππππ¦πππ(π) Requires memory π π ππππ¦πππ(π) Pollardβs Rho Algorithm Bonus: Constant memory! Key Idea: Low-Space Birthday Attack (*) π» π,β π₯ 1 , π₯ 2 = π π₯ 1 β π₯ 2 π» π,β π¦ 1 , π¦ 2 = π» π,β π₯ 1 , π₯ 2 β β π¦ 2 β π₯ 2 = π π₯ 1 β π¦ 1 ββ= π π₯ 1 β π¦ π¦ 2 β π₯ 2 β1 (*) A few small technical details to address
17
Discrete Log Attacks Index Calculus Algorithm
Similar to quadratic sieve Runs in sub-exponential time 2 π log π log log π Specific to the group β€ π β (e.g., attack doesnβt work elliptic-curves) As before let {p1,β¦,pk} denote the set of prime numbers < B. Step 1.A: Find β>π distinct values π₯ 1 ,β¦, π₯ π such that π π = π π₯ π πππ π is B-smooth for each j. That is π π = π=1 π π π π π,π .
18
Discrete Log Attacks As before let {p1,β¦,pk} be set of prime numbers < B. Step 1.A: Find β>π distinct values π₯ 1 ,β¦, π₯ π such that π π = π π₯ π πππ π is B-smooth for each j. That is π π = π=1 π π π π π,π . Step 1.B: Use linear algebra to solve the equations π₯ π = π=1 π π₯π¨π π π© π’ Γπ π,π mod (πβ1). (Note: the π₯π¨π π π© π’ βs are the unknowns)
19
Discrete Log As before let {p1,β¦,pk} be set of prime numbers < B.
Step 1 (precomputation): Obtain y1,β¦,yk such that pi= π π¦ π πππ π. Step 2: Given discrete log challenge h=gx mod p. Find z such that π π§ h mod p is B-smooth π π§ h mod p = π=1 π π π π π = π=1 π π π¦ π π π = π π π π π¦ π
20
Discrete Log π π§ h mod p = π π π π π¦ π ββ= π π π π π¦ π βπ§
As before let {p1,β¦,pk} be set of prime numbers < B. Step 1 (precomputation): Obtain y1,β¦,yk such that pi= π π¦ π πππ π. Step 2: Given discrete log challenge h=gx mod p. Find z such that π π§ h mod p is B-smooth π π§ h mod p = π π π π π¦ π ββ= π π π π π¦ π βπ§ βπ₯= π π π π¦ π βπ§ Remark: Precomputation costs can be amortized over many discrete log instances In practice, the same group πΎ= π and generator g are used repeatedly. Reference:
21
NIST Guidelines (Concrete Security)
Best known attack against 1024 bit RSA takes time (approximately) 280
22
NIST Guidelines (Concrete Security)
Diffie-Hellman uses subgroup of β€ π β size q q=224 bits q=256 bits q=384 bits q=512 bits
23
NIST Guidelines (Concrete Security)
112 bits= log = log bits (Pollardβs Rho) q=224 bits q=256 bits q=384 bits q=512 bits
24
NIST Guidelines (Concrete Security)
112 bitsβ log bits (Index Calculus) q=224 bits q=256 bits q=384 bits q=512 bits
26
Week 12: Topic 1: Key Management
27
Key-Exchange Problem Key-Exchange Problem:
Obi-Wan and Yoda want to communicate securely Suppose that Obi-Wan and Yoda donβt have time to meet privately and generate one Obi-Wan and Yoda share a symmetric key with Anakin Suppose that they fully trust Anakin
28
Key-Distribution Center (with Symmetric Key-Crypto)
Enc(Kobiwan ,βI would like to talk to Yodaβ) Ok, here is a fresh key that no sith lord has seen c1=Enc(Kobiwan ,ts, Knew), c2=Enc(Kyoda , ts, βObiwan/Yodaβ, Knew) Kobiwan: Shared key between Obiwan and Anakin Kyoda: Shared key between yoda and Anakin
29
Key-Distribution Center (with Symmetric Key-Crypto)
Enc(Kobiwan ,βI would like to talk to Yodaβ) Ok, here is a fresh key that no sith lord has seen c1=Enc(Kobiwan ,ts, Knew), c2=Enc(Kyoda , ts, βObiwan/Yodaβ, Knew) Enc(Knew, βIts me, Obiwan, letβs talkβ) c2=Enc(Kyoda ,ts, βObiwan/Yodaβ, Knew)
30
Key-Distribution Center (with Symmetric Key-Crypto)
Vulnerability: If Key-Distribution Center is compromised then all security guarantees are broken. KDC is a valuable target for attackers Possibility of insider attacks (e.g., employees) Denial of Service (DOS) Attack: If KDC is down then secure communication is temporarily impossible.
31
Key-Distribution Center (with Symmetric Key-Crypto)
Benefit: Authenticated Encryption provides authentication as well Yoda can be sure he is talking to Obiwan (assuming he trusts the KDC) Kerberos uses similar protocol Yodaβs key and Obiwanβs key are typically derived from a password that they know. Vulnerability: An eavesdropping attacker can mount a brute-force attack on the (low-entropy) passwords to recover Kyoda and Kobiwan. Recommendation: Always use Public Key Initialization with Kerberos
32
Key-Explosion Problem
To avoid use a trusted KDC we could have every pair of users exchange private keys How many private keys per person? Answer: n-1 Need to meet up with n-1 different users in person! Key Explosion Problem n can get very big if you are Google or Amazon!
33
Diffie-Hellman Key Exchange
Alice picks π₯π΄ and sends π π₯π΄ to Bob Bob picks π₯π΅ and sends π π₯π΅ to Alice Alice and Bob can both compute πΎ π΄,π΅ =π π₯π΅ π₯π΄
34
Diffie-Hellman Key Exchange
Alice picks π₯π΄ and sends π π₯π΄ to Bob Bob picks π₯π΅ and sends π π₯π΅ to Alice Alice and Bob can both compute πΎ π΄,π΅ =π π₯π΅ π₯π΄ Intuition: Decisional Diffie-Hellman assumption implies that a passive attacker who observes π π₯π΄ and π π₯π΅ still cannot distinguish between πΎ π΄,π΅ =π π₯π΅ π₯π΄ and a random group element.
35
Diffie-Hellman Key Exchange
Alice picks π₯π΄ and sends π π₯π΄ to Bob Bob picks π₯π΅ and sends π π₯π΅ to Alice Alice and Bob can both compute πΎ π΄,π΅ =π π₯π΅ π₯π΄ Intuition: Decisional Diffie-Hellman assumption implies that a passive attacker who observes π π₯π΄ and π π₯π΅ still cannot distinguish between πΎ π΄,π΅ =π π₯π΅ π₯π΄ and a random group element. Remark: The protocol is vulnerable against active attackers who can tamper with messages.
36
Man in the Middle Attack (MITM)
37
Man in the Middle Attack (MITM)
Alice picks π₯π΄ and sends π π₯π΄ to Bob Eve intercepts π π₯π΄ , picks π₯πΈ and sends π π₯πΈ to Bob instead Bob picks π₯π΅ and sends π π₯π΅ to Alice Eve intercepts π π₯π΅ , picks π₯πΈβ² and sends π π₯πΈβ² to Alice instead Eve computes π π₯πΈβ²π₯π΄ and π π₯πΈπ₯π΅ Alice computes secret key π π₯πΈβ²π₯π΄ (shared with Eve not Bob) Bob computes π π₯πΈπ₯π΅ (shared with Eve not Alice) Eve forwards messages between Alice and Bob (tampering with the messages if desired) Neither Alice nor Bob can detect the attack
38
Key-Explosion Problem
So far neither Diffie-Hellman Key Exchange nor PAKEs completely solved the problem PAKEs require a shared password (n-1) shared passwords? Diffie-Hellman Key Exchange is vulnerable to man-in-the-middle Can use KDC to store database of public-keys (e.g., π π₯π΄ ) for each party. Breached KDC doesnβt reveal secret keys
39
Public Key Revolution Digital Signatures can help
Private-Key Analogue: MAC Private Key required to produce signature for a message m Anyone with Public Key can verify the message An authority could sign the message βAliceβs public key is π π₯π΄ β Anyone could use the authorityβs public key to validate Aliceβs public key The authority does not actually need to store π π₯π΄ . In fact, if Alice has signature then she can use this to prove her identity to Bob (and Bob doesnβt need to interact the authority)
40
Distributed Web of Trust
41
Week 12 Topic 2: Formalizing Public Key Cryptography
42
Public Key Encryption: Basic Terminology
Plaintext/Plaintext Space A message mββ³ Ciphertext cβπ Public/Private Key Pair ππ,ππ βπ
43
Public Key Encryption Syntax
Three Algorithms Gen ( 1 π ,π
) (Key-generation algorithm) Input: Random Bits R Output: ππ,ππ βπ Encpk (π) βπ (Encryption algorithm) Decsk (π) (Decryption algorithm) Input: Secret key sk and a ciphertex c Output: a plaintext message mββ³ Invariant: Decsk(Encpk(m))=m Alice must run key generation algorithm in advance an publishes the public key: pk Assumption: Adversary only gets to see pk (not sk)
44
Chosen-Plaintext Attacks
Model ability of adversary to control or influence what the honest parties encrypt. Historical Example: Battle of Midway (WWII). US Navy cryptanalysts were able to break Japanese code by tricking Japanese navy into encrypting a particular message Private Key Cryptography Batle of Midway. In May 1942, US Navy cryptanal
45
Recap CPA-Security (Symmetric Key Crypto)
c1 = EncK(mb,1) m0,2,m1,2 c2 = EncK(mb,2) m0,3,m1,3 c3 = EncK(mb,3) β¦ βπππ π΄ βπ (negligible) s.t Pr π΄ πΊπ’ππ π ππ π β² =π β€ 1 2 +π(π) bβ Random bit b K = Gen(.)
46
Chosen-Plaintext Attacks
Model ability of adversary to control or influence what the honest parties encrypt. Private Key Crypto Attacker tricks victim into encrypting particular messages Public Key Cryptography The attacker already has the public key pk Can encrypt any message s/he wants! CPA Security is critical! Batle of Midway. In May 1942, US Navy cryptanal
47
CPA-Security ( PubK A,Ξ LRβcpa n )
Public Key: pk π 0 1 , π 1 1 π π = ππ§π ππ π π π π 0 2 , π 1 2 π π = ππ§π ππ π π π π 0 3 , π 1 3 π π = ππ§π ππ π π π βπππ π΄ βπ (negligible) s.t Pr PubK A,Ξ LRβcpa n =1 β€ 1 2 +π(π) β¦ bβ Random bit b (pk,sk) = Gen(.)
48
CPA-Security (Single Message)
m0,m1 πΉπππππππ¦, πππ‘ Ξ = πΊππ,πΈππ,π·ππ πππππ‘π π‘βπ πππππ¦ππ‘πππ π πβπππ, ππππ π‘βπ ππ₯ππππππππ‘ ππ’ππΎ π΄,Ξ πΏπ
βπππ π πππ ππππππ π ππππππ π£πππππππ PubK A,Ξ LRβcpa π = 1 if π= π β² 0 ππ‘βπππ€ππ π Ξ βππ πππππ π‘ππππ’ππ βππππ πππππ¦ππ‘ππππ π’ππππ π πβππ ππ ππππππ‘ππ₯π‘ ππ‘π‘πππ ππ πππ πππ πππ πππ£πππ πππππ π΄, π‘βπππ ππ π negligible function π such that Pr[ PubK A,Ξ LRβcpa π =1] β€ 1 2 +π(π) c = EncK(mb) m2 c2 = EncK(m2) m3 c3 = EncK(m3) β¦ βπππ π΄ βπ (negligible) s.t Pr π΄ πΊπ’ππ π ππ π β² =π β€ 1 2 +π(π) bβ Random bit b K = Gen(.)
49
Private Key Crypto EncK(m)=G(K)β¨π Vs. EncK(m)= π, πΉ π π β¨π
CPA Security was stronger than eavesdropping security EncK(m)=G(K)β¨π Vs. EncK(m)= π, πΉ π π β¨π
50
Public Key Crypto Fact 1: CPA Security and Eavesdropping Security are Equivalent Key Insight: The attacker has the public key so he doesnβt gain anything from being able to query the encryption oracle! Fact 2: Any deterministic encryption scheme is not CPA-Secure Historically overlooked in many real world public key crypto systems Fact 3: Plain RSA is not CPA-Secure Fact 4: No Public Key Cryptosystem can achieve Perfect Secrecy! Exercise 11.1 Hint: Unbounded attacker can keep encrypting the message m using the public key to recover all possible encryptions of m.
51
Encrypting Longer Messages
Claim 11.7: Let Ξ = πΊππ,πΈππ,π·ππ denote a CPA-Secure public key encryption scheme and let Ξ β²= πΊππ,πΈππβ²,π·ππβ² be defined such that ππ§π π©π€ β² π π β₯ π π β₯β¦β₯ π β = ππ§π π©π€ π π β₯β¦β₯ ππ§π π©π€ π β Then Ξ β² is also CPA-Secure.
52
Chosen Ciphertext Attacks
Models ability of attacker to obtain (partial) decryption of selected ciphertexts Attacker might intercept ciphertext c (sent from S to R) and send cβ instead. After that attacker can observe receiverβs behavior (abort, reply etcβ¦) Attacker might send a modified ciphertext cβ to receiver R in his own name. response: Receiver might decrypt cβ to obtain mβ and include mβ in the response to the attacker
53
Recap CCA-Security (Symmetric Key Crypto)
We could set m0 = m-1 or m1 = m-2 m-1 c-1 = EncK(m-1) c-2 m-2 = DecK(c-2) β¦ m0,m1 However, we could still flip 1 bit of c and ask challenger to decrypt c = EncK(mb) m3 c2 = EncK(m2) Random bit b K = Gen(.) c3 m3 = DecK(m3) c4 =c β¦ βNo Way!β bβ
54
Recap CCA-Security ππππ£πΎ π΄,Ξ πππ π
Challenger generates a secret key k and a bit b Adversary (A) is given oracle access to Enck and Deck Adversary outputs m0,m1 Challenger sends the adversary c=Enck(mb). Adversary maintains oracle access to Enck and Deck ,however the adversary is not allowed to query Deck(c). Eventually, Adversary outputs bβ. ππππ£πΎ π΄,Ξ πππ π =1 if b= b β² ;otherwise 0. CCA-Security: For all PPT A exists a negligible function negl(n) s.t. Pr ππππ£πΎ π΄,Ξ πππ π =1 β€ 1 2 +ππππ(π)
55
CCA-Security ( PubK A,Ξ cca n )
Public Key: pk π βπ π βπ = πππ ππ π βπ β¦ π 0 , π 1 π π = ππ§π ππ π π π π βπππ π΄ βπ (negligible) s.t Pr PubK A,Ξ cca n =1 β€ 1 2 +π(π) π π = πππ ππ π π β¦ bβ Random bit b (pk,sk) = Gen(.)
56
Encrypting Longer Messages
Claim 11.7: Let Ξ = πΊππ,πΈππ,π·ππ denote a CPA-Secure public key encryption scheme and let Ξ β²= πΊππ,πΈππβ²,π·ππβ² be defined such that ππ§π π©π€ β² π π β₯ π π β₯β¦β₯ π β = ππ§π π©π€ π π β₯β¦β₯ ππ§π π©π€ π β Then Ξ β² is also CPA-Secure. Claim? Let Ξ = πΊππ,πΈππ,π·ππ denote a CCA-Secure public key encryption scheme and let Ξ β²= πΊππ,πΈππβ²,π·ππβ² be defined such that Then Ξ β² is also CCA-Secure. Is this second claim true?
57
Encrypting Longer Messages
Claim? Let Ξ = πΊππ,πΈππ,π·ππ denote a CCA-Secure public key encryption scheme and let Ξ β²= πΊππ,πΈππβ²,π·ππβ² be defined such that ππ§π π©π€ β² π π β₯ π π β₯β¦β₯ π β = ππ§π π©π€ π π β₯β¦β₯ ππ§π π©π€ π β Then Ξ β² is also CCA-Secure. Is this second claim true? Answer: No!
58
Encrypting Longer Messages
Fact: Let Ξ = πΊππ,πΈππ,π·ππ denote a CCA-Secure public key encryption scheme and let Ξ β²= πΊππ,πΈππβ²,π·ππβ² be defined such that ππ§π π©π€ β² π π β₯ π π β₯β¦β₯ π β = ππ§π π©π€ π π β₯β¦β₯ ππ§π π©π€ π β Then Ξ β² is Provably Not CCA-Secure. Attacker sets π π =ππβ₯ππ β₯ππ and π π =ππβ₯ππβ₯ ππ and gets π π = ππ§π π©π€ β² π π = π π,π β₯ π π,π β₯ π π,π Attacker sets πβ²= π π,π β₯ π π,π β₯ π π,π , queries the decryption oracle and gets πππ π¬π€ β² πβ² = ππ β₯ππβ₯ππ if b=π ππβ₯ππβ₯ππ πππππππππ
59
Achieving CPA and CCA-Security
Plain RSA is not CPA Secure (therefore, not CCA-Secure) El-Gamal (next class) is CPA-Secure, but not CCA-Secure Homework 4 Tools to obtain CCA-Security in Public Key Setting RSA-OAEP, Cramer-Shoup Key Encapsulation Mechanism
60
Key Encapsulation Mechanism (KEM)
Three Algorithms Gen ( 1 π ,π
) (Key-generation algorithm) Input: Random Bits R Output: ππ,ππ βπ Encapspk ( 1 π ,π
) Input: security parameter, random bits R Output: Symmetric key kβ 0,1 β π and a ciphertext c Decapssk (π) (Deterministic algorithm) Input: Secret key skβπ¦ and a ciphertex c Output: a symmetric key 0,1 β π or β₯ (fail) Invariant: Decapssk(c)=k whenever (c,k) = Encapspk( 1 π ,π
)
61
KEM CCA-Security ( KEM A,Ξ cca n )
ππ,π, π π β¦ π π β π πππππ©π¬ ππ π π π π β π βπππ π΄ βπ (negligible) s.t Pr KEM A,Ξ cca =1 β€ 1 2 +π(π) πππππ©π¬ ππ π π β¦ bβ Random bit b (pk,sk) = Gen(.) π,ππ = ππ§πππ©π¬ ππ . ππ β΅ π,π π
62
CCA-Secure Encryption from CCA-Secure KEM
ππ§π π©π€ π;πΉ = π, ππ§π π€ β π Where π,π β ππ§πππ©π¬ π©π€ π π ;πΉ , ππ§π π€ β is a CCA-Secure symmetric key encryption algorithm, and ππ§πππ©π¬ π©π€ is a CCA-Secure KEM. Theorem 11.14: ππ§π π©π€ is CCA-Secure public key encryption scheme.
63
CCA-Secure KEM in the Random Oracle Model
Let (N,e,d) be an RSA key (pk =(N,e), sk=(N,d)). Encapspk 1 π ,π
= π π πππ π, π=π» π Remark 1: k is completely random string unless the adversary can query random oracle H on input r. Remark 2: If Plain-RSA is hard to invert for a random input then PPT attacker finds r with negligible probability.
64
Week 12 Topic 3: El-Gamal Encryption
65
A Quick Remark about Groups
Let πΎ be a group with order m= πΎ with a binary operation β (over G) and let g,hβπΎ be given and consider sampling kβπΎ uniformly at random then we have Pr kβπΎ π=π = 1 π Question: What is Pr kβπΎ πββ=π = 1 π ? Answer: Pr kβπΎ πββ=π = Pr kβπΎ π=πβ β β1 = 1 π
66
A Quick Remark about Groups
Lemma 11.15: Let πΎ be a group with order m= πΎ with a binary operation β (over G) then for any pair g,hβπΎ we have Pr kβπΎ πββ=π = 1 π Remark: This lemma gives us a way to construct perfectly secret private-key crypto scheme. How?
67
El-Gamal Encryption Key Generation (Gen( 1 π )):
Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =π) and a generator g such that <g>=πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encpk (π) = π π¦ ,πβ β π¦ for a random yβ β€ π Decsk (π= π 1 , π 2 ) = π 2 π 1 βπ₯
68
El-Gamal Encryption Encpk (π) = π π¦ ,πβ β π¦ for a random yβ β€ π
Decsk (π= π 1 , π 2 ) = π 2 π 1 βπ₯ Decsk ( π π¦ ,πβ β π¦ ) =πβ β π¦ π π¦ βπ₯ =πβ β π¦ π π¦ βπ₯ =πβ π π₯ π¦ π π¦ βπ₯ =πβ π π₯π¦ π βπ₯π¦ =π
69
CPA-Security ( PubK A,Ξ LRβcpa n )
Public Key: pk π 0 1 , π 1 1 π π = ππ§π ππ π π π π 0 2 , π 1 2 π π = ππ§π ππ π π π π 0 3 , π 1 3 π π = ππ§π ππ π π π βπππ π΄ βπ (negligible) s.t Pr PubK A,Ξ LRβcpa n =1 β€ 1 2 +π(π) β¦ bβ Random bit b (pk,sk) = Gen(.)
70
El-Gamal Encryption Encpk (π) = π π¦ ,πβ β π¦ for a random yβ β€ π
Decsk (π= π 1 , π 2 ) = π 2 π 1 βπ₯ Theorem 11.18: Let Ξ = πΊππ,πΈππ,π·ππ be the El-Gamal Encryption scheme (above) then if DDH is hard relative to π’ then Ξ is CPA-Secure. Proof: Recall that CPA-security and eavesdropping security are equivalent for public key crypto. It suffices to show that for all PPT A there is a negligible function negl such that Pr PubK A,Ξ eav n =1 β€ 1 2 +negl(n)
71
Eavesdropping Security ( PubK A,Ξ eav n )
Public Key: pk π 0 , π 1 π π = ππ§π ππ π π bβ βπππ π΄ βπ (negligible) s.t Pr PubK A,Ξ eav n =1 β€ 1 2 +π(π) Random bit b (pk,sk) = Gen(.)
72
El-Gamal Encryption Theorem 11.18: Let Ξ = πΊππ,πΈππ,π·ππ be the El-Gamal Encryption scheme (above) then if DDH is hard relative to π’ then Ξ is CPA-Secure. Proof: First introduce an `encryption schemeβ Ξ in which Encpk π = π π¦ ,πβ π π§ for random y,zβ β€ π (there is actually no way to do decryption, but the experiment PubK A, Ξ eav n is still well defined). In fact, (using Lemma 11.15) Pr PubK A, Ξ eav n =1 = 1 2 Pr PubK A, Ξ eav n =1 π= βPr PubK A, Ξ eav n =1 π=0 = Pr y,zβ β€ π π΄ π π¦ ,πβ π π§ =1 β 1 2 Pr y,zβ β€ π π΄ π π¦ , π π§ =1 = 1 2
73
El-Gamal Encryption Theorem 11.18: Let Ξ = πΊππ,πΈππ,π·ππ be the El-Gamal Encryption scheme (above) then if DDH is hard relative to π’ then Ξ is CPA-Secure. Proof: We just showed that Pr PubK A, Ξ eav n =1 = 1 2 Therefore, it suffices to show that Pr PubK A,Ξ eav n =1 βPr PubK A, Ξ eav n =1 β€π§ππ π₯(π) This, will follow from DDH assumption.
74
El-Gamal Encryption Theorem 11.18: Let Ξ = πΊππ,πΈππ,π·ππ be the El-Gamal Encryption scheme (above) then if DDH is hard relative to π’ then Ξ is CPA-Secure. Proof: We can build π΅ π π₯ , π π¦ ,π to break DDH assumption if Ξ is not CPA-Secure. Simulate eavesdropping attacker A Send attacker public key pk= πΎ,π,π,β= π π₯ Receive m0,m1 from A. Send A the ciphertext π π¦ , π π βπ . Output 1 if and only if attacker outputs bβ=b. Pr π΅ π π₯ , π π¦ ,π =1 π= π π₯π¦ βPr π΅ π π₯ , π π¦ ,π =1 π= π π§ = Pr PubK A,Ξ eav n =1 βPr PubK A, Ξ eav n =1 = Pr PubK A,Ξ eav n =1 β 1 2 = Pr yβ β€ π π΄ π π₯ , π π¦ , π π β π π₯π¦ =1 β Pr y,zβ β€ π π΄ π π₯ , π π¦ , π π β π π§ =1 = Pr yβ β€ π π΄ β, π π¦ , π π β β π§ =1 β Pr y,zβ β€ π π΄ β, π π¦ , π π β π π§ =1
75
El-Gamal Encryption Encpk (π) = π π¦ ,πβ β π¦ for a random yβ β€ π and β=π π₯ , Decsk (π= π 1 , π 2 ) = π 2 π 1 βπ₯ Fact: El-Gamal Encryption is malleable. c=Encpk (π) = π π¦ ,πβ β π¦ cβ²=Encpk (π) = π π¦ ,2βπβ β π¦ Decsk (πβ²) =2βπβ β π¦ β π βπ₯π¦ =2π
76
Key Encapsulation Mechanism (KEM)
Three Algorithms Gen ( 1 π ,π
) (Key-generation algorithm) Input: Random Bits R Output: ππ,ππ βπ Encapspk ( 1 π ,π
) Input: security parameter, random bits R Output: Symmetric key kβ 0,1 β π and a ciphertext c Decapssk (π) (Deterministic algorithm) Input: Secret key skβπ¦ and a ciphertex c Output: a symmetric key 0,1 β π or β₯ (fail) Invariant: Decapssk(c)=k whenever (c,k) = Encapspk( 1 π ,π
)
77
KEM CCA-Security ( KEM A,Ξ cca n )
ππ,π,ππ β¦ π π β π πππππ©π¬ ππ π π π π β π βπππ π΄ βπ (negligible) s.t Pr KEM A,Ξ cca =1 β€ 1 2 +π(π) πππππ©π¬ ππ π π β¦ bβ Random bit b (pk,sk) = Gen(.) π,ππ = ππ§πππ©π¬ ππ . ππ β΅ π,π π
78
Recall: Last Lecture CCA-Secure KEM from RSA in Random Oracle Model
What if we want security proof in the standard model? Answer: DDH yields a CPA-Secure KEM in standard model
79
KEM CPA-Security ( KEM A,Ξ cpa n )
ππ,π,ππ bβ βπππ π΄ βπ (negligible) s.t Pr KEM A,Ξ cpa =1 β€ 1 2 +π(π) Random bit b (pk,sk) = Gen(.) π,ππ = ππ§πππ©π¬ ππ . ππ β΅ π,π π
80
CCA-Secure Encryption from CPA-Secure KEM
ππ§π π©π€ π;πΉ = π, ππ§π π€ β π Where π,π β ππ§πππ©π¬ π©π€ π π ;πΉ , ππ§π π€ β is a eavesdropping-secure symmetric key encryption algorithm ππ§πππ©π¬ π©π€ is a CPA-Secure KEM. Theorem 11.12: ππ§π π©π€ is CCA-Secure public key encryption scheme.
81
CPA-Secure KEM with El-Gamal
Gen ( 1 π ,π
) (Key-generation algorithm) Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =2π) and a generator g such that <g>=πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encapspk ( 1 π ,π
) Pick random yβ β€ π Output: π π¦ ,π=LeastSigNBits β π¦ Decapssk (π) (Deterministic algorithm) Output: π=LeastSigNBits π π₯
82
CPA-Secure KEM with El-Gamal
Gen ( 1 π ,π
) (Key-generation algorithm) Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =2π) and a generator g such that <g>= πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encapspk ( 1 π ,π
) Pick random yβ β€ π Output: π π¦ ,π=LeastSigNBits β π¦ Decapssk (π) (Deterministic algorithm) Output: π=LeastSigNBits π π₯ Decapssk π π¦ =LeastSigNBits π π₯π¦ =LeastSigNBits β π¦ =π
83
CPA-Secure KEM with El-Gamal
Gen ( 1 π ,π
) (Key-generation algorithm) Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =2π) and a generator g such that <g>=πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encapspk ( 1 π ,π
) Pick random yβ β€ π Output: π π¦ ,π=LeastSigNBits β π¦ Decapssk (π) (Deterministic algorithm) Output: π=LeastSigNBits π π₯ Theorem 11.20: If DDH is hard relative to π’ then (Gen,Encaps,Decaps) is a CPA-Secure KEM
84
CPA-Secure KEM with El-Gamal
Gen ( 1 π ,π
) (Key-generation algorithm) Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =2π) and a generator g such that <g>=πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encapspk ( 1 π ,π
) Pick random yβ β€ π Output: π π¦ ,π=LeastSigNBits β π¦ Decapssk (π) (Deterministic algorithm) Output: π=LeastSigNBits π π₯ Remark: If CDH is hard relative to π’ then (Gen,Encaps,Decaps) and we replace LeastSigNBits with a random oracle H then this is a CPA-Secure KEM (β¦also CCA-secure under a slightly stronger assumption called gap-CDH)
85
CCA-Secure Variant in Random Oracle Model
Key Generation (Gen( 1 π )): Run π’ 1 π to obtain a cyclic group πΎ of order q (with π =π) and a generator g such that <g>=πΎ. Choose a random xβ β€ π and set β= π π₯ Public Key: pk= πΎ,π,π,β Private Key: sk= πΎ,π,π,π₯ Encpk (π) = π π¦ , π β² , πππ πΎ π πβ² for a random yβ β€ π and πΎ πΈ πΎ π =π» β π¦ and π β² =Enc K E β² π Decsk ( π, π β² ,π‘ ) πΎ πΈ πΎ π =π» π π₯ If Vrfy K M π β² ,π‘ β 1 or πβπΎ output β₯; otherwise output Dec K E β² π β² ,π‘
86
CCA-Secure Variant in Random Oracle Model
Theorem: If Enc K E β² is CPA-secure, Mac K M is a strong MAC and a problem called gap-CDH is hard then this a CCA-secure public key encryption scheme in the random oracle model. Encpk (π) = π π¦ , π β² , Mac K M πβ² for a random yβ β€ π and πΎ πΈ πΎ π = π» β π¦ and π β² =Enc K E β² π Decsk ( π, π β² ,π‘ ) πΎ πΈ πΎ π =π» π π₯ If Vrfy K M π β² ,π‘ β 1 or πβπΎ output β₯; otherwise output Dec K E β² π β² ,π‘
87
CCA-Secure Variant in Random Oracle Model
Remark: The CCA-Secure variant is used in practice in the ISO/IEC standard for public-key encryption. Diffie-Hellman Integrated Encryption Scheme (DHIES) Elliptic Curve Integrated Encryption Scheme (ECIES) Encpk (π) = π π¦ , π β² , Mac K M πβ² for a random yβ β€ π and πΎ πΈ πΎ π = π» β π¦ and π β² =Enc K E β² π Decsk ( π, π β² ,π‘ ) πΎ πΈ πΎ π =π» π π₯ If Vrfy K M π β² ,π‘ β 1 or πβπΎ output β₯; otherwise output Dec K E β² π β² ,π‘
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.