1001Ferramentas
🔐Security

HIBP K-Anonymity Format

Explains the Have I Been Pwned k-anonymity flow: SHA-1 password, first 5 chars on GET, suffix returned.

O cálculo é 100% local no seu navegador (SHA-1 via Web Crypto) — nada é enviado.

O serviço Pwned Passwords usa k-anonymity para nunca receber a senha completa.

  1. Compute o SHA-1 da senha em maiúsculas hex (40 chars)
  2. Envie um GET https://api.pwnedpasswords.com/range/<PRIMEIROS_5>
  3. O servidor responde com lista de sufixos (35 chars) + contagem
  4. Procure seu sufixo nessa lista localmente

Assim, o servidor nunca recebe a senha nem o hash completo.

How HIBP checks a password without reading it

You want to know whether a password shows up in known breaches, but handing the whole password to someone else's server feels wrong. The Have I Been Pwned k-anonymity protocol solves that, and this page walks the exact request with your own input: type a password and watch the hash split into the part that leaves and the part that stays.

The flow has four steps. Compute the password's SHA-1 as 40 uppercase hex characters. Send a GET to api.pwnedpasswords.com/range/ followed by the first five characters. The server answers with hundreds of 35-character suffixes, each with an occurrence count. You then search for your suffix in that list, on your own machine. The SHA-1 here is computed by the browser's Web Crypto API.

One thing to be clear about: this page never calls the API. It formats and explains the request, and gives you a button to copy the finished URL — running the GET and grepping for your suffix is your job, in a terminal or in your code. The password field is a plain text input with no masking, so mind shoulder surfers and screen recordings. If the password is real and in use, rotate it after testing anyway.

Frequently asked questions

Does this tell me if my password was breached?
No. It builds the hash and the range URL. You run the lookup afterwards with curl or your language's HTTP client and compare your suffix against the returned list.
Does my password leave the browser?
Not from this page: SHA-1 is computed locally through Web Crypto. And even when you fire the request yourself, only the first five hash characters travel.
Why SHA-1 instead of SHA-256?
The Pwned Passwords corpus was built that way and the endpoint stayed compatible. Known SHA-1 collisions do not undermine a plain key lookup like this one.

Related Tools