PQ Vault

How PQ Vault works

Plain-language design and threat model. No new cryptography is invented here.

Why post-quantum matters for backups ("harvest now, decrypt later")

Encrypted data copied today can be stored and attacked later. Public-key schemes based on elliptic curves or RSA (key exchange, signatures) would be broken by a large quantum computer; symmetric ciphers like AES-256 are only weakened (Grover's algorithm halves the effective key length, leaving ~128-bit security). So a backup that is encrypted to a public key — e.g. for an heir, a safe-deposit copy, or cloud storage you encrypt to a key without a shared passphrase — should use a post-quantum KEM. That's what the envelope does, in hybrid with X25519, so it stays secure if either assumption fails.

Honest note: when plain AES + passphrase is just as good

If you only ever encrypt with a strong passphrase on your own machine, AES-256-GCM with a high-cost KDF is already quantum-resistant, and the KEM adds nothing. The hybrid envelope is for the case where the encrypting party and the decrypting key holder differ, or you want to store the sealed secret in places that you can't protect with a passphrase.

Algorithms

PurposeAlgorithmLibrary
Key encapsulationML-KEM-768 (FIPS 203) + X25519 (RFC 7748), secrets concatenated and run through HKDF-SHA256 (salt binds both public keys, the ephemeral key and the KEM ciphertext)@noble/post-quantum, @noble/curves
EncryptionAES-256-GCM, 96-bit random nonce, header authenticated as AAD, plaintext padded to 256-byte blocksWebCrypto (browser built-in)
Signature (optional)ML-DSA-65 (FIPS 204) over SHA-256 of the whole envelope@noble/post-quantum
Passphrase wrappingscrypt (N=217, r=8, p=1) → AES-256-GCM@noble/hashes
Secret splittingShamir over GF(28), per-share checksum, protected reconstruction checksumthis repo (small, tested)

Key hierarchy

One random 32-byte recovery key → HKDF with domain labels → X25519 key, ML-KEM-768 seed, ML-DSA-65 seed. Because everything derives from 32 bytes, the secret you must preserve is tiny (easy to split or print). The public key is derived deterministically and can be shared freely.

Formats

pqv-pub-1. public key (3.2 KB) · pqv-key-1. passphrase-wrapped recovery key · pqv-env-1. envelope · pqv-shr-1. Shamir share · PQV1:id:i/n:… QR chunk. Envelope layout: magic, flags, ephemeral X25519 key (32 B), ML-KEM ciphertext (1088 B), nonce (12 B), [signer fingerprint], length, AES-GCM ciphertext, [ML-DSA signature 3309 B].

What this does not protect against

Tests

The repository includes a Node test suite (51 checks: round trips, tamper detection on every envelope region, wrong-key rejection, signature verification, Shamir for all thresholds, QR chunk reassembly, Bitcoin address parsing and verdict logic, a live explorer lookup). Run node test/run.mjs.

Cost & business model

Free. Hosted as static files; we receive no data. The operator accepts voluntary tips and also operates ZEC Route (a swap interface that earns a disclosed routing fee). Neither affects how the vault works.