Your Data , Your Keys
Zero-knowledge encryption for Fight Club & Knockout
When you mark a fight as private, Fight Club encrypts every piece of content — topics, messages, documents, AI-generated summaries — with a key derived from your personal vault password. The server never stores your password and cannot read your encrypted data. Built on AES-256-GCM, quantum-resistant by NIST standards.
How It Works
What's Encrypted
| Data | Private Fight | Public Fight |
|---|---|---|
| Fight title & topic | Encrypted | Plaintext |
| All debate messages | Encrypted | Plaintext |
| Uploaded documents (PDF, images) | Encrypted | Plaintext |
| Extracted PDF text | Encrypted | Plaintext |
| Fighter personas & system prompts | Encrypted | Plaintext |
| AI-generated summaries | Encrypted | Plaintext |
| API keys (all providers) | Encrypted | Encrypted |
| RAG endpoint keys | Encrypted | Encrypted |
Architecture
Zero-Knowledge Design
Your vault password is never stored on the server — not even as a hash. We store only a random salt and an encrypted verifier (a known plaintext encrypted with your derived key). The server can verify your password is correct but cannot recover it or derive your vault key without it.
Session Management
When you unlock your vault, the derived key is encrypted with the server's master key and cached for 4 hours. After that, the vault auto-locks and you must re-enter your password. Running fights hold the key in memory for the fight duration.
File Encryption
Uploaded documents (PDFs, images) are encrypted on disk using AES-256-GCM with your vault key. The binary format prepends the IV and auth tag directly to the ciphertext — no hex encoding overhead. Files are decrypted only when served to the authenticated owner.
Server-Side Security
A separate server master key (AES-256, from environment variable) provides a second encryption layer for vault session keys at rest. All communication happens over HTTPS. CSRF protection and rate limiting are enforced on all API endpoints.
No Password Recovery
By design, there is no password recovery. If you forget your vault password, your encrypted fight content and API keys are permanently unrecoverable. You can reset your vault, which deletes all encrypted data and lets you start fresh — but the old data is gone forever. This is the tradeoff for true zero-knowledge security: nobody, not even us, can access your encrypted data without your password.
Quantum-Resistant by NIST Standards
Fight Club uses AES-256, which NIST classifies as quantum-resistant. While Grover's algorithm theoretically halves symmetric key strength against a quantum computer, AES-256 would still provide an effective 128-bit security level — far beyond what is computationally feasible.
Post-quantum threats primarily target asymmetric cryptography (RSA, ECDH, ECDSA) used in key exchange and digital signatures. Our vault uses only symmetric primitives — scrypt for key derivation and AES-256-GCM for authenticated encryption — both of which remain secure in a post-quantum world.
NIST's post-quantum standardization effort (FIPS 203/204/205) does not address symmetric encryption because AES-256 is already considered sufficient for the post-quantum era.
Technical Specifications
- Encryption Algorithm
- AES-256-GCM
- IV Length
- 12 bytes (random per operation)
- Auth Tag
- 16 bytes (tamper detection)
- Key Derivation
- scrypt (N=16384, r=8, p=1)
- Salt
- 32 bytes (random per user)
- Vault Key Size
- 256 bits (32 bytes)
- Session TTL
- 4 hours (auto-lock)
- Transport
- HTTPS (TLS 1.2+)
- Format (text)
- iv:authTag:ciphertext (hex)
- Format (files)
- IV‖authTag‖ciphertext (binary)
- Quantum Resistance
- AES-256 (NIST post-quantum safe)
Knockout CLI Security
Defense-in-depth for your code, credentials, and sessions
Knockout is built with the same security-first mindset as Fight Club. Your code never leaves your machine unencrypted, API tokens are hashed and scoped, and every layer — from the CLI to the platform API — is hardened against real-world threats.
Authentication & Tokens
Scoped API Tokens
Each CLI token has fine-grained scopes — session:create, sync:push, config:write, etc. Tokens are stored as SHA-256 hashes on the server; the full token is shown only once at creation and cannot be retrieved again. You control exactly what each token can do.
Vault Password in OS Keychain
Your vault password is stored in the OS keychain (macOS Keychain, Linux libsecret, Windows Credential Manager) — not in a plaintext config file. Existing plaintext passwords are automatically migrated to the keychain on first run.
Browser-Based OAuth Login
ko auth login opens a secure browser flow — you authenticate on the platform, and the CLI receives a scoped token automatically. No passwords are typed into the terminal. The flow includes CSRF state validation and reCAPTCHA bot protection.
Token Expiration & Revocation
Tokens can be created with expiration dates for time-limited access. Revoke any token instantly from the Settings page or via the API. Every token usage is tracked with lastUsedAt timestamps so you can audit activity.
Code & Data Protection
Zero-Knowledge Snapshots
Code snapshots pushed via ko sync push are encrypted on your machine before upload using AES-256-GCM with a key derived from your vault password (scrypt). The platform stores only ciphertext — it cannot read your code. Only you can decrypt it.
Encrypted Sessions & Pipelines
When your vault is unlocked, session messages and pipeline configurations are encrypted with your vault key before storage in the database. When your vault is locked, encrypted data is inaccessible — the server returns a “vault locked” response instead of plaintext.
File Tool Boundaries
The CLI's file read/write/edit tools are restricted to your project's working directory. Symlink escapes are detected and blocked. Access to sensitive paths like ~/.ssh, ~/.aws, and ~/.gnupg is denied by a hardcoded denylist.
Command Injection Prevention
The CLI detects and blocks compound shell commands (pipes, semicolons, backticks, subshells) in tool calls. Dangerous commands always require explicit user approval. Server-side admin commands use execFile (no shell) with strict input validation.
Platform API Hardening
Rate Limiting on Every Endpoint
All 34 Knockout API endpoints are rate-limited with tiered limits — 5/min for auth endpoints, 20/min for resource creation, 30/min for mutations, 60/min for reads. In-memory sliding window per IP prevents brute-force and abuse.
CSRF Protection
Every mutating API request (POST/PUT/DELETE) from the browser is validated against Origin/Referer headers. CLI requests authenticate via Bearer tokens and bypass CSRF (stateless, no cookies). This prevents cross-site request forgery from malicious websites.
Input Validation
All inputs are validated with strict constraints — field lengths, type checks, enum whitelists, regex patterns, and semver format checks. Hostnames, SSH users, and ports are validated with allowlist patterns. No unbounded inputs reach the database.
Security Headers
HSTS (1 year), X-Frame-Options DENY, strict Content-Security-Policy, X-Content-Type-Options nosniff, and strict Referrer-Policy are enforced on every response via Next.js middleware. Frame-ancestors set to none prevents clickjacking.
Supply Chain & Integrity
Signed Binary Updates
CLI self-updates are verified with Ed25519 digital signatures. The signing public key is embedded in the binary at build time. If a downloaded update doesn't match its signature, it is rejected — protecting against MITM attacks and tampered binaries.
Signed Skill Marketplace
Skills installed from the marketplace are verified with Ed25519 signatures. Unsigned global skills are blocked unless explicitly trusted by the user. Project-level skills (in your repo) are loaded without signature requirements since they're under your version control.
Secure Local WebSocket
The CLI's local Web UI WebSocket server binds to 127.0.0.1 only, validates Origin headers, and requires a one-time cryptographic nonce for connection. Malicious websites and local processes cannot connect without the nonce.
Token-Free Streaming
SSE connections use one-time stream tickets (30-second TTL, single-use) instead of embedding API tokens in URLs. This prevents token leakage through server access logs, proxy logs, and browser history.
Knockout Technical Specifications
- Token Storage
- SHA-256 hash (server), OS keychain (client)
- Snapshot Encryption
- AES-256-GCM (scrypt-derived key)
- Session Encryption
- AES-256-GCM (vault key)
- Binary Signatures
- Ed25519 (SHA-256 digest)
- Skill Signatures
- Ed25519 (SHA-256 digest)
- CSRF Protection
- Origin/Referer header validation
- Rate Limiting
- In-memory sliding window (5-60 req/min)
- WebSocket Auth
- Nonce + Origin validation
- Stream Auth
- One-time tickets (30s TTL)
- File Boundaries
- Working directory + sensitive path denylist
- Transport
- HTTPS (TLS 1.2+)
- Token Scopes
- 7 granular permissions