Lazy Developer
Dev Stuff #11

Why won't 'Forgot password' just tell you your password? I built two sites to find out

I forgot a password and hit "Forgot password." The email didn't have my old password. Just a link saying "set a new password." Wouldn't it be easier to just tell me? Why won't they??

Experiment comparing a site that stores passwords as is with one that stores only hashes, showing the reset emails and leaked files

The answer is almost disappointing. The site doesn't know it either. I built two sites side by side to show it: one that saves your password as is, and one that only saves a hash.

Sites don't store your password

In the password special characters post, I compared hashing to a blender. You can turn fruit into juice, but you can't turn juice back into fruit.

A properly built site puts your password through that blender when you sign up and keeps only the juice. The original password gets thrown away.

So how does login work? It blends whatever you type the same way and checks whether the juice matches. If it does, you're in. It never needs to know what the fruit was.

So it can't "find" it for you

All the site has is juice, so there's no way to email you the original. That leaves one option.

1. Check you own the email (only someone who can open that inbox gets the link)
2. Send a link that only works for a short time
3. Take a new password and blend it again

It's called "forgot password," but it's really change password.

Try it: same password, two sites

Type a made-up password and press both buttons. Don't use a password you actually use. Nothing leaves the page, but the habit matters.

Site A kindly emails your password back. Kind, until its database leaks and everyone's password is readable.

Site B leaks nothing but gibberish. And kim and lee have the exact same password, yet their stored values look nothing alike.

Same password, different value?

Before blending, each user gets a random extra bit mixed in. That's called a salt. Same fruit, different pinch of salt, different juice.

Without a salt, the same password always gives the same value. An attacker could precompute results for common passwords and just look them up. With a salt, they have to start over for every single user, which is much slower.

The blender itself is also slow on purpose (bcrypt, Argon2 and the like). You won't notice the delay on one login, but an attacker trying hundreds of millions of guesses will.

It's not a suggestion, it's a rule

In Korea, it's written into the personal data protection rules (Article 7 of the standard on security measures for personal information). Passwords must be stored with one-way encryption so they can't be decrypted. "Can't be turned back" is literally in the rule.

The US standards body NIST says the same. Its guidelines say passwords shall be salted and hashed before storage.

Big companies slip up too

In September 2024, Ireland's data protection regulator fined Meta €91 million. Some Facebook and Instagram users' passwords had been sitting in internal systems in readable form. Meta said there was no evidence they were exposed externally or misused.

Not a hack from outside, just passwords left readable inside, and that alone cost this much. That's how much of a no-no "store it as is" is.

If a site ever emails you your old password

  • It's very likely storing your password as is
  • If you reuse that password anywhere else, change it now
  • Only give that site a password you use nowhere else
  • Ideally, let a password manager make a different one for every site

The annoying sites that only send a link? That's a good sign.

The one-line version

A site that won't tell you your old password isn't hiding it. It really doesn't know. The site that can tell you is the risky one.

Sources: Korea security measures standard, Art. 7 (IT Wiki, Korean) · NIST SP 800-63B-4 · Meta fined €91m (Irish Times)