Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is tricky. If you want to encrypt something then you need to manage the key(s) you used to encrypt it with. </p> <p>DpapiProtectedConfigurationProvider off loads this to the OS, which is effectively using the password of the user to keep the key protected. (However you are then bound to that account or machine)</p> <p>RsaProtectedConfigurationProvider Is similar but provides a way of exporting the public/private key pair. So you can add(import) that to another machine. </p> <p>However this again gets tricky, in that if you want to move the app to another machine you need to copy the public/private key pair. This is fine if you (or someone you trust) can do that, and delete the key container afterwards. Remember that if anyone gets hold of that key container, you are back to square one.</p> <p>If you are using Active Directory (I think) you may be able to set up a user account(across all your machines) which your app runs under. This would then allow you to use DpapiProtectedConfigurationProvider. In fact you may be able to use Active Directory to deploy your key container for RsaProtectedConfigurationProvider securely as well. (I am not an expert in AD, you will need to google that yourself)</p> <p>Using <a href="http://www.codeproject.com/Articles/10163/How-to-Set-Up-SQL-Server-Integrated-Security-For-U" rel="nofollow">SQL Server Integrated Security</a> is another option. This lets you do away with storing the credentials all together. (If you can this ma be the best option).</p> <p>The other option (this is what I am doing for the project I am working on. YMMV) is to implement a <a href="http://msdn.microsoft.com/en-us/library/wfc2t3az.aspx" rel="nofollow">ProtectedConfigurationProvider</a>. </p> <p>I don't have control over AD and installing keypairs wont fit into our deployment work flow. So in my case, when the app tries to get the connection string from the config it looks in the registry. If it finds a plaintext password there, (Do not ask why, but this can fit into our deployment work flow), it encrypts it using DPAPI, but to the machine that the app is deployed to. It then puts this into the web.config and deletes it from registry. So I did need to type int the credentials once. But running the app, causes it to be encrypted, but only decryptable by that app on that machine.<br> at That works from my peculiar set of circumstance. However the recommended solution would be to use SQL Server Integrated Security if you can.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload