If a developer encrypts a connection string app.config section using RSAProtectedConfigurationProvider on their own machine, and this is subsequently deployed to a user\'s w
It is possible. There are APIs to do it (look at the System.Security.Cryptography
namespace), or from the command line you can use aspnet_regiis:
aspnet_regiis -pc -exp : create an exportable key pair
aspnet_regiis -px : export an RSA key pair to an XML file
aspnet_regiis -pi : import an RSA key pair from an XML file
aspnet_regiis -pa : add access for an account to a key container
Of course, when using encryption, you are simply substituting the problem of protecting data (your connection string) by a problem of protecting the key.
In your example, as you are aware since you say you know it's not bulletproof, the user will need to have access to the key container so will be able to decrypt the encrypted connection string.
In addition, anyone who gets hold of the XML file containing the exported key pair will be able to do so.
UPDATE
The deployment procedure would be something like:
Sections encrypted using a protected configuration provider such as RSAProtectedConfigurationProvider
will be decrypted automatically, provided the Windows identity under which the application is running has read permission for the RSA key container.