7 ms·
I wonder how they do that. If they store the password hashed, wouldn't they have to normalize it two/three different ways and store a hash for each?
by Twisol 14y ago
I wonder how they do that. If they store the password hashed, wouldn't they have to normalize it two/three different ways and store a hash for each?
- tonyedgecombe 14y agoOr perhaps they aren't storing it hashed ...
- scg 14y agoNo, they only need to store a single hashed password. For authentication they can just try out the other 2 transformations above and see if any of them matches what's on file.
- dewiz 14y agothereis no multiple transformations, they just lcase every pwd input before hashing. the stored hash is a the hash of the lcase pwd.
- karlshea 14y agoThey have your un-hashed password when the form is submitted, they can try all three, hash them, and compare those to the saved hash.
- AgentConundrum 14y agoThey would only have to store a single hash - the proper password. When you log in to Facebook, they hash the password you gave them and try that. If it fails, they modify the password you gave them, reversing the case on all letters (and possibly convert numbers to special characters, or vice versa - I don't know if they go that far), and hash that. Remember that when you log in, the server is receiving your password in plain text. Facebook is just "massaging" that data a bit (possibly several times) to try to correct a user error, rather than just bailing at the first sign of trouble.
- lucian1900 14y agoThe only problem with that is that it's ripe for timing attacks. I _hope_ they always check all three passwords anyway.
- daeken 14y agoExposing the timing here can only tell you one thing: the password that you're trying works for Facebook, but the capitalization might be wrong if you're using it to get into the user's account on another site. But since there are only three variants on the password, it gives you effectively nothing. This would be insanely difficult to pull off (many, many login samples) for absolutely no payoff; they might as well save the extra hashes if it works the first time.
- al_james 14y agoHi, interested in the above comment. Can you explain how a timing attack would work here?
- lucian1900 14y agoAn interesting demo: [1] By not doing all 3 hashes, an attacker might realise that the password they sent passed, say, 2 checks, but not the third. This discloses information about the relationship between the password the attacker just tried and the correct password. [1] http://carlos.bueno.org/2011/10/timing.html http://carlos.bueno.org/2011/10/timing.html
- e-dard 14y agoI don't under stand the confusion in the other replies here. 1) lowercase inputted password. 2) hash password 3) compare hash to db hash (which was from a lowercased initial password).
- zerovox 14y agoBecause this isn't how they do it. that method is the same as the Blizzard method, and it is a lot less secure than transforming the plain text and trying the three different combinations(normal, uppercase first and capslock password)
- e-dard 14y agoAh, sorry, I missed the top of this reply-thread. I was referring to the story, not Facebook. :-)
- panic 14y agoThey could normalize it in the following way before storing a hash: 1. If the last letter in the string is uppercase, flip the case of the entire string. 2. Make the first character lowercase. This would allow for abC as well (if you "capitalized" the first letter while holding down capslock).