hash - Password hashing and salts in PHP -
I am working on a site that is super safe I have read a lot about using password hashing and salts , But everything is not clear to me. I would like to use Sh-256 hash algorithms with salt. I know about salts that they should be unique to the user per-password.
I am thinking that if I will use the password as salt also? Hush the password with Sha256 and then hashed it with another algorithm and use it as salt. This way I do not need to store salt in the database. Is it possible? Or should I generate a random string?
No, it's still a one-way algorithm.
If another user uses the same password then the hash value will be similar to the hash near the first user. It remembers that the hash values for each user and everyone else will be different.
I suggest using a user's registration date (for example), as salt. This method will be different for every user and every hashing algorithm (well, if two users have the same pass and the same reg. Date it will be the same).
Or maybe you can use the user some combination between the id or user id for the salt and between the regdet and the user name.
Edit: Your approach is really better with the hinging with known algorithms without salt, but worse hash + prop salt. What you are doing is implementing your own custom hash function only without knowing the custom algorithm, it can not be easily coerced, but is vunerable for other attacks. And I suggest not to keep the table in the DB with the name "SALT", if the DB gets hack attack wii password and salts for them.
Comments
Post a Comment