π Why ZKS?
ZKS Protocol is the first post-quantum secure networking SDK with built-in anonymity through onion routing. Built with 100% safe Rust, it provides unbreakable encryption for the quantum computing era.
| Protocol | Description | Security Model |
|---|---|---|
zk:// |
Direct encrypted connection | Post-quantum secure, low latency |
zks:// |
Swarm-routed anonymous connection | Post-quantum + onion routing |
π Table of Contents
- π Key Features
- π Quick Start
- π Security Architecture
- π¦ Crate Structure
- π§ Anonymous Routing
- π± Platform Support
- π Examples
- π‘οΈ Security
- π€ Contributing
- π License
π Key Features
π Post-Quantum Cryptography
- ML-KEM-768 (Kyber) β NIST Level 3 key exchange
- ML-DSA-65 (Dilithium) β Post-quantum signatures
- Resistant to quantum computer attacks
π§ Onion Routing
- Multi-hop anonymous connections
- Traffic analysis resistance
- Built-in swarm networking
β‘ High Performance
- Async/await native design
- Zero-copy message handling
- Minimal memory footprint
π Cross-Platform
- Native Linux, macOS, Windows
- WebAssembly for browsers
- Mobile-ready architecture
π Quick Start
π Prerequisites
- Rust 1.70+ toolchain
- OpenSSL (for development)
π₯ Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
π» Basic Connection (ZK://)
use *;
async
π§ Anonymous Connection (ZKS://)
use *;
async
π Browser (WebAssembly)
import init from 'zks-wasm';
await ;
// Generate post-quantum keypair
const keypair = ;
console.log;
// Sign a message
const message = .;
const signature = ;
console.log;
// Verify signature
const isValid = ;
console.log;
π Security Architecture
π Cryptographic Primitives
| Component | Algorithm | Security Level |
|---|---|---|
| Key Exchange | ML-KEM-768 (Kyber) | NIST Level 3 (IND-CCA2) |
| Signatures | ML-DSA-65 (Dilithium) | NIST Level 3 (EUF-CMA) |
| Symmetric Encryption | Wasif-Vernam Cipher | ChaCha20-Poly1305 + XOR |
| Random Entropy | drand beacon + local | TRUE random (not pseudo) |
π‘οΈ Security Levels
| Level | Key Exchange | Encryption | Use Case |
|---|---|---|---|
Classical |
Random | ChaCha20 | Testing/Development |
PostQuantum |
ML-KEM | Wasif-Vernam | Production |
TrueVernam |
ML-KEM + drand | OTP-style | Maximum Security |
π 3-Message Handshake
ββββββββββββββββ ββββββββββββββββ
β Initiator β β Responder β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β
β 1. HandshakeInit β
β ββββββββββββββββββββββββββββββββββββββΊ β
β [ephemeral_pk, nonce] β
β β
β 2. HandshakeResponse β
β ββββββββββββββββββββββββββββββββββββββ β
β [ephemeral_pk, ciphertext, signature] β
β β
β 3. HandshakeFinish β
β ββββββββββββββββββββββββββββββββββββββΊ β
β [confirmation_hash] β
β β
βΌ βΌ
[shared_secret derived] [shared_secret derived]
π¦ Crate Structure
zks/
βββ zks_sdk # High-level SDK (start here!)
βββ zks_crypt # Wasif-Vernam cipher, drand integration
βββ zks_pqcrypto # ML-KEM-768, ML-DSA-65
βββ zks_proto # Handshake protocol, URL parsing
βββ zks_wire # Swarm networking, NAT traversal
βββ zks_types # Common type definitions
βββ zks_wasm # WebAssembly bindings
| Crate | Description | Key Features |
|---|---|---|
zks_sdk |
High-level developer API | Connection builders, prefabs |
zks_crypt |
Core cryptographic operations | Wasif-Vernam, scrambling, drand |
zks_pqcrypto |
Post-quantum primitives | ML-KEM, ML-DSA, Zeroizing |
zks_proto |
Protocol implementation | 3-message handshake, messages |
zks_wire |
Network layer | STUN, NAT traversal, swarm |
zks_types |
Shared types | Error types, crypto params |
zks_wasm |
Browser support | JS bindings via wasm-bindgen |
π§ Anonymous Routing
The zks:// protocol provides onion routing through a decentralized swarm network:
ββββββββββ βββββββββββ βββββββββββ βββββββββββ ββββββββββββββ
β Client βββββΊβ Entry βββββΊβ Middle βββββΊβ Exit βββββΊβ Destinationβ
β β β Relay β β Relay β β Relay β β β
ββββββββββ βββββββββββ βββββββββββ βββββββββββ ββββββββββββββ
β β β β β
βββencryptedβββΊβββencryptedβββΊβββencryptedβββΊβββplaintextββββΊβ
Features
- Multi-hop routing: Configurable number of relay hops (default: 3)
- Layered encryption: Each hop can only decrypt its layer
- Traffic analysis resistance: Optional scrambling mode
- Peer discovery: Automatic swarm network formation
π± Platform Support
| Platform | Status | Notes |
|---|---|---|
| Linux | β Full Support | Primary development platform |
| macOS | β Full Support | Intel and Apple Silicon |
| Windows | β Full Support | Windows 10/11 |
| WebAssembly | β Full Support | Chrome, Firefox, Safari |
| iOS | π Planned | Via Rust FFI |
| Android | π Planned | Via Rust FFI |
π Examples
The examples/ directory contains complete working examples:
# Basic encrypted connection
# Anonymous swarm-routed connection
# Secure file transfer
π What Can You Build?
| Application | Protocol | Description |
|---|---|---|
| Encrypted Messenger | zks:// |
Quantum-proof end-to-end chat |
| Secure File Sharing | zk:// |
Unbreakable file transfer |
| Anonymous APIs | zks:// |
Hide client IP addresses |
| VPN Replacement | zks:// |
Better than VPN + Tor combined |
| Whistleblowing Platform | zks:// |
Source protection |
| Healthcare/Finance | zk:// |
HIPAA/PCI compliance |
π‘οΈ Security
Security Model
- Post-quantum resistance: All key exchanges use NIST-standardized algorithms
- Forward secrecy: Session keys are derived per-connection
- Zero trust: End-to-end encryption with mutual authentication
- Memory safety: 100% safe Rust, no
unsafecode in core crates
Responsible Disclosure
Please report security vulnerabilities to: security@zks-protocol.org
See SECURITY.md for our full security policy.
π§ͺ Testing
# Run all tests
# Run specific crate tests
# Run integration tests
π€ Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code:
- β Follows Rust best practices
- β Includes appropriate tests
- β Has documentation for public APIs
- β Passes all CI checks
π License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
See LICENSE for the full license text.
π Contact
- GitHub Issues: Report bugs and request features
- Security: security@zks-protocol.org