\documentclass{article}\usepackage{../style}\begin{document}\section*{Handout 6 (Zero-Knowledge Proofs)}Zero-knowledge proofs (short ZKP) solve a paradoxical puzzle:How to convince somebody else that one knows a secret, withoutrevealing what the secret actually is? This sounds like aproblem the Mad Hatter from Alice in Wonderland would occupyhimself with, but actually there some serious and not soserious applications of it. For example, if you solvecrosswords with your friend, say Bob, you might want toconvince him that you found a solution for one question, butof course you do not want to reveal the solution, as thismight give Bob an advantage somewhere else in the crossword.So how to convince Bob that you know the answer (or a secret)?One way would be to come up with the following protocol:Suppose the answer is \textit{folio}. Then look up thedefinition of \textit{folio} in a dictionary. Say you find:\begin{quote}``an \textit{individual} leaf of paper or parchment, eitherloose as one of a series or forming part of a bound volume,which is numbered on the recto or front side only.''\end{quote}\noindentTake the first non-article word in this definition,in this case \textit{individual}, and look up the definitionof this word, say\begin{quote}``a single \textit{human} being as distinct from a group''\end{quote}\noindent In this definition take the second non-article word, thatis \textit{human}, and again look up the definition of this word. This will yield\begin{quote}``relating to \textit{or} characteristic of humankind''\end{quote}\noindent You could go on to look up the definition of the thirdnon-article in this definition and so on. But let us assumeyou agreed with Bob to stop after three iterations with thethird non-article word in the last definition, that is\textit{or}. Now, instead of sending to Bob the solution\textit{folio}, you send to him \textit{or}. How can Bob verify that you know the solution? Well, once hesolved it himself, he can use the dictionary and follow thesame ``trail'' as you did. If the final word agrees with whatyou had sent him, he must infer you knew the solution earlier thanhim. This protocol works like a one-way hash function because\textit{or} does not give any hint as to what was the firstword was. I leave you to think why this protocol avoidsarticles? After Bob found his solution and verified that according tothe protocol it ``maps'' also to \textit{or}, can he beentirely sure no cheating is going on? Not with 100\%certainty. It could have been possible that he wasgiven \textit{or} as the word, but it derived from adifferent word. This might seem very unlikely, but atleast theoretical it is a possibility. Protocols based onzero-knowledge proofs will produce a similar result---theygive an answer that might be erroneous in a very small numberof cases. The point is to iterate them long enough so thatthe theoretical possibility of cheating is negligibly small. By the way, the authors of the paper ``Dismantling MegamosCrypto: Wirelessly Lockpicking a Vehicle Immobilizer'' whowere barred from publishing their results used also a hash toprove they did the work and (presumably) managed to get intocars without a key; see Figure~\ref{paper}. This is verysimilar to the method about crosswords: They like to provethat they did the work, but not giving out the ``solution''.But this also shows what the problem with such a method is:yes, we can hide the secret temporarily, but if somebody elsewants to verify it, then the secret has to be made public. Bobneeds to know that \textit{folio} is the solution before hecan verify the claim that somebody else had the solutionfirst. Similarly with the paper: we need to wait until theauthors are finally allowed to publish their findings in orderto verify the hash. This might happen at some point, butequally it might never happen (what for example happens if theauthors lose their copy of the paper because of a diskfailure?). Zero-knowledge proofs, in contrast, can beimmediately checked, even if the secret is not public yetand never will be.\begin{figure}\begin{center}\addtolength{\fboxsep}{4mm}\fbox{\includegraphics[scale=0.4]{../pics/Dismantling_Megamos_Crypto.png}}\end{center}\caption{The authors of this paper used a hash in order to provelater that they have managed to break into cars.\label{paper}}\end{figure}\subsubsection*{ZKP: An Illustrative Example}The idea behind zero-knowledge proofs is not very obvious andwill surely take some time for you to digest. Therefore let usstart with a simple illustrative example. The example will notbe perfect, but hopefully explain the gist of the idea. Theexample is called Alibaba's cave, which graphically looks as follows:\begin{center}\begin{tabular}{c@{\hspace{8mm}}c@{\hspace{8mm}}c}\includegraphics[scale=0.1]{../pics/alibaba1.png} &\includegraphics[scale=0.1]{../pics/alibaba2.png} &\includegraphics[scale=0.1]{../pics/alibaba3.png} \\Step 1 & Step 2 & Step 3\end{tabular}\end{center}\noindent Let us take a closer look at the picture in Step 1:The cave has a tunnel which forks at some point. Both forksare connected in a loop. At the deep end of the loop is amagic wand. The point of the magic wand is that Alice knowsthe secret word for how to open it. She wants to keep the wordsecret, but wants to convince Bob that she knows it.One way of course would be to let Bob follow her, but then hewould also find out the secret. This does not work. So let usfirst fix the rules: At the beginning Alice and Bob areoutside the cave. Alice goes in alone and takes either tunnellabelled $A$ in the picture, or the other one labelled $B$.She waits at the magic wand for the instructions from Bob, whoalso goes into the gave and observes what happens at the fork.He has no knowledge which tunnel Alice took and calls out(Step 2) that she should emerge from tunnel $A$, for example.If she knows the secret for opening the wand, this will not bea problem for Alice. If she was already in the A-segment ofthe tunnel, then she just comes back. If she was in theB-segment of the tunnel she will say the magic work and goesthrough the wand to emerge from $A$ as requested by Bob.Let us have a look at the case where Alice cheats, that is notknows the secret. She would still go into the cave and use,for example the $B$-segment of the tunnel. If now Bob says sheshould emerge from $B$, she is lucky. But if he says sheshould emerge from $A$ then Alice is in trouble: Bob will findout she does not actually know the secret. So in order to foolBob she needs to anticipate his call, and already go into thecorresponding tunnel. This of course also does not work. Soin order to find out whether Alice cheats, Bob just needs torepeat this protocol many times. Each time Alice has a chanceof $\frac{1}{2}$ to be lucky or being found out. Iteratingthis $n$ means she must be right every time and the probability for this is $\frac{1}{2}^n$.There are some interesting observations we can make about Alibaba's cave and the ZKP protocol between Alice and Bob:\begin{itemize}\item {\bf Completeness} If Alice knows the secret, Bob accepts Alice ``proof'' for sure. There is no error possbile in that Bob thinks Alice cheats when she actually knows the secret. \item {\bf Soundness} If Alice does not know the secret, Bob accepts her ``proof'' with a very small probability. If, as in the example above, the probability of being able to hide cheating is $\frac{1}{2}$ in each round it will be $\frac{1}{2}^n$ after $n$-rounds, which even for small $n$ say $> 10$ is very small indeed.\item {\bf Zero-Knowledge} Even if Bob accepts the proof by Alice, he cannot convince anybody else.\end{itemize} \noindent The last property is the most interesting. AssumeAlice has convinced Bob that she knows the secret and Bobfilmed the whole protocol with a camera. Can he use the videoto convince anybody else. After a moment thought you willagree that this is not the case. Alice and Bob might have justmade is all up and colluded by Bob telling Alice beforehandwhich tunnel he will call. In this way it appears as if alliterations of the protocol were successful, but they provenothing. If another person wants to find out whether Aliceknows the secret, he or she would have to conduct the protocolagain. This is actually the definition of a zero-knowledge proof: an independent observer cannot distinguish betweena real protocol (where Alice knows the secret) and a fakeone (where Bob and Alice colluded).\subsubsection*{Using an Graph-Isomorphism Problem for ZKPs}Now the question is how can we translate Alibaba's cave into acomputer science solution? It turns out we need an NP problemfor that. The main feature of an NP problem is that it iscomputational very hard to generate a solution, but it is veryeasy to check whether a given solution indeed solves theproblem at hand.\footnote{The question whether $P = NP$ or not,we leave to others to speculate about.} One NP problem is the \emph{graph isomorphism problem}.\subsubsection*{Using Modular Arithmetic for ZKP Protocols}\end{document}%%% Local Variables: %%% mode: latex%%% TeX-master: t%%% End: