News for hackers. Stuff that matters.
Re:Password Requirements: Myths and Madness by nulbyte on Thursday December 22, 2022 @09:59PM (#34101890)
> - Past password similarity checking (I'm actually not even sure how they do this unless they somehow have access to the plaintext version of user passwords; if there's a benign/secure way of doing this I'd be very curious)

Same way you verify the current password: hash it and compare to what you have on file. If you use salted hashes and the salt changes, you'll have to keep enough of those around, too.

Re:Password Requirements: Myths and Madness by jlund-molfese on Thursday December 22, 2022 @10:19PM (#34102011)
How would that work for password similarity?

If they’re using some special hash algorithm that retains most of the information of the original password and allows them to determine that “password1” and “password2” are similar and “blahblah7” is not, their approach is hopelessly broken too.

Re:Password Requirements: Myths and Madness by AstralStorm on Friday December 23, 2022 @01:23AM (#34102837)
Technically you could tokenize and dictionary plus edit distance check the password in the client if you have the plaintext, or use malleable hashing. Check entropy while at it. Of course that will not stop a determined policy ignorant.

Requiring a plaintext password storage somewhere is an instant regulatory fail in ISO 27002 and PCI DSS standard. You can technically store the passwords encrypted, but attacker is liable to steal your salt/key, and protecting the passwords in transit strictly requires strong PKI. We know users cannot determine that anyway and get phished/MITMed.

Plus it's kind of mean. If your users are determined to ignore your policy, maybe it's a bad policy or you need to tell them to stop doing that.

Checking for x latest passwords requires just storing their hashes.

Re:Password Requirements: Myths and Madness by dalyons on Thursday December 22, 2022 @10:14PM (#34101976)
I think you missed the word “similarity”. You can’t check similarity with hashes, only exact matches
Re:Password Requirements: Myths and Madness by mijoharas on Thursday December 22, 2022 @10:42PM (#34102131)
Oh god! I made the same mistake. I thought you just meant password reuse. Past password similarity? That's literally impossible without plaintext passwords isn't it. That is insane.
Re:Password Requirements: Myths and Madness by TedDoesntTalk on Friday December 23, 2022 @12:21AM (#34102564)
> That's literally impossible without plaintext passwords

No, it’s not. It’s called locality-sensitive hashing. You’d store the last 10 LSH hashes in a database next to the SHA-256 hashes. Compare those LSH hashes to the LSH hash of the new password. Match? Reject the new password.

It’s also used to identify photos that are similar:

https://en.m.wikipedia.org/wiki/Locality-sensitive_hashing

Re:Password Requirements: Myths and Madness by wizofaus on Friday December 23, 2022 @12:37AM (#34102631)
Surely even having an LSH stored is a potential compromise - e.g. if my password happens to have the same LSH as somebody else because I've used "Secret-123" and they've used "Secret123", then you've presumably got a better chance of guessing what my password is than if the LSHes weren't stored (if you can't get from me directly, you can try to get it from others who have the same LHS).
Re:Password Requirements: Myths and Madness by scrollaway on Friday December 23, 2022 @12:40AM (#34102645)
I remember Facebook doing some things like this. Such as storing the capslock-on variant of passwords as well as various typos.
Re:Password Requirements: Myths and Madness by TedDoesntTalk on Friday December 23, 2022 @01:11AM (#34102778)
You’re assuming an attacker can access this database somehow? And that the LSH of “somebody else” is reversible? I’ve don’t understand the vulnerability you’re describing.
Re:Password Requirements: Myths and Madness by ahtihn on Friday December 23, 2022 @01:47AM (#34102944)
> You’re assuming an attacker can access this database somehow?

Well yeah. Protecting against this is the exact reason passwords aren't stored in plaintext.

Re:Password Requirements: Myths and Madness by wizofaus on Friday December 23, 2022 @01:49AM (#34102952)
Yes, obviously, I'm just saying it's a potential vulnerability that doesn't exist if you don't store the LSH. The LSH doesn't need to be reversible - I'm just saying that you now have a situation where if you can find multiple people with the same LSH, if one their passwords becomes known to an attacker for any reason (the attacker could be one of those people!), the other passwords are now much easier to guess.
Re:Password Requirements: Myths and Madness by gpderetta on Friday December 23, 2022 @02:32AM (#34103184)
You could salt the LSH with a different per-user salt.
Re:Password Requirements: Myths and Madness by wizofaus on Friday December 23, 2022 @02:39AM (#34103226)
True, if you were only concerned about similarity with the same user's passwords.
Re:Password Requirements: Myths and Madness by gpderetta on Friday December 23, 2022 @04:14AM (#34103811)
which in this case we are. We don't want to reject a password because it is similar to some other user password.

Mind, I think the feature is misguided, but it is probably possible to implement it safely.

Re:Password Requirements: Myths and Madness by _dain_ on Friday December 23, 2022 @06:15AM (#34104560)
The hashing has to happen serverside, which means the server will temporarily have the plaintext in memory. While there, you can mutate the string by adding/removing/chanigng characters, to get a bunch of strings that are similar. Then you compare all of those to the old hashes you have stored. It will catch people doing common stuff like incrementing a number at the end on every reset.