Topic 30: El-Gamal Encryption

Slides:



Advertisements
Similar presentations
ElGamal Security Public key encryption from Diffie-Hellman
Advertisements

Probabilistic Public Key Encryption with Equality Test Duncan S. Wong Department of Computer Science City University of Hong Kong Joint work with Guomin.
Dan Boneh Public key encryption from Diffie-Hellman ElGamal Variants With Better Security Online Cryptography Course Dan Boneh.
CS555Topic 191 Cryptography CS 555 Topic 19: Formalization of Public Key Encrpytion.
Cryptography Lecture 9 Arpita Patra.
Cramer & Shoup Encryption Cramer and Shoup: A practical public key crypto system provably secure against adaptive chosen ciphertext attack. Crypto 1998.
7. Asymmetric encryption-
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Asymmetric Cryptography part 1 & 2 Haya Shulman Many thanks to Amir Herzberg who donated some of the slides from
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
CS555Spring 2012/Topic 41 Cryptography CS 555 Topic 4: Computational Approach to Cryptography.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
CS555Topic 211 Cryptography CS 555 Topic 21: Digital Schemes (1)
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2014 Nitesh Saxena.
Cryptography Lecture 8 Stefan Dziembowski
Cryptography Lecture 10 Arpita Patra. Quick Recall and Today’s Roadmap >> CPA & CPA-mult security >> Equivalence of CPA and CPA-mult security >> El Gamal.
Lecture 3.4: Public Key Cryptography IV CS 436/636/736 Spring 2013 Nitesh Saxena.
Cryptography Lecture 9 Stefan Dziembowski
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
Cryptography Lecture 2 Arpita Patra. Summary of Last Class  Introduction  Secure Communication in Symmetric Key setting >> SKE is the required primitive.
Dan Boneh Public key encryption from Diffie-Hellman The ElGamal Public-key System Online Cryptography Course Dan Boneh.
Secure Computation Lecture Arpita Patra. Recap >> Improving the complexity of GMW > Step I: Offline: O(n 2 c AND ) OTs; Online: i.t., no crypto.
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
CS555Spring 2012/Topic 71 Cryptography CS 555 Topic 7: Stream Ciphers and CPA Security.
Cryptography Lecture 11 Arpita Patra. Generic Results in PK World  CPA-secure KEM  SKE COA-secure SKE  Hyb CPA-secure CPA SecurityCCA Security Bit.
1/28 Chosen-Ciphertext Security from Identity- Based Encryption Jonathan Katz U. Maryland Ran Canetti, Shai Halevi IBM.
CS555Spring 2012/Topic 81 Cryptography CS 555 Topic 8: Pseudorandom Functions and CPA Security.
Cryptography Lecture 10 Arpita Patra © Arpita Patra.
Cryptography Lecture 6 Arpita Patra. Quick Recall and Today’s Roadmap >> MAC for fixed-length messages >> Domain Extension for MAC >> Authenticated Encryption:
Cryptography CS 555 Topic 34: SSL/TLS.
Topic 26: Discrete LOG Applications
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
B504/I538: Introduction to Cryptography
B504/I538: Introduction to Cryptography
RSA and El Gamal Cryptosystems
Group theory exercise.
Homework 1 Due: Thursday at 9 AM (beginning of class)
Topic 24: Finding Prime Numbers, RSA
Course Business Homework 3
Topic 11: Authenticated Encryption + CCA-Security
Cryptography Lecture 23.
B504/I538: Introduction to Cryptography
Topic 5: Constructing Secure Encryption Schemes
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Topic 3: Perfect Secrecy
Cryptography Lecture 6.
Cryptography Lecture 10.
Topic 7: Pseudorandom Functions and CPA-Security
Cryptography Lecture 24.
Cryptography Lecture 25.
Cryptographic protocols 2016, Lecture 3 Key Exchange, CDH, DDH
Cryptographic protocols 2015, Lecture 3 Key Exchange, CDH, DDH
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
Course Business Homework 4 Released Bonus Problems (10 Points)
Cryptography Lecture 12 Arpita Patra © Arpita Patra.
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
Topic 13: Message Authentication Code
Cryptography Lecture 9.
The power of Pairings towards standard model security
Oblivious Transfer.
Cryptography Lecture 21.
Cryptography Lecture 19.
Cryptography Lecture 25.
Cryptography Lecture 24.
Cryptography Lecture 23.
Cryptography Lecture 26.
CIS 5371 Cryptography 2. Perfect Secret Encryption
Presentation transcript:

