When you type your password on a website, it goes to the server. Encrypted on the way thanks to HTTPS, but in the clear when it arrives. The server receives it, hashes it, compares it with what it has stored, then (normally) forgets it.
We all trust that “normally” without thinking about it. While working on Rypt, my end-to-end encrypted cloud project, I couldn’t afford to: if the server sees the password, it can use it to recover the keys that protect the files. So I used OPAQUE, a protocol that lets you prove to the server you know your password without ever sending it, not even hashed.
Here’s how it works, without heavy maths (well, almost).
The problem with a regular sign-in
A regular sign-in goes like this:
- You send your username and password.
- The server computes a hash of the password (with bcrypt or Argon2) and compares it with the one it stored at signup.
- If they match, you’re in.
Storing a hash rather than the password is good practice, and it protects you well if the database is stolen. But it leaves a gap: at every sign-in, the server sees the password in the clear. And there are plenty of places it can leak:
- Logs. In 2018, Twitter asked its 330 million users to change their passwords after finding that a bug was writing them in the clear to internal logs. In 2019, we learned Facebook had done the same for hundreds of millions of accounts, for years.
- Middleboxes. HTTPS often ends before the actual server: at a reverse proxy, a load balancer or a CDN. Everything behind it sees the password.
- A compromised server. Someone who controls the server doesn’t even need to steal the database: they just have to wait for users to sign in.
- The admin. It sounds silly, but you have to trust them not to look.
For a regular website, that’s an accepted risk. For an end-to-end encrypted service, where the password also protects your data, it’s a deal-breaker.
The idea: prove without showing
Cryptographers have a family of protocols for this: PAKEs (Password-Authenticated Key Exchange). The principle: the client and the server run an exchange that only succeeds if the client knows the right password, and at the end, both share a secret key. The password itself never travels.
OPAQUE is a so-called “augmented” PAKE: the server doesn’t store the password, nor anything that would make it easy to guess. It was published in 2018 by Stanisław Jarecki, Hugo Krawczyk and Jiayu Xu, selected in 2020 by the IETF’s cryptography research group, and became a standard in 2025 as RFC 9807.
To understand how it works, you only need one building block: the OPRF.
The magic piece: the OPRF
An OPRF (Oblivious Pseudo-Random Function) is a two-party computation:
- the client has some input (the password);
- the server has a secret key;
- at the end, the client gets a result that depends on both.
The server learns nothing about the password, and the client learns nothing about the server’s key.
In practice, the envelope is a random number. For those who are curious, here’s what it looks like, with H(pwd) the password turned into a point on an elliptic curve, r a random number picked by the client and k the server’s secret key:
Client → Server : r × H(pwd) (the "blinded" password)
Server → Client : k × r × H(pwd) (the server applies its key)
Client : ÷ r → k × H(pwd) (the client removes the blind)
The server only sees r × H(pwd), which looks like a random point since r changes every time. The client gets k × H(pwd) without knowing k. That result is the same at every sign-in, but only someone who knows the password and goes through the server can compute it.
OPAQUE, step by step
At signup
- The client runs the OPRF with the server and gets a secret result, which it also feeds through Argon2, a deliberately slow function, to make brute-force attacks harder.
- From that result, it builds a key pair (a private one, a public one) and an encrypted envelope that lets it recover its private key.
- It sends its public key and the envelope to the server.
The server stores those two things and its OPRF key for that account. No trace of the password.
At sign-in
- The client blinds the password and sends it to the server, along with the start of a key exchange.
- The server applies its OPRF key and sends back the result, the encrypted envelope and its part of the key exchange.
- The client removes the blind, gets the same secret result as at signup, opens the envelope and recovers its private key. With a wrong password, the result is different and the envelope won’t open.
- Both finish the key exchange (a triple Diffie-Hellman, for the curious), and the client sends proof that it made it to the end.
At the end, the client and the server share a session key, and each has authenticated the other. The server knows you know the password. You know you’re talking to the right server, since a fake one wouldn’t have the right OPRF key and couldn’t rebuild your envelope.
What it changes
The server never sees the password. Not at signup, not at sign-in. Logs, proxies and the admin have no access to it, and a hacked server can’t grab it by waiting for you to sign in.
A stolen database isn’t enough for a ready-made attack. With a regular sign-in, an attacker can prepare their computations in advance. With OPAQUE, the password’s “salt” is the server’s OPRF key, which is never sent. That rules out any attack prepared ahead of time: the attacker has to steal the database and the server’s secrets, then attack each account one by one, with a pass through Argon2 for every guess.
You get a secret key as a bonus. OPAQUE gives the client an export key, derived from the password, that the server doesn’t know. That’s exactly what an end-to-end encrypted service needs. In Rypt, it’s what opens the account’s master key: the same password signs you in and decrypts your files, without the server being able to do either on your behalf.
What about SRP?
OPAQUE isn’t the first augmented PAKE. SRP, from 1998, does a similar job and is used by Proton, 1Password and Apple’s iCloud Keychain.
Its main weakness: the server sends the account’s salt before the client authenticates. Anyone can ask for it, so an attacker can prepare a dictionary attack before even stealing the database. OPAQUE fixes that with the OPRF: the salt is never revealed. SRP is still a fine choice, but for a new project, OPAQUE is stronger and it’s now standardized.
Who uses it?
It’s not widespread yet, but it’s not obscure either. The biggest deployment is probably WhatsApp, which has used it since 2021 for end-to-end encrypted backups: your backup password never leaves your phone.
On the code side, the reference library is opaque-ke, in Rust, developed at Meta and audited by NCC Group. It’s the one I use in Rypt, compiled to WebAssembly to run in the browser. There’s also libopaque in C, with bindings for plenty of languages.
The limits
OPAQUE is great, but it isn’t magic.
- It needs client-side code. A plain HTML form won’t do: the browser has to run the computations, so you need JavaScript or WebAssembly. And on the web, the server delivers that code: a malicious server could serve a version that quietly sends the password. That’s the limit of all in-browser crypto, and only native apps or verifiable builds really solve it.
- A weak password is still weak. OPAQUE rules out precomputed attacks and slows down every guess, but if the database and the server’s secrets leak,
password123will still fall. And online guessing is still possible: you still have to rate-limit attempts. - It doesn’t protect against phishing. If you type your password on a fake site, it grabs it before the protocol even starts.
- It’s more complex. Three messages instead of one, a crypto library to integrate, parameters to pick. For a blog with a members’ area, it’s probably overkill.
And for many websites, the real answer may be to drop passwords altogether, with passkeys. But when the password also encrypts your data, as in an encrypted cloud or a password manager, you do need a secret you know, and OPAQUE is today the best way to use it.
In short
- With a regular sign-in, the server sees your password in the clear every time you sign in.
- OPAQUE lets you prove you know it without ever sending it, thanks to an OPRF, a “blind” computation between the client and the server.
- The server stores nothing that would let anyone prepare an attack in advance, and the client gets a secret key along the way that the server doesn’t know.
- It’s been a standard since 2025 (RFC 9807), it’s used by WhatsApp, and there are good libraries to integrate it.
If you’re building a service where the password protects more than just access, it’s well worth a look.