by Twisol · 14y ago · 0 comments
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.
sha1sum(lcase($passwd). $salt);
I think the point stands for the Blizzard case - there seems to be an assumption in some corners that the password is stored plain text, but I would imagine case neutralised (so to speak) passwords are hashed.
Facebook massages the data to allow you to login even if you have caps lock on, so "pASSWORD" works when your password is "Password", or if, e.g., your phone capitalizes the first character in your password, so "Password" works when your password is "password".
1) lowercase inputted password. 2) hash password 3) compare hash to db hash (which was from a lowercased initial password).
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).