You can protect both your password and your salt.
Use SHA256 or higher (2012) and in years to come it must be higher.
Use a different salt for every user.
Use a calculated salt.
Create a 16 to 32 byte Salt and store it in the database, called 'DBSalt'.
Create any old algorithm to manipulate the salt but keep the algorithm only in code. Even something as simple as DBSalt + 1 is useful because if someone gets your database, they don't actually have the correct salt because the correct salt is calculated.
Calculate your password as follows:
CreateHash(saltAlgorithm(dbSalt), password);
You can add security by having a list of algorithms that manipulate the DBSalt in different ways. Every time a user changes their password you also use a different calculation against the DBSalt
You can add more security by having these algorithms be stored on
web servers external to your system so if your DB and code both get
hacked, they still don't have your salt.
- You can also increase security by having a before, and after, or both salt and the database alone doesn't provide this information.
There is no end to the "You can increase security by..." comments. Just remember, every time you add security, you add complexity, cost, etc...
How to effectively salt a password stored as a hash in a database