title: Storing salt in code instead of database
body: <p>There have been a <a href="https://stackoverflow.com/questions/674904/salting-your-password-best-practices">couple</a> of <a href="https://stackoverflow.com/questions/536584/non-random-salt-for-password-hashes">great</a> discussions regarding salt best practices, and it seems the overwhelming recommendation is to generate a different salt for each password and store it alongside the password in the database.</p>
  
  <p>However, if I understand the purpose of salt correctly, it is to reduce the chance that you will be compromised by rainbow table attacks. So, I understand that by storing it in the database it would be optimal to change it for each user, but what if the salt is nowhere near the database? If I store a single salt value in the code (which would on the web server be in a compiled dll), wouldn't that serve the same purpose if an attacker were to somehow gain access to the database? It would seem to me to be more secure.</p>