title: Storing and encrypting SMTP credentials in the registry
body: <p>I have a username and a password for an smtp server. Currently they are hardcoded in my code:</p>
  
  <pre><code>string userName = "username";
  string password = "password";
  </code></pre>
  
  <p>Currently, anyone who disassembles my dll could see these strings, correct?</p>
  
  <p>I wish to store these securely in the registry, in case of future changes to the smtp server, and/or the credentials. I am not worried about the smtp server address string's security. I am only worried about the credentials' security.</p>
  
  <p>How do I do this without hard-coding the credentials anywhere? I wish to see encrpyted strings in the registry.</p>
  
  <p>I can encrpyt the password, then store the encryption in the registry, delete the password from the code, and use the decrypted password assuming that it is correct. However, wouldn't someone who disassembles my code still be able to decrypt the encrypted string stored in the registry?</p>
  
  <p>What is the safest way?</p>