Encryption and decryption of the elements in web.config

6/4/2018 - from Svetlin Slavchev

Open the command promt like administrator and navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and type one of the following command:

1. Using IIS server:
Encryption:

aspnet_regiis.exe -pe "{element to encrypt}" -site "{site id}" -app "/{virtual direcrtory name if exist}"

Decryption:

aspnet_regiis.exe -pd "{element to decript}" -site "{site id}" -app "/{virtual direcrtory name if exist}

Examples:

aspnet_regiis.exe -pe "appSettings" -site "7" -app "/"
aspnet_regiis.exe -pd "appSettings" -site "7" -app "/"

 

2. Using file system:
Encryption:

aspnet_regiis.exe -pef "{element to encrypt}" {path to application}

Decryption:

aspnet_regiis.exe -pdf "{element to decript}" {path to application}

Examples:

aspnet_regiis.exe -pef "connectionStrings" "C:\Projects\Test\Test\WebApplication2"
aspnet_regiis.exe -pdf "connectionStrings" "C:\Projects\Test\Test\WebApplication2"

We use cookies to give you the best functionality on our site. Do you agree to record information from your user session? Learn more