glenelkins Posted August 11, 2010 Share Posted August 11, 2010 Hi I am looking for opinions on the best way to secure user passwords. I am currently using crypt() with a 32 bit salt string... now my main question here would be: Should I store a randomly generated md5 hashed salt in the database for each user, or maybe a single salt string in a config file? I am looking for the most secure option here. Quote Link to comment Share on other sites More sharing options...
aeroswat Posted August 11, 2010 Share Posted August 11, 2010 The md5'd salt can't be random because there would be no way for the system to replicate that salt purposely. You could use some sort of entry in your user's information that is unchangeable to create an md5'd salt. For instance a creation date or user id + some word. Whatever you do though do not hash the password twice because it makes it more vulnerable. Quote Link to comment Share on other sites More sharing options...
glenelkins Posted August 11, 2010 Author Share Posted August 11, 2010 Hi Thanks for the reply. I was thinking of storing the salt in the database and just pulling it out when i need to check passwords. The problem is I have been told this isn't the best way to store the salt string, what is your opinion on this? My idea of the salt would be to generate a string of say 32 characters long with completely random characters, then hash this to make the salt for the password Quote Link to comment Share on other sites More sharing options...
aeroswat Posted August 11, 2010 Share Posted August 11, 2010 Hi Thanks for the reply. I was thinking of storing the salt in the database and just pulling it out when i need to check passwords. The problem is I have been told this isn't the best way to store the salt string, what is your opinion on this? My idea of the salt would be to generate a string of say 32 characters long with completely random characters, then hash this to make the salt for the password To be honest I believe that storing a randomized salt in the database would provide the same security as storing a non-randomized salt in the database. That's why I would salt a non-changing variable that is stored in the database that otherwise would not be used as a salt. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.