Presentation is loading. Please wait.

Presentation is loading. Please wait.

Course Business Homework 4 Released Bonus Problems (10 Points)

Similar presentations


Presentation on theme: "Course Business Homework 4 Released Bonus Problems (10 Points)"β€” Presentation transcript:

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

25

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 β€² 𝑐 β€² ,𝑑


Download ppt "Course Business Homework 4 Released Bonus Problems (10 Points)"

Similar presentations


Ads by Google