Kopya crypto test vectors ========================= Files in this folder (https://kopya.uk/security/): crypto-vectors.json fixed inputs and the exact outputs of Kopya's encryption formats kopya-crypto-format.md the format specification these vectors belong to verify-vectors.js a Node.js script that checks the vectors with node:crypto only README.txt this file ALL VALUES ARE PUBLIC TEST DATA. The passwords, keys, IVs and salts are made up (most are counting byte patterns such as 00 01 02 ...). They belong to no account. Never use them for real data, and never use a fixed IV in real code: real clients use a fresh random IV for every encryption. What the vectors cover ---------------------- kdf_argon2id password -> Argon2id -> secret -> HKDF -> auth_key and KEK kdf_pbkdf2_legacy the older PBKDF2 derivation, still readable for older accounts wrapped_master the master key sealed with the KEK node_meta encrypted file metadata (name, type, size, date) note_content an encrypted note body file_key a file key sealed with the master key chunks two content chunks, each with its index/count AAD thumbnail a thumbnail sealed with the AAD "thumb" recovery_key the recovery key and the master key sealed with it share a share key, its link fragment, and a password-protected share How to use them --------------- An implementation (in any language) should: 1. reproduce every derived value from the stated inputs (secret, auth_key, KEK, the share verifier and wrap key); 2. decrypt every ciphertext to the stated plaintext, and refuse it when the AAD or a single byte is changed; 3. optionally, encrypt again with the fixed IV and get identical bytes. Quick check with Node.js 16 or newer (no packages needed): node verify-vectors.js crypto-vectors.json Argon2id is not part of Node's built-in crypto. To check the Argon2id vector, use any Argon2 library, for example PHP with the sodium extension: php -r "echo bin2hex(sodium_crypto_pwhash(32, 'correct horse battery staple', hex2bin('000102030405060708090a0b0c0d0e0f'), 3, 67108864, SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13)), PHP_EOL;" or Python with argon2-cffi (pip install argon2-cffi): python -c "from argon2.low_level import hash_secret_raw, Type; print(hash_secret_raw(b'correct horse battery staple', bytes(range(16)), 3, 65536, 1, 32, Type.ID).hex())" Both should print 0d1a3c6523c8f06e4e0af9c515aa5b5448cfebd6838f2d52c3d8b6ef8ddc3c2e. Provenance ---------- The vectors were generated on 2026-10-01 by running Kopya's web client encryption code with fixed inputs. Each one was then checked with that same code, and independently with PHP/OpenSSL (AES-GCM, HKDF, PBKDF2) and libsodium (Argon2id). The "_comment" field inside the file is the original generation note. Before publishing on 2026-10-30 they were checked again with PHP/OpenSSL and libsodium (22 checks, no failures). Questions or problems: support@kopya.uk