How to check if your passwords have leaked, without uploading them

A password leak is not an event you notice. Nothing crashes, no alarm sounds. Your password quietly joins a list that gets sold, reshared and eventually pasted into a text file on a forum. The only way to find out is to check — and the obvious way to check is the one you should not use.

The problem with "paste your password here"

There are hundreds of pages that offer to test a password's strength or tell you whether it has leaked. Many of them work by sending the password to their server. Some hash it first; some don't. Either way, for the moment it takes to answer, a stranger's computer holds the exact string that unlocks your account.

That is a strange trade. You are trying to find out whether a secret is exposed by handing it to someone you have never met. A well-run service will delete it immediately. A badly run one logs the request body by default, keeps it in an analytics tool, or gets breached itself — and now your password is in a second leak, this one caused by the check you ran to avoid a leak.

The rule that follows is simple: a password should never leave the device it was typed on.

How a breach check works without the password

Breach databases are built from one thing: SHA-1 hashes of leaked passwords. Troy Hunt's Pwned Passwords collection holds more than 900 million of them, each stored as a 40-character hex hash rather than plain text.

That gives you a way to ask a question without revealing the secret. Your browser can hash the password itself — the Web Crypto API does it in a millisecond — and then ask about the hash instead.

Asking about the full hash is still too much. A hash is a perfect fingerprint: send it and the server knows exactly which password you hold, even though it never sees the text. So the request is cut down further.

The five-character trick

Take the hash, send only its first five characters, and keep the rest on your machine.

password → 5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8
send:  5BAA6
keep: 1E4C9B93F3F0682250B6CF8331B7EE68FD8

The service replies with every hash in its database that starts with 5BAA6 — typically several hundred. Your browser then looks for the remainder it kept. A match means the password is in the breach data. No match means it isn't.

The server learned that someone, somewhere, asked about the 5BAA6 bucket. It did not learn which of the hundreds of passwords in that bucket you hold, and it cannot reverse the hash anyway. This is k-anonymity: you hide inside a crowd of k people asking the same question. Breachbeam uses exactly this — the only network request it makes during a scan is that five-character prefix.

What a scan can and cannot tell you

A scan answers one question: has this exact password appeared in public breach data? It cannot tell you:

  • Which account it belongs to. The data is a list of passwords, not a map of accounts.
  • Whether your account was breached. A leaked password does not prove someone used it against you.
  • Whether a password is "safe". A password absent from the list can still be weak, guessable, or leaked tomorrow.

Treat a hit as urgent and a miss as an ordinary result, not a clean bill of health.

Reading the results

Breachbeam groups hits into three rough bands, because "leaked" and "leaked ten million times" are different situations.

  • Widely leaked — the count is high enough that automated tools will try it first, on every site, forever. Retire it everywhere, immediately.
  • Leaked — it appears in at least one breach. Change it wherever it is used.
  • Not found — no match in the current dataset. Fine, provided it is long and unique.

The useful detail is often not the hit itself but the duplicates in your own list. If one password appears next to four different usernames, you have found the pattern that turns a single breach into five compromised accounts — the exact mechanism behind credential stuffing.

Doing it safely

If you want to check a whole export, run it on a device you trust, in a browser with no extensions you don't recognise, and close the tab afterwards. Breachbeam parses the file with the File API, hashes each password locally, sends only prefixes, and writes nothing to disk, localStorage or cookies — but the general principle matters more than any one site: the checking tool should never be able to see what it is checking.

When you're done, replace what needs replacing with something generated, not invented. Randomness is hard to fake by hand, and it takes about four seconds to generate a strong password that nothing has ever seen before.