Zero-Knowledge

Zero-Knowledge password vault

Your passwords, API keys, and secrets — encrypted so that even the server cannot see them. Mathematically proven privacy.

Dual-layer crypto architecture

Company Safe and Personal Vault use different encryption — each optimized for its use case.

Company Safe

Server-side encryption (Laravel Crypt, AES-256-CBC)

  • Admin and folder-authorized users can view
  • Data preserved when employee leaves
  • Folder sharing: user, role, department
  • Audit log for every access

Personal Vault

Client-side Zero-Knowledge (HKDF + AES-256-GCM)

  • ONLY the owner can see the data
  • Server never knows the plaintext
  • Password lost — data gone. That's the guarantee
  • Even admin cannot access

HKDF key derivation

Architecture inspired by Bitwarden/1Password, where encryption key and authentication key are derived as mathematically separate branches.

1

Master password

User-chosen password — minimum 8 characters.

input: user password
2

PBKDF2 stretching

Master password + random 16-byte salt → 100,000 iterations of HMAC-SHA256. Slows down brute-force attacks.

PBKDF2(SHA-256, password, salt, 100K) → preKey
3

HKDF stretch

HKDF-Expand adds an extra security layer, deriving preKey into a specific stretchedMasterKey.

HKDF-Expand(SHA-256, preKey, "tresoor-stretch") → stretchedMasterKey
4

Encryption key (encKey)

AES-256 key used for data encryption. NEVER leaves the browser — the server does not know it.

HKDF-Expand(stretchedMasterKey, "vault-enc") → encKey
5

Authentication key (authKey)

Separate branch for password verification. SHA-256 hash is sent to server — server verifies but cannot derive encKey.

HKDF-Expand(stretchedMasterKey, "vault-auth") → authKey → SHA-256 → hash
stretchedMasterKey
HKDF("vault-enc")encKeybrowser only
HKDF("vault-auth")authKey → SHA-256hash to server

Zero-Knowledge guarantees

Mathematical guarantees that hold even in case of server compromise.

Server never sees plaintext

Encryption happens only in the browser (Web Crypto API). The server stores and returns only ciphertext.

Server doesn't know encKey

Server only holds auth_key_hash — SHA-256 from a separate HKDF branch. No mathematical relation to encKey.

enc ≠ auth

HKDF ensures that "vault-enc" and "vault-auth" branch outputs are cryptographically independent.

Password lost — data gone

There is NO recovery mechanism. This is a core property of Zero-Knowledge architecture, not a flaw.

Admin cannot access

Personal vault returns HTTP 403 to admin requests. Not a policy restriction, but cryptographic — data is encrypted with user's key.

Timing-safe verification

Password verification uses hash_equals() — prevents timing side-channel attacks.

Threat model

Known attack scenarios and their mitigations.

High

Server compromise

Attacker obtains database clone with all encrypted records.

Defense: Personal vault protected by ZK — data is AES-256-GCM encrypted, encKey is not on the server.
High

Man-in-the-middle

Attacker intercepts API calls between user and server.

Defense: TLS 1.3 + HSTS. Even with interception, only encrypted data travels.
Medium

Brute-force attack

Attacker tries to guess the master password.

Defense: PBKDF2 100K iterations + rate limit (5 attempts / 15 min). Testing one password takes ~100ms.
High

XSS (script injection)

If attacker injects JS into the page, they could read encKey from memory.

Defense: Content Security Policy + Vue 3 automatic escaping. Known risk — CSP is the primary defense layer.
Medium

Insider threat (admin)

Company admin tries to read employee's personal vault.

Defense: API returns HTTP 403 — admin access is blocked at code level.
Low

Rainbow table attack

Pre-computed hash tables for breaking passwords.

Defense: Random 16-byte salt (2¹²⁸ combinations) — rainbow tables are impractical.

Cryptographic standards

AlgorithmStandardUsage
PBKDF2-HMAC-SHA256RFC 2898Password → preKey
HKDF-SHA256RFC 5869Key expansion & separation
AES-256-GCMNIST SP 800-38DAuthenticated encryption
SHA-256FIPS 180-4Auth key hashing
Web Crypto APIW3CBrowser-native cryptography

Crypto parameters

  • PBKDF2 — 100 000 iterations
  • AES-GCM — 256-bit key, 96-bit IV
  • master_salt — 128-bit (16 bytes) random
  • auth_key_hash — SHA-256 (256-bit → 44 Base64 chars)
  • HKDF info — "tresoor-stretch", "vault-enc", "vault-auth"

Your data, your control

Tresoor Vault ensures your passwords and secrets are protected with bank-level encryption — even we cannot read them.