Patricio Treviño

Patricio Treviño

Husband . Father . Developer
2total entries in encryption

Encrypt a configuration section in a configuration file hosted in IIS

Syntax

aspnet_regiis -pe <section> -app <virtualPath> [-location <subPath>] -prov <provider> [-pkm]
view raw syntax.text hosted with ❤ by GitHub

Option Description
section The section of the web.config to be encrypted.
virtualPath The IIS website that hosts the web.config.
location The subpath inside the IIS website that hosts the web.config.
prov The name of the provider to be used to encrypt (configProtectedData).
pkm Encrypts the machine config instead of the local config.

Encrypt a configuration section in a configuration file not hosted in IIS

Syntax

aspnet_regiis -pef <section> <directory> -prov <provider> [-pkm]
view raw syntax.text hosted with ❤ by GitHub

Option Description
section The section of the web.config to be encrypted.
directory The physical path to the web.config file.
prov The name of the provider to be used to encrypt (configProtectedData).
pkm Encrypts the machine config instead of the local config.

Note: this option looks for a web.config file, there is no way you can specify a difference name. If needed, rename your app.config to web.config, encryp/decrypt, then rename again.