Today we define the notion of computational zero knowledge and show that the simulator we described in the last lecture establishes the computational zero knowledge property of the 3-coloring protocol.
1. The Protocol and the Simulator
Recall that we use a commitment scheme (C,O) for messages in {1,2,3}, and that the common input to the prover and the verifier is a graph G=([n],E), where [n]:={1,2,…,n}. The prover, in addition, is given a valid 3-coloring α:[n]→{1,2,3} of G.
The protocol is defined as follows:
The prover picks a random permutation π:{1,2,3}→{1,2,3} of the set of colors, and defines the 3-coloring β(v):=π(α(v)). The prover picks n keys K1,…,Kn for (C,O), constructs the commitments cv:=C(Kv,β(v)) and sends (c1,…,cn) to the verifier;
The verifier picks an edge (u,v)∈E uniformly at random, and sends (u,v) to the prover;
The prover sends back the keys Ku,Kv;
If O(Ku,cu) and O(Kv,cv) are the same color, or if at least one of them is equal to FAIL, then the verifier rejects, otherwise it accepts
For every verifier algorithm V∗, we defined a simulator algorithm S∗ which repeats the following procedure until the output is different from FAIL:
Algorithm S1round∗
Input: graph G=([n],E)
Pick random coloring γ:[n]→{1,2,3}.
Pick n random keys K1,…,Kn
Define the commitments ci:=C(Ki,γ(i))
Let (u,v) be the 2nd-round output of V∗ given G as input and c1,…,cn as first-round message
If γ(u)=γ(v), then output FAIL
Else output ((c1,…,cn),(u,v),(Ku,Kv))
We want to show that this simulator construction establishes the computational zero knowledge property of the protocol, assuming that (C,O) is secure. We give the definition of computational zero knowledge below.
Definition 1 (Computational Zero Knowledge)We say that a protocol (P,V) for 3-coloring is (t,ϵ) computational zero knowledge with simulator overhead so(⋅) if for every verifier algorithm V∗ of complexity ≤t there is a simulator S∗ of complexity ≤so(t) on average such that for every algorithm D of complexity ≤t, every graph G and every valid 3-coloring α we have
∣P[D(P(G,α)↔V∗(G))=1]−P[D(S∗(G))=1]∣≤ϵ
Theorem 2 Suppose that (C,O) is (2t+O(nr),ϵ/(4⋅∣E∣⋅n))-secure and that C is computable in time ≤r.
Then the protocol defined above is (t,ϵ) computational zero knowledge with simulator overhead at most 1.6⋅t+O(nr).
2. Proving that the Simulation is Indistinguishable
Suppose that the Theorem is false. Then there is a graph G, a 3-coloring α, a verifier algorithm V∗ of complexity ≤t, and a distinguishing algorithm D also of complexity ≤t such that
∣P[D(P(G,α)↔V∗(G))=1−P[D(S∗(G))=1]∣≥ϵ
Let 2Ru,v be the event that the edge (u,v) is selected in the second round; then
(We have omitted references to G,α, which are fixed for the rest of this section.)
Now we show that there is an algorithm A of complexity 2t+O(nr) that is able to distinguish between the following two distributions over commitments to 3n colors:
Distribution (1) commitments to the 3n colors 1,2,3,1,2,3,…,1,2,3;
Distribution (2) commitments to 3n random colors
Algorithm A:
Input: 3n commitments da,i where a∈{1,2,3} and i∈{1,…,n};
Pick a random permutation π:{1,2,3}→{1,2,3}
Pick random keys Ku∗, Kv∗
Construct the sequence of commitments c1,…,cn by setting:
cu∗:=C(Ku∗,π(α(u∗))
cv∗:=C(Kv∗,π(α(v∗))
for every w∈[n]−{u∗,v∗}, cw:=dπ(α(w)),w
If the 2nd round output of V∗ given G and c1,…,cn is different from (u∗,v∗) output 0
This follows by observing that A on input Distribution (1) behaves exactly like the prover given the coloring α, and that A accepts if and only if the event 2Ru∗,v∗ happens and D accepts the resulting transcript.
To prove this second claim, we introduce, for a coloring γ, the quantity DA(γ), defined as the probability that the following probabilistic process outputs 1:
Pick random keys K1,…,Kn
Define commitments cu:=C(Ku,γ(u))
Let (u,v) be the 2nd round output of V∗ given the input graph G and first round message c1,…,cn
Because A, on input Distribution 2, first prepares commitments to a coloring chosen uniformly at random among all 1/(6⋅3n−2) colorings such that γ(u∗)=γ(v∗) and then outputs 1 if and only if, given such commitments as first message, V∗ replies with (u∗,v∗) and the resulting transcript is accepted by D.
To see why Equation (5) is true, consider that the probability that S∗ outputs a particular transcript is exactly 1/P[S1Round∗=FAIL] times the probability that S1Round∗ outputs that transcript. Also, the probability that S1Round∗ outputs a transcript which involves (u∗,v∗) at the second round and which is accepted by D() conditioned on γ being the coloring selected at the beginning is DA(γ) if γ is a coloring such that γ(u∗)=γ(v∗), and it is zero otherwise. Finally, S1Round∗ selects the initial coloring uniformly at random among all possible 3n coloring.
From our security assumption on (C,O) and from Lemma 6 in Lecture 27 we have
P[S1Round∗=FAIL]−32≤4∣E∣ϵ(6)
and so the claim we made in Equation (3) follows from Equation (4), Equation (5), Equation (6) and the fact that if p,q are quantities such that 23p≤1, q1⋅p≤1, and q−32≤δ≤61 (so that q≥1/2), then
23p−q1p=23⋅p⋅q1⋅q−32≤2δ
(We use the above inequality with q=P[S1Round∗=FAIL], δ=ϵ/4∣E∣, and p=∑γ:γ(u∗)=γ(v∗)3n1DA(γ).)
where A is an algorithm of complexity at most 2t+O(nr). Now by a proof similar to that of Theorem 3 in Lecture 27, we have that (C,O) is not (2t+O(nr),ϵ/(2∣E∣n)) secure.