I know for a fact that salts are an important part of storing a password securel
ID: 656976 • Letter: I
Question
I know for a fact that salts are an important part of storing a password securely in a database. Most people store the password hash, and the salt that was used for it. This, I have learned, isn't as safe as many would think, as a dedicated cracker could use a dictionary attack to find out the password (granted he knew how you were using the salt).
Therefore, I am asking, is it safe to use some sort of transformed version of the password as the salt? Or is a normal salt going to do the exact same job.
Explanation / Answer
The purpose of the salt is to ensure that two separate users using the same password string will not generate the same password hash. If you are deterministically defining the salt based on the password, and two users have the same password, then you'll almost certainly be selecting the same salt for both, and will have failed the original purpose of using a salt.
(One can imagine a scheme by which you determine the salt by calculating an index into the password based on the username, which would mean two different users with the same passwords would end up with different salts derived from their passwords. But, keep reading.)
In addition, my gut tells me that when you're extracting information from the password to use in the more public guise of the salt, you're in danger of leaking information about the password itself. Any of the more crypto-skilled on this site can probably give chapter and verse if that's a correct gut feel.
The bottom line is really that secrecy is not required for the protection that the salt provides. It is not intended to supplement poor password quality, only to make two equal passwords result in different hashes, thus making brute force attacks more expensive. You should consider carefully whether you truly get any security improvement by making it more complex - and I think the answer is no.