I had an idea about hashed passwords and salt values. Since I'm pretty new to hashing and encryption, I thought I'd send this to you. Would it be safer to create a unique salt for each user account and then store the salt and hash values ββin the database? Or, save one salt value that will be stored and reused every time I keep the password?
For example, the user will use a password:
"secret"
My code will generate a salt value:
"d1d0e3d4b3d1ed1598a4e77bb614750a2a175e"
Then we get the result:
"e8187dcbe8e2eabd4675f3a345fe21c98affb 5544a9278461535cb67265b6fe09a11dbef572 ce3a4a8f2275839927625cf0bc7bc46fc45d51 12d7c0713bb4a3"
The hashed result and salt will then be stored in the database in the user profile when their account has been created. Then, every time a user logs in, a new salt is generated, the password and salt are re-displayed and stored in the database.
Any thoughts? As I said, this is a sanity check about my idea.
source share