c# - Encrypting app.config File -
I have an app.config file that I need to distribute with my application for an ASMX web service Service was created due to reference.
This is not a big deal, if this file is modified, but I still want to protect it. I am already checking the hash of config and making sure it is valid, but I still need an extra layer of security.
Here I am configured:
Can I encrypt or do anything?
You can enter & lt; System.serviceModel & gt;
- This is a configuration section group, which contains the configuration section.
aspnet_regiis
will only encrypt the configuration sections - so that you need to encrypt those selected parts, such as:
cd: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 aspnet_regiis.exe -pef "system.serviceModel / bindings". Aspnet_regiis.exe -pef "system.serviceModel / services".
etc.
With it, you can easily encrypt what you need - which is not very important, can be left in clear text.
Warning term: Because it is aspnet_regiis
, it expects to handle a web.config
file - your app.config Call
at a location and call it at web.config
, encrypt your sections, and assign those encrypted sections to your own app. Config
.
Or encrypt your own config section / write decryptor - this is actually a few lines of code! Or use me - I wrote a small ConfigSectionCrypt
utility, I hold it completely - with full source (C # - .NET 3.5 - Visual Studio 2008). This allows you to encrypt and decrypt any config file - just specify the filename on the command line.
Comments
Post a Comment