keeping your passwords safe, part 2
mark posted this on February 3rd, 2010 in meeblog categoryThis is part 2 in a 3-part series about security at Meebo. See part 1.
Before we get started I want to make it clear that sharing this information doesn’t give away any secrets and doesn’t make you any less safe!
Today I’d like to talk about how we store the password for your Meebo account. Or more accurately, how we don’t actually store the password for your Meebo account. Instead we store a “hash” created from your password. A hash is a string of characters that is calculated by running your password through an algorithm created by cryptographers (aka crazy smart math people). For a given password, the algorithm generates the same hash every time. It is easy to take a password and create a hash, but it is basically impossible to reverse this process, i.e. to take a hash and determine the original password. (For anyone curious, we’re using bcrypt.)
When you type your username and password to log into Meebo we calculate the hash of the password you provided. If this hash matches the hash stored in our database then you have successfully authenticated, yay!
By storing a hash instead of the password, we greatly lessen the damage in the unlikely case that a hacker manages to get ahold of the information stored in our database. One weakness with this scheme is that, because many users use a simple word as their password, if a hacker is able to obtain the password hashes from our database then it would be possible for them to perform a “rainbow attack” to ascertain weak passwords. In this attack the hacker precomputes chains of hashes for each word in the dictionary and creates a rainbow table. The hacker would look up each hash from our database in this rainbow table. If he finds a match then he knows the password that was used to generate the hash.
We neutralize rainbow attacks by “salting” the password before generating the hash. Salting means that a few letters are added to the password before the hash is calculated. We generate a few random letters for each user, and store this “salt” along with the password hash. In effect this makes everyone’s password just a bit more random, which would require an unfeasibly large rainbow table.
In summary: We store a salted hash of your password, NOT The password itself. These techniques are pretty brilliant and we certainly can’t take credit for them—Unix at least has been using salted password hashes since the 1970s. It is our hope that sharing this information inspires other companies to be equally diligent with their own websites.
Stay tuned for part 3, coming in a few days!
Mark
[ comments ] [ past blogs ]
Follow us on Twitter


