What is the point of using a salt when encrypting passwords in a web application?
August 26, 2006 12:05 PM
Subscribe
What is the point of using a salt when encrypting passwords in a web application?
I've lately seen a lot of recommendations in the web app world to add a random salt to users' passwords before encrypting them (MD5 or similar). The salt is then stored in the database along with the encrypted password. People talk about this as if it adds a major extra layer of security, but I can't understand the benefit of it.
I can understand the benefit of doing this in a situation where the encrypted passwords are easily accessible (such as the traditional UNIX passwd file). Without a salt, the attacker can take the list of encrypted passwords and run a pre-encrypted dictionary against them quickly and easily.
But if you're trying to crack a login page on a web app, your two options are basically to either do a brute force dictionary attack against the login page itself, or somehow get hold of the (encrypted) password table.
In the first case, it doesn't matter what encryption or salting you've got going on behind the scenes, since your attacker is just firing normal plain text passwords at your login form. So salting doesn't help security here, does it?
And in the second case, if you've hacked the server to the extent that you're able to read a table of encrypted user passwords from the database, don't you have about as much access as you're ever going to need? Why not just read the other tables in the database to gain access to the confidential information? Why bother trying to crack the passwords? I suppose it would make sense if you were storing user credentials in one database and user data in another database, but this doesn't seem to happen often.
What am I missing? Why bother doing this?
posted by chrismear to computers & internet (15 comments total)
11 users marked this as a favorite
In non-critical systems, this is the only argument you need. Storing plaintext passwords is no real problem if having access to the database is enough to compromise the whole system.
posted by wackybrit at 12:37 PM on August 26, 2006