I do not see a problem using the username as the salt value.
A safer way to store passwords is to use a different salt value for each entry.
If you look at the asp.net membership provider aspnet_Membership table, you will see that they kept the password, passwordsalt and username fields in almost the same record. Thus, from this point of view, there is no difference in safety when simply using the username for the salt value.
Please note that some systems use the same salt value for all passwords and save this in the configuration file. The only security difference here is that if they got access to a single salt value, then they can more easily create a rainbow table to crack all passwords at once ...
But then again, if they have access to the encrypted form of passwords, they will probably have access to the salt value stored in the user’s table along with it ... Which may mean that it will be a bit more difficult for them to determine the password values.
However, at the end of the day, I believe that almost all applications do not work on the encryption front, because they only encrypt what is supposedly one of the least important pieces of data: the password. What really needs to be encrypted is almost everything else.
After all, if I have access to your database, why don't I care if the password is encrypted? I already have access to important things ...
There are obviously other considerations in the game, but at the end of the day I would not sweat this one too much, since this is a secondary problem compared to others.
NotMe Jul 27 '10 at 19:34 2010-07-27 19:34
source share