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

LayerAlgorithm / PrimitiveSpecification details
Vault records & key wrapsXChaCha20-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 storageChunked 64 KiB streaming XChaCha20-Poly1305 AEADPer-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 KDFArgon2id v1.3 via libsodium crypto_pwhashDefault 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 hierarchyBIP-39 (12 words default / 24 optional) → PBKDF2-HMAC-SHA512 (2048) → HKDF-SHA256Derives 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 & sessionsPer-device Ed25519 keypair + signed challenge → 5-minute HMAC access tokenEnrollment 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 NumbersX25519 crypto_box_seal + Ed25519 signed invites + SHA-256 Safety NumbersVault 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 passkeysiOS/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 pairingEphemeral X25519 channel (PairingDO, 120s TTL) + 6-digit HMAC confirmationExisting 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 verificationSingle 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.

Cryptography & security FAQ

Technical answers about XChaCha20-Poly1305, phrase rotation, file chunk AEAD, and audit status.

Why does Liso use XChaCha20-Poly1305 instead of AES-GCM?

XChaCha20-Poly1305-IETF uses 192-bit (24-byte) random nonces instead of AES-GCM's 96-bit (12-byte) nonces, eliminating practical nonce-collision risk during distributed multi-device sync, avoiding software AES timing side channels on devices without AES-NI, and shipping consistently across every platform via libsodium.

Can I rotate my recovery phrase without breaking shared vaults or changing my Liso ID?

Yes. Unlike architectures that deterministically derive identity keys from a seed phrase, Liso generates a random 256-bit Account Master Key (AMK) and random Ed25519/X25519 identity and sharing keys. The BIP-39 recovery phrase only wraps the AMK and derives a Recovery Auth key—so rotating an exposed phrase re-wraps the AMK without altering your Liso ID, shared vaults, or Safety Numbers.

Has Liso 2 undergone an independent external security audit?

Not yet. Liso 2 has completed a thorough internal security self-audit covering cryptography, QR pairing, autofill clickjacking, MCP isolation, server authorization, and client hardening (all High findings fixed). An independent external review of packages/crypto-spec and server/sync is planned before general availability, and its full report will be published publicly.

How are encrypted files protected against server truncation or chunk swapping?

Every file receives a random 256-bit DEK and a binary header (LISO2F\x00\x01 || file_id || chunk_size). Files are split into 64 KiB chunks encrypted with XChaCha20-Poly1305 where each chunk's AAD cryptographically binds ('liso/v2/file', file_id, chunk_idx_u64, is_final_u8, SHA256(header)). Reordering, duplicating, swapping across files, or truncating before the final chunk fails AEAD verification immediately.