https://github.com/johnbasrai/zkp-cp
Chaum-Pedersen Zero Knowledge Proof
https://github.com/johnbasrai/zkp-cp
tokio zkp zkproof
Last synced: 5 months ago
JSON representation
Chaum-Pedersen Zero Knowledge Proof
- Host: GitHub
- URL: https://github.com/johnbasrai/zkp-cp
- Owner: JohnBasrai
- License: mit
- Created: 2023-10-03T01:42:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T17:59:25.000Z (over 1 year ago)
- Last Synced: 2025-01-11T21:22:30.396Z (about 1 year ago)
- Topics: tokio, zkp, zkproof
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chaum-Pedersen Zero Knowledge Proof in Rust
This project implements a Chaum–Pedersen Zero Knowledge Proof (ZKP) protocol using Rust, with gRPC networking and async communication between client and server.
Chaum–Pedersen ZKP is a cryptographic proof that allows a prover to convince a verifier they know a discrete logarithm without revealing the secret value.
## Key Rust Crates Used
| Crate | Purpose |
|----------------|-------------------------------------------------------------|
| **tonic** | Rust implementation of gRPC for client/server communication |
| **tokio** | Asynchronous runtime for network applications |
| **num-bigint** | Big integer arithmetic for cryptographic operations |
| **rand** | Cryptographically secure random number generation |
| **clap** | Command line argument parsing |
| **anyhow** | Improved error handling |
| **prost** | Protocol Buffers implementation |
## Building
```bash
cargo build --release
```
## Running
In one terminal, start the server:
```bash
cargo run --release --bin server
```
In another terminal, run the client:
```bash
cargo run --release --bin client -- --user-name "alice"
```
**What happens next:**
1. **Registration Step**: You'll be prompted to enter a password to register the user
```
Password: [enter any password, e.g., "mypassword123"]
✅ Registration was successful
```
2. **Authentication Step**: You'll immediately be prompted to enter the password again to login
```
Please provide the password (to login):
Password (to login): [enter the SAME password again]
✅Login successful! session_id: abc123xyz
```
**Important**: Use the same password for both steps. The first creates your account, the second proves you know the password using Zero Knowledge Proof - the server never sees your actual password!
## Testing
Run the test suite to verify the ZKP implementation:
```bash
cargo test
```
## Containerization
Work in progress.