MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture - - PowerPoint PPT Presentation

β–Ά
mit 6 875 berkeley cs276
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

MIT 6.875 & Berkeley CS276

Lecture 17 Foundations of Cryptography

slide-2
SLIDE 2

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.

slide-3
SLIDE 3

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.

slide-4
SLIDE 4

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)

slide-5
SLIDE 5

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.
slide-6
SLIDE 6

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.

slide-7
SLIDE 7

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.
slide-8
SLIDE 8

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.

slide-9
SLIDE 9

NIZK for 3SAT

𝛀 𝛀

Satisfying assignment (w!, w", … , w#)

  • 2. Prover encodes the satisfying assignment

(𝑂, 𝑧, 𝜌) 𝐷𝑆𝑇 = (𝑠

", 𝑠 #, … , 𝑠 +,-./ 0123/-) ← (𝐾𝑏𝑑) (")+,-./ 0123/-

𝑧! ← 𝑅𝑆) if 𝑦! is false 𝑧! ← 𝑅𝑂𝑆) if 𝑦! is true

slide-10
SLIDE 10

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.

slide-11
SLIDE 11

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: (𝑧!, … , 𝑧")

slide-12
SLIDE 12

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.

slide-13
SLIDE 13

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.

slide-14
SLIDE 14

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.

slide-15
SLIDE 15

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

slide-16
SLIDE 16

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 𝑅𝑆, 𝑅𝑆, 𝑅𝑆 .

slide-17
SLIDE 17

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 πœ”: 𝜍#

slide-18
SLIDE 18

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 πœ”: 𝜍#

slide-19
SLIDE 19

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.

slide-20
SLIDE 20

An Application of NIZK: Non-malleable and Chosen Ciphertext Secure Encryption Schemes

slide-21
SLIDE 21

Non-Malleability

c ← Enc(pk,m) sk

Bob pk

m ← Dec(sk,c)

Public-key directory

slide-22
SLIDE 22

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)

slide-23
SLIDE 23

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.

slide-24
SLIDE 24

IND-CCA Security

Eve Challenger π‘žπ‘™, 𝑑𝑙 ← π»π‘“π‘œ 1) π‘žπ‘™ 𝑐 ← 0,1 ; π‘‘βˆ— ← πΉπ‘œπ‘‘(π‘žπ‘™, 𝑛+

βˆ—)

𝑐′

Eve wins if 𝑐$ = 𝑐. IND-CCA secure if no PPT Eve can win with

  • prob. > !

% + negl(π‘œ).

π’…βˆ— 𝑑. 𝑒. 𝑛,

βˆ— = |𝑛! βˆ—|

𝑛,

βˆ—, 𝑛! βˆ—

𝑬𝒇𝒅(𝒕𝒍, 𝒅𝒋) 𝒅𝒋 𝑬𝒇𝒅(𝒕𝒍, 𝒅𝒋) 𝒅𝒋 𝑬𝒇𝒅(𝒕𝒍, 𝒅𝒋) 𝒅𝒋 β‰  π’…βˆ—

slide-25
SLIDE 25

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)

slide-26
SLIDE 26

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)

slide-27
SLIDE 27

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.

slide-28
SLIDE 28

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 π‘žπ‘™, 𝑛; 𝑠 .

slide-29
SLIDE 29

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.

𝒏

slide-30
SLIDE 30

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

slide-31
SLIDE 31

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.

slide-32
SLIDE 32

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.

slide-33
SLIDE 33

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 (π·π‘ˆ, Ο€, 𝑀𝑙, 𝜏 = π‘‡π‘—π‘•π‘œ(𝑑𝑕𝑙, 𝑫𝑼, Ο€ )).

slide-34
SLIDE 34

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.

slide-35
SLIDE 35

We saw: Non-Interactive Zero-Knowledge (NIZK) Proofs We saw: How to Construct CCA-secure encryption using NIZK proofs

slide-36
SLIDE 36

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.

slide-37
SLIDE 37

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.

(If the adv sees a difference, she broke NIZK soundness) Hybrid 2: Now change the CRS/Ο€ into simulated CRS/Ο€! (OK by ZK) If the Adv wins in this hybrid, she breaks IND-CPA!