6 ms·
How would you do the comparison? Wouldn't it require storing all the previous passwords in plaintext? If only the hash and salted password is stored, as recomm
by vmarsy 10y ago
How would you do the comparison? Wouldn't it require storing all the previous passwords in plaintext?
If only the hash and salted password is stored, as recommended, how would you know that "myOldPassword21" and "myOldPassword22" are similar ?
- apk17 10y agoYou make the modifications and store those hashes as well. Can't have a new 'similar' algo for past pws, obviously.
- xamuel 10y agoIf you store N variations, a random guess has N chances to hit one. Once an attacker knows a variation, they may be able to use it to narrow down on the real password.
- ascorbic 10y agoSame way you check if the password is correct. Check against the old hashes. When the user sets the new password, if it looks like it matches an iterative pattern (i.e. if it ends in a number) then test the previous few from that sequence against the old hashes. Note, this is still a terrible idea.
- inlined 10y agoCryptographic hashes of similar strings can't be similar.
- ascorbic 10y agoYou don't compare the hashes. When the user changes the password to "myOldPassword22", you hash "myOldPassword21" and "myOldPassword20" etc and compare those to the old hashes.
- gregmac 10y agoDo you know how many variations there could possibly be?? For example, I could use: myoldpasswordA1 / myoldpasswordB2 / myoldpasswordC3. Probably obvious to a human my next one will be D4, but it is a comparable problem to "play every possible game of chess" for a computer to figure that out. Combined with using a secure computationally-expensive password storage mechanism (eg: bcrypt or PBKDF2) and I'm not exaggerating: it now takes billions of years to verify a password change is allowed. And this is trying to solve a compromised password problem. If there's no compromise, rotating passwords is pointless. If the password IS compromised, rotating the password doesn't really fix it, it merely limits access -- maybe. It doesn't address the original means of the compromise (so you have to assume that's still there). It doesn't address backdoors installed. It doesn't address information stolen. So this is a hell of a lot of work to accomplish .. basically nothing.
- lmm 10y ago> For example, I could use: myoldpasswordA1 / myoldpasswordB2 / myoldpasswordC3. Probably obvious to a human my next one will be D4, but it is a comparable problem to "play every possible game of chess" for a computer to figure that out. Two possible changes (forward/backwards) for two characters out of 15. 420 combinations. Not exactly billions.
- JadeNB 10y ago> Two possible changes (forward/backwards) for two characters out of 15. Yes, but you can only cut down the sample space in this way because you can look at "myoldpasswordA1" and know that the 'A1' characters are the iterators. A computer doesn't know that.
- deleted 10y ago[deleted]
- lmm 10y agoMy figure is for testing all possible ways of changing two characters by one each (and the ways of changing only one character are a tiny subset of that). This doesn't catch people who change 3 or more characters, or who change characters by more than 1, but at that point is it really still so easy to guess?