title: Storing setting passwords in the database securely
body: <p>I have a <code>.NET Web API</code>/<code>MVC</code> application that allows users to update SMTP and Active Directory credentials which are stored in a <code>SQL Server</code> database.  I thought I could use <a href="https://msdn.microsoft.com/en-us/library/dn613194(v=vs.108).aspx" rel="nofollow" title="PasswordHasher">Microsoft.AspNet.Identity.PasswordHasher</a> to secure these in the db tables but I don't think <code>Hashing</code> will work now.  There is no verification being done as with user passwords authentication where there is a entered password to compare against the Hash.  I know a good place to put these settings is in the <code>web.config</code> file but this application needs to be able to update these settings so I thought the db is the best place.  </p>
  
  <p>I am trying to find a way using <code>.NET</code> to store the passwords in the database encrypted so they can be read and converted to plain text as needed.  Maybe this can be done with <code>hashing</code> but I don't understand how it can be?</p>