Spec ID: liso-crypto-v2 · Apache-2.0 · libsodium
Liso Vault v2 Cryptography & Security Architecture
Liso Vault v2 encrypts every password, item title, note, 2FA secret, and file on your device using standard, published algorithms via libsodium—specifically XChaCha20-Poly1305-IETF, Argon2id (64 MiB), HKDF-SHA256, Ed25519, and X25519 sealed boxes. Both the Dart (liso_crypto) and TypeScript (@liso/crypto-ts) implementations pass 100% of shared known-answer test vectors.
Key hierarchy: random Account Master Key, rotatable recovery phrase
Your Account Master Key (AMK), Ed25519 identity key, and X25519 sharing key are generated randomly—not derived deterministically from your recovery phrase. Your BIP-39 phrase, master password, and device-local quick unlock methods only wrap the AMK, letting you change your password or rotate an exposed recovery phrase without re-encrypting your vault or altering your Liso ID and Safety Numbers.
Recovery Phrase (BIP-39, 12 words default / 24 optional)
└─ PBKDF2-HMAC-SHA512 (2048 iter) → 64-byte seed
├─ HKDF-SHA256("liso/v2/recovery-kek") → Recovery KEK ──┐
└─ HKDF-SHA256("liso/v2/recovery-auth") → Recovery Auth Ed25519 key (challenge/response)
│
Master Password → Argon2id (64 MiB, t=3, p=1, 16B salt) → Password KEK ──┼─ wraps ─▶ Account Master Key (random 256-bit)
Quick Unlock (device-local, never synced): │ │
• Biometrics (Secure Enclave / Android Keystore) ──────────────┤ ├─ wraps ─▶ Account Keyset (random Ed25519 + X25519)
• PIN (6–12 digits, Argon2id, 5 tries then wiped) ─────────────┤ │ └─ crypto_box_seal ─▶ Shared Vault Keys
• Passkey (WebAuthn PRF → HKDF "liso/v2/passkey-kek") ─────────┘ │
└─ wraps ─▶ Personal Vault Keys (per key_epoch)
├─ HKDF("liso/v2/record") → Item AEAD (XChaCha20-Poly1305)
└─ HKDF("liso/v2/file-wrap") → Per-file random 256-bit DEK (64 KiB chunks)Vault v2 cryptographic primitives and parameters
| Layer | Algorithm / Primitive | Specification details |
|---|---|---|
| Vault records & key wraps | XChaCha20-Poly1305-IETF (libsodium crypto_aead_xchacha20poly1305_ietf) | 256-bit key, 24-byte random nonce per encryption, 16-byte Poly1305 tag, canonical length-prefixed AAD binding (domain label, vault_id, record_id, record_type, key_epoch, rev). Max record ciphertext 256 KiB. |
| Encrypted file storage | Chunked 64 KiB streaming XChaCha20-Poly1305 AEAD | Per-file random 256-bit DEK wrapped by HKDF('liso/v2/file-wrap'). Binary header LISO2F\x00\x01 || file_id(16) || chunk_size_u32 bound into every chunk's AAD with chunk_idx_u64 and is_final_u8 to detect truncation, reordering, or splicing. |
| Master password KDF | Argon2id v1.3 via libsodium crypto_pwhash | Default 64 MiB memory (m=65536 KiB), t=3 passes, p=1 parallelism, 16-byte random salt, 32-byte Password KEK stored with per-slot parameters so parameters can upgrade without breaking older slots. |
| Recovery phrase & key hierarchy | BIP-39 (12 words default / 24 optional) → PBKDF2-HMAC-SHA512 (2048) → HKDF-SHA256 | Derives Recovery KEK ('liso/v2/recovery-kek') and Recovery Auth Ed25519 key ('liso/v2/recovery-auth'). Account Master Key (AMK), Identity Ed25519 key, and Sharing X25519 key are random so recovery phrases can be rotated without changing your Liso ID, shared vaults, or Safety Numbers. |
| Device enrollment & sessions | Per-device Ed25519 keypair + signed challenge → 5-minute HMAC access token | Enrollment statement signed by account Identity Ed25519 key and verified by AccountDO. Short-lived 5-minute tokens with no refresh tokens; revoking a device closes its WebSocket with code 4001 and blocks all vault writes immediately. |
| Shared vaults & Safety Numbers | X25519 crypto_box_seal + Ed25519 signed invites + SHA-256 Safety Numbers | Vault keys are sealed directly to each member's X25519 public key. Clients refuse new keys if a member's identity key changes until re-verified. Removing a member increments key_epoch and rotates the vault key. |
| Quick unlock (device-local, never synced) | Hardware Keychain/Keystore biometrics, Argon2id PIN (6–12 digits), WebAuthn PRF passkeys | iOS/macOS kSecAccessControlBiometryCurrentSet, Android Keystore BiometricPrompt CryptoObject, 5-attempt wiping PIN slot, and WebAuthn PRF HKDF ('liso/v2/passkey-kek'). Master password required every 14 days for PIN/passcode. |
| Hardened QR device pairing | Ephemeral X25519 channel (PairingDO, 120s TTL) + 6-digit HMAC confirmation | Existing device re-authenticates, inspects new device platform and approximate location, shows a 6-digit code typed on the new device, and verifies HMAC(code, transcript) (3 attempts max) before sealing the AMK. |
| Cross-platform verification | Single C libsodium core across Dart (liso_crypto) and TypeScript (@liso/crypto-ts) | Both implementations pass 100% of shared JSON test vectors in packages/crypto-spec/vectors/, including AAD tamper, truncation, reordering, and legacy Liso v1 known-answer tests. |
Threat model: exact server-visible metadata & integrity bounds
Honest zero-knowledge architecture states exactly what the server can and cannot observe. Because item ciphertexts are authenticated with canonical tuple AAD T("liso/v2/record", vault_id, record_id, record_type, key_epoch, rev), a compromised server cannot substitute records across vaults or silently replay older revisions.
Never visible to the server
- Master password, BIP-39 recovery phrase, PINs, or biometric keys
- Account Master Key (AMK), vault keys, or file DEKs
- Item titles, usernames, passwords, URLs, notes, tags, or 2FA secrets
- File names, MIME types, file contents, or local RAM previews
- Local MCP audit logs or email addresses (no email sign-in exists)
Operational metadata visible to the sync server
- Random account UUIDv7, public Liso ID, and public Ed25519 / X25519 keys
- Vault IDs, record IDs, record types (item/folder/template), ciphertext byte sizes, revision counts, and timestamps
- Device names, platforms, last-seen times, and revocation status
- Shared-vault membership graph and roles (Owner, Admin, Editor, Viewer)
- Transient pairing city/country hint (held max 2 minutes, never stored) and rate-limiting IP hashes
Current security audit status
Liso 2 has completed an internal security self-audit covering cryptography, QR pairing approver flows, browser extension clickjacking defenses, MCP token isolation, server authorization, and client memory/lock hardening—all High-severity issues identified were remediated. An independent external cryptographic and protocol audit of packages/crypto-spec and server/sync is planned prior to general availability, and its full report will be published publicly.