Wolfram Language Paclet Repository
Community-contributed installable additions to the Wolfram Language
Implementation of Zero Knowledge proof interactive and non-interactive protocols
Contributed by: Armando Benjamín Cruz Hinojosa
This project implements interactive and non interactive zero knowledge proof protocols based on current Wolfram's cryptography framework. Zero knowledge proofs are communication protocols by which one person called the Prover can convince another person called Verifier that it posses a solution to a given public problem without revealing the content of the solution. This project implements two main applications of zero knowledge proofs; online zero knowledge authentication that provides protection against 'man in the middle' impersonation attacks; and the most impressive, a Verifier can be convinced that a computation was executed correctly without executing it and without knowing what was executed.
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["ArmandoCruz/ZeroKnowledgeProofs"]
To load the code after installation, evaluate this code:
Needs["ArmandoCruz`ZeroKnowledgeProofs`"]
Generate a PrivateSolution and a PublicProblem with an interactive protocol:
In[1]:= | ![]() |
Out[1]= | ![]() |
The Isomorphism protocol is based in finding an isomorphism between to public graphs. The private solution being the isomorphism between them:
In[2]:= | ![]() |
Out[2]= | ![]() |
In[3]:= | ![]() |
Out[3]= | ![]() |
Generate an interactive witness that will take the PrivateSolution and generate 3 homomorphic CipherProblems:
In[4]:= | ![]() |
Out[4]= | ![]() |
The homomorphic problems generated by the GXOR algorithm are new pairs of isomorphic graphs generated by adding noise to the original public pair:
In[5]:= | ![]() |
Out[5]= | ![]() |
Cipher solutions consists of an isomorphism between the cipher problem graphs and the random noise seed key:
In[6]:= | ![]() |
Out[6]= | ![]() |
The verifier then generate a query to the prover's public witness asking either for the solution to the cipher problem or the random noise seed key:
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
The prover answers the query using the witness knowledge of the CipherSolutions and CipherKeys:
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
Verify the proof:
In[11]:= | ![]() |
Out[11]= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
Compile arithmetic problems into corresponding arithmetic circuits:
In[13]:= | ![]() |
Out[2]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
Compile the Arithmetic circuit into a Quadratic Arithmetic Program (QAP):
In[15]:= | ![]() |
Out[5]= | ![]() |
In[16]:= | ![]() |
Out[16]= | ![]() |
The generated QAP satisfies the characteristic property: V(x)W(x)-K(x)=T(x)=F(x)H(x) for some polynomial H:
In[17]:= | ![]() |
Out[17]= | ![]() |
In[18]:= | ![]() |
Out[18]= | ![]() |
Wolfram Language Version 13.1