#zero-knowledge-proofs #grpc-server #grpc-client #proof #zkp #client-server #algorithm

chaum_pedersen_auth

An implementation of ZKP(Zero Knowledge Proof) using chaum pedersen algorithm

4 releases

0.1.3 Jan 24, 2024
0.1.2 Jan 22, 2024
0.1.1 Jan 20, 2024
0.1.0 Jan 18, 2024

#899 in Network programming


Used in 2 crates

MIT/Apache

19KB
184 lines

Zero Knowledge Proof Algorithm Implemetaion Awesome

How to use this library?

TL;DR

  • cargo build (should generate the compiled protobuf in exampls/protos. Note the build.rs file is only for compiling the proto files in example folder.)
  • Start the server: cargo run --package chaum_pedersen_auth --example server
  • Start the client:cargo run --package chaum_pedersen_auth --example client
  • Take a look at Example folder which implemeted a client and a server that use gRPC as protocol.

The theory

Assets:

  • Bob's Asset: Private key: $x, k$
  • Alice's Asset: Random key $c$
  • Shared Asset: generator $\alpha , \beta$.

Registrition:

$\alpha^x \mod q$ , $\beta^x \mod q$

Authentication:

Bob send $\alpha^k \mod q$ , $\beta^k \mod q$

  • Bob calculation: $s = k - cx$
  • Alice Verification: $\alpha^s (\alpha^x)^c \mod q$ , $\beta^s (\beta^x)^c\mod q$

Usage

Dependencies

~0.7–1MB
~18K SLoC