Security Model
Forged is built on zero-knowledge architecture. Your master password and private keys never leave your machine. The sync server stores only opaque encrypted blobs it cannot read.
Encryption
Your master password is processed through Argon2id, a memory-hard key derivation function that resists GPU and ASIC attacks. The derived 256-bit key encrypts the vault using XChaCha20-Poly1305, the same AEAD cipher used by WireGuard and age. The 24-byte nonce is randomly generated on every write, eliminating nonce-reuse risk even across synced devices.
Key Hierarchy
The server authenticates you via OAuth (Google/GitHub) but has no access to the vault key. Authentication and encryption are completely separate concerns.
What the Server Sees
Threat Model
| Threat | Mitigation |
|---|---|
| Disk theft / lost laptop | Vault encrypted with Argon2id + XChaCha20-Poly1305. Without master password, vault is opaque bytes. |
| Server compromise | Zero-knowledge. Server stores only encrypted blobs. No plaintext keys ever leave the client. |
| Memory dump / swap | Key memory pages locked with mlock(). Daemon zeroes key material on shutdown. |
| Agent socket snooping | Socket file permissions set to 0600. Only the owning user can connect. |
| MITM on sync | TLS for transport. Vault payload independently encrypted with client-side key. Double encryption. |
| Master password brute force | Argon2id with high parameters (64MB memory, 3 iterations). Rate limiting on cloud login. |
| Rogue device | New device registration requires approval from an existing device. |
| Vault corruption | Atomic writes (tmp + fsync + rename). File locking prevents concurrent access. |
Memory Safety
Private keys are held in memory pages locked with mlock() to prevent swapping to disk. On shutdown, all key material is explicitly zeroed.
Known limitation:Go's garbage collector may copy heap objects before they are zeroed. We mitigate with mlock and best-effort zeroing. For production-grade mitigation, memguard or mmap-based allocation outside the Go heap is planned for a future release.
Open Source
Forged is source-available. Every line of code is auditable. The encryption implementation uses well-established Go standard library and golang.org/x/crypto packages, not custom cryptography.