This project demonstrates a practical implementation of Zero Knowledge Proof (ZKP) cryptographic algorithms using a Schnorr-like protocol, applied to real-world security use cases.
The system shows how secrets can be cryptographically proven without ever being transmitted or stored.
- Secure Authentication β prove password knowledge without revealing it
- Digital Forensics β verify file integrity without exposing file contents
- Passwords are transmitted over networks
- Servers store password hashes that may be leaked
- Man-in-the-middle attacks can capture credentials
- Data breaches expose sensitive secrets
Zero Knowledge Proofβbased authentication
A cryptographic approach that allows a user to prove knowledge of a secret without ever revealing the secret itself.
The implementation is based on a Schnorr-style ZKP using the discrete logarithm problem.
Parameters:
- p = 256-bit prime number (secp256k1 prime)
- g = 2 (generator)
- x = secret (derived from password/file hash via SHA-256)
- y = g^x mod p (public value - safe to share)
βββββββββββββββββββ βββββββββββββββββββ
β PROVER β β VERIFIER β
β (Client) β β (Server) β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
β 1. Commitment: t = g^r mod p β
β ββββββββββββββββββββββββββββββββββββ>β
β β
β 2. Challenge: c (random) β
β <βββββββββββββββββββββββββββββββββββββ
β β
β 3. Response: s = r + c*x mod (p-1) β
β ββββββββββββββββββββββββββββββββββββ>β
β β
β 4. Verify: g^s β t * y^c mod p β
β β
| Transmitted (Safe) | Never Transmitted |
|---|---|
| Commitment (t) | Password |
| Challenge (c) | Secret (x) |
| Response (s) | Random nonce (r) |
| Public value (y) | File contents |
Security Basis: Discrete Logarithm Problem - Computing x from y = g^x mod p is computationally infeasible.
zkp-capstone-final/
β
βββ main.py # CLI demo runner
βββ requirements.txt # Python dependencies
βββ README.md # This documentation
β
βββ authentication/ # Use Case 1: ZKP Authentication
β βββ __init__.py
β βββ prover.py # Prover: generates proofs
β βββ verifier.py # Verifier: validates proofs
β βββ auth_flow.py # Complete auth workflow
β
βββ forensics/ # Use Case 2: File Integrity
β βββ __init__.py
β βββ prover.py # Prover: file-based proofs
β βββ verifier.py # Verifier: validates file proofs
β βββ file_integrity.py # Complete file verification flow
β
βββ performance/ # Performance Measurement
β βββ __init__.py
β βββ metrics.py # Timing and logging utilities
β βββ results.csv # Performance data log
β
βββ ui/ # Streamlit Web Interface
β βββ app.py # Full-featured web UI
β
βββ docs/ # Documentation
βββ PRESENTATION_GUIDE.md # How to present the project
βββ ARCHITECTURE.md # Technical details
- Python 3.8 or higher
- pip (Python package manager)
# 1. Navigate to project folder
cd zkp-capstone-final
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run CLI demo
python main.py
# 4. Run Web Interface (RECOMMENDED for presentation)
streamlit run ui/app.pyScenario: Login to a system without transmitting your password.
Traditional Method (INSECURE):
User β "password123" β Server β Compare with stored hash
β Password transmitted
β Server sees password
ZKP Method (SECURE):
User β Mathematical Proof β Server β Verify equation
β
Password NEVER transmitted
β
Server NEVER sees password
β
Even if hacked, no passwords leaked
Scenario: Prove you have an authentic copy of evidence without sending the file.
Applications:
- Court evidence verification
- Chain of custody in forensics
- Secure backup verification
- Distributed file validation
Our system demonstrates excellent performance:
| Operation | Average Time |
|---|---|
| Proof Generation | < 1 ms |
| Verification | < 1 ms |
| Total Round-trip | < 2 ms |
Based on 256-bit prime modular exponentiation
If the prover knows the secret, verification always succeeds.
If the prover does NOT know the secret, they cannot forge a valid proof (probability β 1/p β 0).
The verifier learns NOTHING about the secret from the proof values.
| Component | Technology |
|---|---|
| Language | Python 3.8+ |
| Cryptography | SHA-256, Modular Arithmetic |
| Protocol | Schnorr-like ZKP |
| Web UI | Streamlit |
| Logging | CSV |
- Schnorr, C.P. (1991). Efficient signature generation by smart cards. Journal of Cryptology
- Goldwasser, S., Micali, S., & Rackoff, C. (1989). The knowledge complexity of interactive proof systems. SIAM Journal on Computing
- RFC 8235 - Schnorr Non-interactive Zero-Knowledge Proof
- Schnorr-like ZKP Protocol
- Secure Password Authentication
- File Integrity Verification
- Command-line Interface (CLI)
- Web-based User Interface (Streamlit)
- Performance Metrics Logging
- Comparative Demo (Traditional vs ZKP)
- Mathematical Visualization
Β© 2026 Surya - Zero Knowledge Proof System