# Hardening vault passwords without OPAQUE

> How Henedo makes a stolen database useless for password guessing with a server-held key that never touches the database, and why a future quantum attacker ruled out OPAQUE.

- Author: Flavian Ene
- Published: 2026-11-30
- Topic: Security
- Canonical: https://eflavian.com/writing/hardening-vault-passwords-without-opaque/

In an end-to-end encrypted product, the password that unlocks the vault is usually the weakest part of the design. Not because the cryptography is weak, but because of what the server has to store.

The common pattern looks like this. The browser stretches the password with a memory-hard function, derives a key-encryption key, and uses it to encrypt a random master key. The server stores the encrypted master key and the salt. The server never sees the password, which is true and worth saying. But anyone who obtains a copy of that database (a leaked backup, a misconfigured bucket, an insider) can now test password guesses offline, at whatever speed their hardware allows, for as long as they like.

Argon2id makes each guess expensive. It does not make a guessable password safe. And for [Henedo](https://eflavian.com/work/henedo/), where the data is meant to outlive the people who wrote it, "a determined attacker eventually gets in" is not an acceptable failure mode.

So the design goal was narrow and concrete: **a copy of the database should contain nothing a password guess can be tested against.** Every guess should have to go through a live server that counts it.

## The obvious answer, and why I didn't use it

This is exactly the problem that asymmetric password-authenticated key exchange was designed for. OPAQUE is the modern, well-analysed option: the server holds a secret OPRF key, the client obtains a hardened output from its password without revealing the password, and an attacker who steals the database still needs the OPRF key before a single guess can be checked.

I considered it carefully and decided against it, for one reason specific to this product.

Deployed OPRFs are built on elliptic-curve groups. During the protocol the client sends a blinded element derived from the password, and the server returns that element multiplied by its secret key. Both values cross the network. For a classical attacker this is fine. For an attacker with a cryptographically relevant quantum computer, one recorded exchange is enough to solve the discrete logarithm, recover the server's OPRF key, and resume offline guessing against every stolen record.

That is a "harvest now, decrypt later" risk on the password path itself. For most applications it is a reasonable trade-off. For an archive whose whole promise is that it can be opened decades from now, I did not want any part of the unlock path to depend on a problem that Shor's algorithm solves.

## What I built instead

The construction Henedo uses is entirely symmetric. A versioned key ring `K` is held as a secret of the edge functions. It is never written to the database, to the database's secret store, or to backups.

Simplified, an unlock looks like this:

```text
browser  S   = HKDF(Argon2id(password, salt), "stretch")
         T   = HKDF(S, "query")              → sent to the server

server   M   = HMAC(K, label ‖ user_id ‖ salt ‖ T)
         V   = HKDF(M, "verifier")           stored, server-only
         H   = HKDF(M, "output")             returned only if V matches

browser  KEK = HKDF(S ‖ H, "kek")
         MK  = AES-256-GCM-Decrypt(KEK, encrypted_master_key)
```

The exact labels and parameters are in Henedo's [published security document](https://henedo.com/SECURITY.md). Three properties matter.

**A database copy is inert.** To test a guess you need `M`, and `M` needs `K`. The stored verifier `V` is itself derived from `M`, so it confirms nothing without the key ring.

**The server never holds an unlock key.** The key-encryption key mixes `S`, which only the browser has, with `H`. Even with the database and `K` together, Henedo would still have to guess the password, and every guess would cost a full Argon2id evaluation at 128 MiB, three iterations, four lanes.

**Every guess is counted.** The only way to obtain `H` is a request the server sees. That is where rate limiting lives: five wrong attempts in a row are free, then the waits grow: 1, 4, 16 and 64 minutes, then hours, then a full day each. Only a correct or newly set password resets the counter, and the next successful unlock reports how many wrong attempts came before it.

## The subtle part: one salt, one issuance

The first version of a design like this usually has a hole in it, and this one is worth spelling out.

Setting a new password is also a way to obtain a hardening value: the browser sends `T` for a fresh salt, and the server returns `H`. If the server would issue values for any salt, someone with a valid session could request them under the victim's *existing* salt for a list of candidate passwords, then test each candidate against the stored envelope offline. The rate limit on unlock would be bypassed entirely.

So every salt a hardening value has ever been issued for is recorded, and a reused salt is refused. The only remaining way to test a guess is a counted unlock.

## What it costs

No design is free, and the costs here are real.

- **Password unlock needs the server.** Offline, the recovery key is the way in; Henedo's standalone decryptor opens an export with it. That is a deliberate trade, but it is a trade.
- **The key ring becomes a crown jewel.** `K` is versioned, carries a short fingerprint so envelopes know which key they were made under, and can be rotated. It still has to be protected like what it is.
- **An attacker with the database and `K` can still guess** at full Argon2id cost. That is why there is a strength floor: a vault password must be estimated to need at least 10<sup>10</sup> guesses, checked again with spaces and dashes removed. For people who want no password at all, Henedo's highest protection level removes it and relies on passkeys, a recovery key and paired devices instead.

There is also a useful side effect. Because the server participates in every password unlock, it can reliably email the account owner when a new device opens the vault. A modified client cannot skip that step, because without the server's output it cannot unlock anything.

## The general lesson

OPAQUE is the more elegant protocol, and for most products I would still recommend it. The point is not that it is wrong; it is that the threat model decides. When the data has to stay private for a lifetime, the boring construction made entirely of symmetric primitives (HMAC, HKDF, AES-GCM, Argon2id) gives up some elegance and keeps nothing for a quantum computer to break later.

And whatever you build, write down what it does not protect. Henedo's security document lists the case above as a known limit, in plain words: database plus key ring means offline guessing at full cost. People can only trust what they can check.
