

The first set of instructions to use aspnet_regiis to create the key, export it, and import it is there another way I can incorporate that key in the encryption of the section without using the 'aspnet_regiis -pe section -prov MyProvider -site mysite -app I do not have a web.config file - I have an app.config ('') that I would like to encrypt a specific section. The instructions (and links) seem to be specific to encrypting a section to a web.config file. Intellisense tells me valid attributes are: lockAllAttributesExcept, lockAttributes, lockElements, lockItem,Ģ. net 3.5) tells me that 'ke圜ontainerName', etc. When I try to add the above information to my app.config, the IDE (VS2008, using. To encrypt a section using your provider:Īspnet_regiis -pe section -prov MyProvider -site mysite -app virtual-pathĪnd documentation of aspnet_regiis parameters here:ġ. To use your new container (which in the examples above I called M圜ontainerName) To import the key to the other machine: aspnet_regiis -pi M圜ontainerName filename.xml pri will cause the private key to be exported To export the key to xml file: aspnet_regiis -px M圜ontainerName filename.xml -pri The -exp option will make the key exportable

To create a key pair: aspnet_regiis -pc M圜ontainerName -exp
Encryptme app code#
Now your code should be encrypting the sectionĥ- Export the key to xml with aspnet_regiis (-px switch)Ħ- Import the key from xml on other machine with aspnet_regiis (-pi switch) So for an executable (non web application)ġ- use aspnet_regiis to create the key container (creating the key container has nothing to do with your application type) -pc switchĢ- Add the section I mentioned to your app.config (change the ke圜ontainerName to the name of the container you created in step 1, choose any name for provider name)ģ- Run your code (config is opened using Configuration config = ConfigurationManager.OpenExeConfiguration(Assembly.GetEntryAssembly().Location) )Ĥ- PROVIDER_NAME should be the same as name attribute in step 2 Make sure you are passing the provider name and not the container name. The PROVIDER_NAME to pass is "MyProvider" in the example config xml in my previous post. My Visual Studio complained too, but the code ran fine. Yes, visual studio will complain about the config file, however your code should work (.NET framework will not complain at runtime).
Encryptme app how to#
I do not understand how to set up to use the RSA encryption in the app.config with my own key that I can export to another machine. Is this correct, or is there a better way to accomplish the same thing?
Encryptme app install#
Encryptme app full#
The software runs on a custom piece of hardware created by us as well, and we are in full control of the operating system (and all software on There is no issue with creating a specific key and installing in on the computer running the application. I cannot seem to find any information specific to just an application config file. Most of the examples though all seem to deal with encrypting web.config and using the aspnet_regiis tool to create a key, export it etc.

Then I learned that I should be using RSA encryption, which will allow decrypting on other machines. With the partially encrypted app.config file to another machine, I got an error decrypting the file. This worked fine, using the default "DataProtectionConfigurationProvider", when I encrypted and decrypted on my own machine. I have a console application that I wrote to encrypt the particular sections. The application will run on many different computers, so each computer that runs the application will need to be able to successfully decrypt the app.config. NET 3.5) such that our build machine will be the entity responsible for the encryption and will thus create the final app.config that will be deployed with ourĪpplication. I am trying to encrypt just a section of my app.config (this is a WPF application, written in.