Topic 30: El-Gamal Encryption Cryptography CS 555 Topic 30: El-Gamal Encryption

Recap CPA/CCA Security for Public Key Crypto Key Encapsulation Mechanism

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 𝑚

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?

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 −𝑥

El-Gamal Encryption Encpk (𝑚) = 𝑔 𝑦 ,𝑚∙ ℎ 𝑦 for a random y∈ ℤ 𝑞 Decsk (𝑐= 𝑐 1 , 𝑐 2 ) = 𝑐 2 𝑐 1 −𝑥 Decsk ( 𝑔 𝑦 ,𝑚∙ ℎ 𝑦 ) =𝑚∙ ℎ 𝑦 𝑔 𝑦 −𝑥 =𝑚∙ ℎ 𝑦 𝑔 𝑦 −𝑥 =𝑚∙ 𝑔 𝑥 𝑦 𝑔 𝑦 −𝑥 =𝑚∙ 𝑔 𝑥𝑦 𝑔 −𝑥𝑦 =𝑚

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(.)

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)

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(.)

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 𝑏=1 + 1 2 1−Pr PubK A, Π eav n =1 𝑏=0 = 1 2 + 1 2 Pr y,z← ℤ 𝑞 𝐴 𝑔 𝑦 ,𝑚∙ 𝑔 𝑧 =1 − 1 2 Pr y,z← ℤ 𝑞 𝐴 𝑔 𝑦 , 𝑔 𝑧 =1 = 1 2

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.

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

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𝑚

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 𝑛 ,𝑅)

KEM CCA-Security ( KEM A,Π cca n ) 𝒑𝒌,𝒄,𝒌𝒃 … 𝒄 𝟏 ≠𝒄 𝐃𝐞𝐜𝐚𝐩𝐬 𝒔𝒌 𝒄 𝟏 𝒄 𝟐 ≠𝒄 ∀𝑃𝑃𝑇 𝐴 ∃𝜇 (negligible) s.t Pr KEM A,Π cca =1 ≤ 1 2 +𝜇(𝑛) 𝐃𝐞𝐜𝐚𝐩𝐬 𝒔𝒌 𝒄 𝟐 … b’ Random bit b (pk,sk) = Gen(.) 𝒄,𝒌𝟎 = 𝐄𝐧𝐜𝐚𝐩𝐬 𝒑𝒌 . 𝒌𝟏 ⟵ 𝟎,𝟏 𝒏

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

KEM CPA-Security ( KEM A,Π cpa n ) 𝒑𝒌,𝒄,𝒌𝒃 b’ ∀𝑃𝑃𝑇 𝐴 ∃𝜇 (negligible) s.t Pr KEM A,Π cpa =1 ≤ 1 2 +𝜇(𝑛) Random bit b (pk,sk) = Gen(.) 𝒄,𝒌𝟎 = 𝐄𝐧𝐜𝐚𝐩𝐬 𝒑𝒌 . 𝒌𝟏 ⟵ 𝟎,𝟏 𝒏

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.

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 𝑐 𝑥

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 ℎ 𝑦 =𝑘

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

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)

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 ′ 𝑐 ′ ,𝑡

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 ′ 𝑐 ′ ,𝑡

CCA-Secure Variant in Random Oracle Model Remark: The CCA-Secure variant is used in practice in the ISO/IEC 18033-2 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 ′ 𝑐 ′ ,𝑡

Next Class: RSA Attacks + Fixes Read Katz and Lindell: 11.5