MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture - - PowerPoint PPT Presentation
MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture - - PowerPoint PPT Presentation
MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture 17 HOW TO CONSTRUCT NIZK IN THE CRS MODEL Step 1. Review our number theory hammers & polish them. Step 2. Construct NIZK for a special NP language, namely quadratic non
HOW TO CONSTRUCT NIZK IN THE CRS MODEL
Step 1. Review our number theory hammers & polish them. Step 2. Construct NIZK for a special NP language, namely quadratic non-residuosity. Step 3. Bootstrap to NIZK for 3SAT, an NP-complete language.
3SAT
Boolean Variables: π¦! can be either true (1) or false (0) A Literal is either π¦! or " π¦!. A Clause is a disjunction of literals. E.g. π¦" β¨ π¦# β¨ π¦$ A Clause is true if any one of the literals is true.
3SAT
Boolean Variables: π¦! can be either true (1) or false (0) A Literal is either π¦! or " π¦!. A Clause is a disjunction of literals. E.g. π¦" β¨ π¦# β¨ π¦$ is true as long as: (π¦", π¦#, π¦$ ) β (0,0,1)
3SAT
Boolean Variables: π¦! can be either true (1) or false (0) A Literal is either π¦! or " π¦!. A 3-Clause is a disjunction of 3-literals. A 3-SAT formula is a conjunction of many 3-clauses. E.g. π = (π¦" β¨ π¦# β¨ π¦$) β§ (π¦" β¨ π¦% β¨ π¦&) (π¦# β¨ π¦% β¨ π¦$) A 3-SAT formula π is satisfiable if there is an assignment
- f values to the variables π¦! that makes all its clauses true.
3SAT
A 3-SAT formula is a conjunction of many 3-clauses. E.g. π = (π¦" β¨ π¦# β¨ π¦$) β§ (π¦" β¨ π¦% β¨ π¦&) (π¦# β¨ π¦% β¨ π¦$) A 3-SAT formula π is satisfiable if there is an assignment
- f values to the variables π¦! that makes all its clauses true.
Cook-Levin Theorem: It is NP-complete to decide whether a 3-SAT formula π is satisfiable.
NIZK for 3SAT: Recallβ¦
πΎππ'" πΎππ(" π)
β
π π) π ππ) We saw a way to show that a pair (πΆ, π) is GOOD. That is:
- the following is the picture of π)
β and
- for every π β πΎππ(", either π or π π§ is a quadratic residue.
NIZK for 3SAT
π π Input: π = (π¦" β¨ π¦# β¨ π¦$) β§ (π¦" β¨ π¦% β¨ π¦&) (π¦# β¨ π¦% β¨ π¦$)
Satisfying assignment (w!, w", β¦ , w#)
- 1. Prover picks an (π, π§) and proves that it is GOOD.
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
n variables, m clauses.
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 2. Prover encodes the satisfying assignment
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
π§! β π π) if π¦! is false π§! β π ππ) if π¦! is true
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 2. Prover encodes the satisfying assignment & β΄ the literals
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
πΉππ π¦! = π§!, then πΉππ " π¦! = π§π§! β΄ exactly one of πΉππ π¦! ππ πΉππ " π¦! is a non-residue.
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 2. Prover encodes the satisfying assignment & β΄ the literals
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
πΉππ π¦! = π§!, then πΉππ " π¦! = π§π§! β΄ exactly one of πΉππ π¦! ππ πΉππ " π¦! is a non-residue.
Encode vars: (π§!, β¦ , π§")
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 3. Prove that (encoded) assignment satisfies each clause.
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
Encode vars: (π§!, β¦ , π§")
For each clause, say π¦" β¨ π¦# β¨ π¦$, let (π", π", π") denote the encoded variables. So, each of them is either π§! (if the literal is a var) or π§π§! (if the literal is a negated var). For each clause, say π¦" β¨ π¦# β¨ π¦$, let (π" = π§", π" = π§#, π" = π§π§$) denote the encoded variables.
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 3. Prove that (encoded) assignment satisfies each clause.
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
Encode vars: (π§!, β¦ , π§")
For each clause, say π¦" β¨ π¦# β¨ π¦$, let (π", π", π") denote the encoded variables. WANT to SHOW: π¦" ππ π¦# ππ π¦$ is true.
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 3. Prove that (encoded) assignment satisfies each clause.
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
Encode vars: (π§!, β¦ , π§")
For each clause, say π¦" β¨ π¦# β¨ π¦$, let (π", π", π") denote the encoded variables. WANT to SHOW: π" ππ π" ππ π" is a non-residue.
NIZK for 3SAT
Prove that (encoded) assignment satisfies each clause. WANT to SHOW: π" ππ π" ππ π" is a non-residue. Equiv: The βsignatureβ of (π", π", π") is NOT (QR, QR, QR). CLEVER IDEA: Generate seven additional triples
(π!, π!, π!) (π", π", π") (π#, π#, π#) (π$, π$, π$) (π%, π%, π%) (π&, π&, π&) (π', π', π') (π(, π(, π()
- riginal triple
show this is a QR: reveal the square roots βProof of Coverageβ: show that the 8 triples span all possible QR signatures
NIZK for 3SAT
CLEVER IDEA: Generate seven additional triples
(π!, π!, π!) (π", π", π") (π#, π#, π#) (π$, π$, π$) (π%, π%, π%) (π&, π&, π&) (π', π', π') (π(, π(, π()
- riginal triple
show this is a QR: reveal the square roots βProof of Coverageβ: show that the 8 triples span all possible QR signatures
Proof of Coverage: For each of poly many triples (π , π‘, π’) from CRS, show one of the 8 triples has the same signature. That is, there is a triple (π!, π!, π!) s.t. (π π!, π‘π!, π’π!) is π π, π π, π π .
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
- 3. Prove that (encoded) assignment satisfies each clause.
(π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
Encode vars: (π§!, β¦ , π§")
For each clause, construct the proof Ο = (7 additional triples, square root of the second triples, proof of coverage).
For each clause π: π#
NIZK for 3SAT
π π
Satisfying assignment (w!, w", β¦ , w#)
Completeness & Soundness: Exercise. (π, π§, π) π·ππ = (π
", π #, β¦ , π +,-./ 0123/-) β (πΎππ) (")+,-./ 0123/-
Encode vars: (π§!, β¦ , π§")
Zero Knowledge: Simulator picks (π, π§) where π§ is a quadratic residue. Now, encodings of ALL the literals can be set to TRUE!!
For each clause π: π#
HOW TO CONSTRUCT NIZK IN THE CRS MODEL
Step 1. Review our number theory hammers & polish them. Step 2. Construct NIZK for a special NP language, namely quadratic non-residuosity. Step 3. Bootstrap to NIZK for 3SAT, an NP-complete language.
An Application of NIZK: Non-malleable and Chosen Ciphertext Secure Encryption Schemes
Non-Malleability
c β Enc(pk,m) sk
Bob pk
m β Dec(sk,c)
Public-key directory
Active Attacks 1: Malleability
c β Enc(pk,$100) sk
ATTACK: Adversary could modify (βmaulβ) an encryption
- f m into an encryption of a related message mβ.
cβ =Enc(pk,$101)
Active Attacks 2: Chosen-Ciphertext Attack
c* β Enc(pk,m) sk
ATTACK: Adversary may have access to a decryption βoracleβ and can use it to break security of a βtargetβ ciphertext c* or even extract the secret key! In fact, Bleichenbacher showed how to extract the entire secret key given only a βciphertext verificationβ oracle.
IND-CCA Security
Eve Challenger ππ, π‘π β π»ππ 1) ππ π β 0,1 ; πβ β πΉππ(ππ, π+
β)
πβ²
Eve wins if π$ = π. IND-CCA secure if no PPT Eve can win with
- prob. > !
% + negl(π).
π β π‘. π’. π,
β = |π! β|
π,
β, π! β
π¬ππ (ππ, π π) π π π¬ππ (ππ, π π) π π π¬ππ (ππ, π π) π π β π β
Constructing CCA-Secure Encryption
NIZK Proofs of Knowledge should help! Idea: The encrypting party attaches an NIZK proof of knowledge of the underlying message to the ciphertext. π·: (c = CPAEnc π; π , proof Ο π’βππ’ βπ½ ππππ₯ π πππ π β) This idea will turn out to be useful, but NIZK proofs themselves can be malleable!
(Intuition)
Constructing CCA-Secure Encryption
OUR GOAL: Hard to modify an encryption of m into an encryption of a related message, say m+1. OUR GOAL: Hard to modify an encryption of m into an encryption of a related message, say m+1. Digital Signatures should help!
(Intuition)
Constructing CCA-Secure Encryption
π·: (c = CPAEnc ππ, π; π , ππππP.Q π , π€π) π·: (c = CPAEnc ππ, π; π , ππππ π ) Letβs start with Digital Signatures.
where the encryptor produces a signing / verification key pair by running π‘ππ, π€π β ππππ. π»ππ(1")
Is this CCA-secure/non-malleable? If the adversary changes π€π, all bets are off! Lesson: NEED to βtieβ the ciphertext c to π€π in a βmeaningfulβ way.
Observation: IND-CPA βΉβDifferent-Key Non-malleabilityβ
Different-Key NM: Given ππ, ππR, CPAEnc ππ, π; π , can an adversary produce CPAEnc ππβ², π + 1; π ? NO! Suppose she could. Then, I can come up with a reduction that breaks the IND-CPA security of CPAEnc ππ, π; π .
Observation: IND-CPA βΉβDifferent-Key Non-malleabilityβ
Different-Key NM: Given ππ, ππR, CPAEnc ππ, π; π , can an adversary produce CPAEnc ππβ², π + 1; π ?
Diff-Key NM adversary
ππ, ππβ² π·ππ΅πΉππ(ππ, π) π«πΈπ©πππ (ππ., π + π)
Reduction = CPA adversary
ππ π·ππ΅πΉππ(ππ, π)
Pick (ππ., ππ.) Decrypt and subtract 1.
π
Putting it together
CCA Public Key: ππ public keys of the CPA scheme (where π = |π€π|) ππ",_ ππ"," ππ#,_ ππ#," ππ0,_ ππ0," β¦ CCA Encryption: ππ’",`Q! ππ’#,`Q" ππ’0,`Q# β¦ First, pick a sign/ver key pair (π‘ππ, π€π) π·π = Output (π·π, π€π, π = ππππ(π‘ππ, π·π)). where ππ’!,a β π·ππ΅πΉππ(ππ!,a, π)
Putting it together
CCA Encryption: ππ’",`Q! ππ’#,`Q" ππ’0,`Q# β¦ First, pick a sign/ver key pair (π‘ππ, π€π) π·π = Output (π·π, π€π, π = ππππ(π‘ππ, π·π)). where ππ’!,a β π·ππ΅πΉππ(ππ!,a, π) Non-malleability rationale: Either
- Adversary keeps π€π the same (in which case she
has to break the signature scheme); or
- She changes the π€π in which case she breaks the
diff-NM game, and therefore CPA security.
Call it a day?
CCA Encryption: ππ’",`Q! ππ’#,`Q" ππ’0,`Q# β¦ First, pick a sign/ver key pair (π‘ππ, π€π) π·π = Output (π·π, π€π, π = ππππ(π‘ππ, π·π)). where ππ’!,a β π·ππ΅πΉππ(ππ!,a, π) We are not done!! Adversary could create ill-formed ciphertexts (e.g. the different ππ’s encrypt different messages) and uses it for a Bleichenbacher-like attack.
NIZK Proofs to the Rescueβ¦
CCA Encryption: ππ’",`Q! ππ’#,`Q" ππ’0,`Q# β¦ First, pick a sign/ver key pair (π‘ππ, π€π) π·π = where ππ’!,a β π·ππ΅πΉππ(ππ!,a, π; π
!,a)
CCA Public Key: ππ public keys of the CPA scheme ππ",_ ππ"," ππ#,_ ππ#," ππ0,_ ππ0," β¦ Ο = = NIZK proof that βCT is well-formedβ NP statement: βthere exist π, π
!,a such that each ππ’!,a =
π·ππ΅πΉππ(ππ!,a, π; π
!,a)β
, π«πΊπ» Output (π·π, π€π, π = ππππ(π‘ππ, π·π)). Output (π·π, Ο, π€π, π = ππππ(π‘ππ, π«πΌ, Ο )).
Are there other attacks?
Did we miss anything else? Turns out NO. We can prove that this is CCA-secure. For a proof sketch, see the next few slides and for a proof, read DDN.
We saw: Non-Interactive Zero-Knowledge (NIZK) Proofs We saw: How to Construct CCA-secure encryption using NIZK proofs
Proof Sketch
Letβs play the CCA game with the adversary. We will use her to break either the NIZK soundness/ZK, the signature scheme or the CPA-secure scheme.
Proof Sketch
Letβs play the CCA game with the adversary. Hybrid 0: Play the CCA game as prescribed. Hybrid 1: Observe that πππ β ππβ. (Otherwise break signature) Observe that this means each query ciphertext-tuple involves a different public-key from the challenge
- ciphertext. Use the βdifferent private-keyβ to decrypt.