How to hash and salt passwords

Posted by Henrik Skogmo on Stack Overflow See other posts from Stack Overflow or by Henrik Skogmo
Published on 2011-01-02T12:49:17Z Indexed on 2011/01/02 12:53 UTC
Read the original article Hit count: 188

Filed under:
|
|
|

I realize that this topic have been brought up sometimes, but I find myself not entirely sure on the topic just yet.

What I am wondering about how do you salt a hash and work with the salted hash? If the password is encrypted with a random generated salt, how can the we verify it when the user tries to authenticate? Do we need to store the generated hash in our database as well?

Is there any specific way the salt preferably should be generated? Which encryption method is favored to be used? From what I hear sha256 is quite alright.

And lastly, would it be an idea to have the hash "re-salted" when the user authenticates?

Thank you!

© Stack Overflow or respective owner

Related posts about php

Related posts about security