Discrete log of a given value These ideas can be applied to a more realistic cryptography application. Peggy wants to prove to Victor that she knows the
discrete logarithm of a given value in a given
group. For example, given a value , a large
prime , and a generator g, she wants to prove that she knows a value such that , without revealing . Indeed, knowledge of could be used as a proof of identity, in that Peggy could have such knowledge because she chose a random value that she did not reveal to anyone, computed , and distributed the value of to all potential verifiers, such that at a later time, proving knowledge of is equivalent to proving identity as Peggy. The protocol proceeds as follows: in each round, Peggy generates a random number , computes and discloses this to Victor. After receiving , Victor randomly issues one of the following two requests: he either requests that Peggy discloses the value of , or the value of . Victor can verify either answer; if he requested , he can then compute and verify that it matches . If he requested , then he can verify that is consistent with this, by computing and verifying that it matches . If Peggy indeed knows the value of , then she can respond to either one of Victor's possible challenges. If Peggy knew or could guess which challenge Victor is going to issue, then she could easily cheat and convince Victor that she knows when she does not: if she knows that Victor is going to request , then she proceeds normally: she picks , computes , and discloses to Victor; she will be able to respond to Victor's challenge. On the other hand, if she knows that Victor will request , then she picks a random value , computes , and discloses to Victor as the value of that he is expecting. When Victor challenges her to reveal , she reveals , for which Victor will verify consistency, since he will in turn compute , which matches , since Peggy multiplied by the
modular multiplicative inverse of . However, if in either one of the above scenarios Victor issues a challenge other than the one she was expecting and for which she manufactured the result, then she will be unable to respond to the challenge under the assumption of infeasibility of solving the discrete log for this group. If she picked and disclosed , then she will be unable to produce a valid that would pass Victor's verification, given that she does not know . And if she picked a value that poses as , then she would have to respond with the discrete log of the value that she disclosed but Peggy does not know this discrete log, since the value she disclosed was obtained through arithmetic with known values, and not by computing a power with a known exponent. Thus, a cheating prover has a 0.5 probability of successfully cheating in one round. By executing a large-enough number of rounds, the probability of a cheating prover succeeding can be made arbitrarily low. To show that the above interactive proof gives zero knowledge other than the fact that Peggy knows , one can use similar arguments as used in the above proof of completeness and soundness. Specifically, a simulator, say Simon, who does not know , can simulate the exchange between Peggy and Victor by the following procedure. Firstly, Simon randomly flips a
fair coin. If the result is "heads", then he picks a random value , computes , and discloses as if it is a message from Peggy to Victor. Then Simon also outputs a message "request the value of " as if it is sent from Victor to Peggy, and immediately outputs the value of as if it is sent from Peggy to Victor. A single round is complete. On the other hand, if the
coin flipping result is "tails", then Simon picks a random number , computes , and discloses as if it is a message from Peggy to Victor. Then Simon outputs "request the value of " as if it is a message from Victor to Peggy. Finally, Simon outputs the value of as if it is the response from Peggy back to Victor. A single round is complete. By the previous arguments when proving the completeness and soundness, the interactive communication simulated by Simon is indistinguishable from the true correspondence between Peggy and Victor. The zero-knowledge property is thus guaranteed.
Hamiltonian cycle for a large graph The following scheme is due to
Manuel Blum. In this scenario, Peggy knows a
Hamiltonian cycle for a large
graph . Victor knows but not the cycle (e.g., Peggy has generated and revealed it to him.) Finding a Hamiltonian cycle given a large graph is believed to be computationally infeasible, since its corresponding decision version is known to be
NP-complete. Peggy will prove that she knows the cycle without simply revealing it (perhaps Victor is interested in buying it but wants verification first, or maybe Peggy is the only one who knows this information and is proving her identity to Victor). To show that Peggy knows this Hamiltonian cycle, she and Victor play several rounds of a game: • At the beginning of each round, Peggy creates , a graph which is
isomorphic to (that is, is just like except that all the vertices have different names). Since it is trivial to translate a Hamiltonian cycle between isomorphic graphs with known isomorphism, if Peggy knows a Hamiltonian cycle for then she also must know one for . • Peggy commits to . She could do so by using a cryptographic
commitment scheme. Alternatively, she could number the vertices of . Next, for each edge of , on a small piece of paper, she writes down the two vertices that the edge joins. Then she puts all these pieces of paper face down on a table. The purpose of this commitment is that Peggy is not able to change while, at the same time, Victor has no information about . • Victor then randomly chooses one of two questions to ask Peggy. He can either ask her to show the isomorphism between and (see
graph isomorphism problem), or he can ask her to show a Hamiltonian cycle in . • If Peggy is asked to show that the two graphs are isomorphic, then she first uncovers all of (e.g. by turning over all pieces of papers that she put on the table) and then provides the vertex translations that map to . Victor can verify that they are indeed isomorphic. • If Peggy is asked to prove that she knows a Hamiltonian cycle in , then she translates her Hamiltonian cycle in onto and only uncovers the edges on the Hamiltonian cycle. That is, Peggy only turns over exactly of the pieces of paper that correspond to the edges of the Hamiltonian cycle, while leaving the rest still face-down. This is enough for Victor to check that does indeed contain a Hamiltonian cycle. It is important that the commitment to the graph be such that Victor can verify, in the second case, that the cycle is really made of edges from . This can be done by, for example, committing to every edge (or lack thereof) separately.
Completeness If Peggy does know a Hamiltonian cycle in , then she can easily satisfy Victor's demand for either the graph isomorphism producing from (which she had committed to in the first step) or a Hamiltonian cycle in (which she can construct by applying the isomorphism to the cycle in ).
Zero-knowledge Peggy's answers do not reveal the original Hamiltonian cycle in . In each round, Victor will learn only 's isomorphism to or a Hamiltonian cycle in . He would need both answers for a single to discover the cycle in , so the information remains unknown as long as Peggy can generate a distinct every round. If Peggy does not know of a Hamiltonian cycle in , but somehow knew in advance what Victor would ask to see each round, then she could cheat. For example, if Peggy knew ahead of time that Victor would ask to see the Hamiltonian cycle in , then she could generate a Hamiltonian cycle for an unrelated graph. Similarly, if Peggy knew in advance that Victor would ask to see the isomorphism then she could simply generate an isomorphic graph (in which she also does not know a Hamiltonian cycle). Victor could simulate the protocol by himself (without Peggy) because he knows what he will ask to see. Therefore, Victor gains no information about the Hamiltonian cycle in from the information revealed in each round.
Soundness If Peggy does not know the information, then she can guess which question Victor will ask and generate either a graph isomorphic to or a Hamiltonian cycle for an unrelated graph, but since she does not know a Hamiltonian cycle for , she cannot do both. With this guesswork, her chance of fooling Victor is , where is the number of rounds. For all realistic purposes, it is infeasibly difficult to defeat a zero-knowledge proof with a reasonable number of rounds in this way. == Variants of zero-knowledge ==