Fiat Shamir Protocol is one of Zero Knowledge Proof Protocol that doesn't require the sender to send his credentials . Instead One can prove his / her identity by using Digital Signatures (sort of)
Well Kind of but can't be used in production yet... I mean the implementation is just a Proof Of Concept and Future scope of adding more to it exists
Most of the Details are in the Code itself But I am including the same for Documentation Purposes here...
- This is intended to be on Authentication of Client -Server over TCP
- There is a Provision of 2 Structures one for the Verifier and other for the prover.
typedef struct FSP_snd{
lli n,rand,x,y;
lli secret;
lli PUBLIC_KEY;
}fsp_snd;
typedef struct FSP_recv{
lli prime2, prime1;
lli n,challenge;
lli PUBLIC_KEY;
}fsp_recv;
-
1.Setup Reciever:
Choose Arbitrary prime and send n to prover (Registration Phase )
-
2.Challenge Prover:
Challenge Can be any Rand Number
-
3.Verify:
Verify the same recieved from Response Phase(Prover) with y**2%n
lli Setup_reciever(fsp_recv*);
lli challenge_phase(fsp_recv*,lli);
bool verification_phase(fsp_recv*,lli,lli);
-
1.Setup Phase: Prover Has a secret Key : s And Sends Public Key to Reciever (Verifier)
-
2.Commit Phase: Chooses a random value and bound it by common n and Send the same
-
3.Response Phase : Respond to the challenge
lli Setup_sender(fsp_snd*,lli,lli);
lli commit_phase(fsp_snd*);
lli response_phase(fsp_snd*,lli);
Clone this sub-repository and Maintain the Folder Structure as in this case .
Portablity : This library can be ported to Python and can be used as is in Vanilla C
For Testing Modify the test.c File and Run:
make test
For Porting to python/JS : Run :
make Clean
make SharedLib
to create a shared object file and use the .so file as a starter.
Make Clean && Make SharedLib
commands above
objdump -D lib.so
to identify if the Function Implementation is there and the namespace isn't mangled..
This current version is just a proof of concept version of ZKP . However there exist many complex algorithms in the wild out there The aim of the Entire Repository is to try and implement these algorithms with minimal dependencies. I mean from scratch ..
If possible this shall be maintained regularly and I shall add a bit of complexity as such
See Implementation for implementation in Python using this Library with the help of ctypes