title: Encrypting credentials in a WPF application
body: <p>In a WPF application, I would like to provide the typical "Remember Me" option to remember credentials and use them automatically next time the application is launched.</p>
  
  <p><a href="https://stackoverflow.com/questions/3270800/c-sharp-wpf-encryption">Using a one-way hash</a> is clearly not an option, and while I can store credentials <a href="https://stackoverflow.com/questions/1244578/best-way-to-implement-remember-me-check-box-in-winforms-wpf">in isolated storage</a> or <a href="https://stackoverflow.com/questions/1672682/implement-a-remember-me-checkbox-in-windows-application">in the registry</a>, there is one issue to deal with when encrypting the credentials.</p>
  
  <p>If I use a symmetric key encryption algorithm, I will need to store the key somewhere. And if the key is, for example, hardcoded in memory, then I imagine it would be easy to disassemble the .NET assemblies and find it.</p>
  
  <p>What is the best way to encrypt credentials in .NET and keep them secure, keeping the encryption key completely out of reach?</p>