4 points · by Skywing · 15y ago · 5 comments
With that in mind, what is the proper way to do this? Is it fine to simply have a single, rather random salt used or should you somehow change the salt all the time? If the salt changes, how do you know how to compare it when they're logging in?
I give it both a static prefix and a configurable suffix.
I once had a system that used their login as part of the salt, but that introduced major support issues.
The salt serves two functions: Make rainbow table attacks more difficult
Obscuring cases where two users have the same password. If two users both use "blah7$monkey" as their password and you don't use a salt, they will hash to the same value.
If I steal your password database and I want to compromise one account, a salt offers no protection. Hash algo and password strength are what matter.