← Tutti gli articoli

How to Encrypt & Decrypt connectionStrings in the Web.config

26 December 2010  ·  Asp.Net · Article  ·  273 visite

How to Encrypt & Decrypt connectionStrings in the Web.config. You can use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe) to encrypt or decrypt sections of a Web configuration file.

1) Run the Command Prompt with Administrative Privilege

2) cd %WinDir%\Microsoft.NET\Framework\

3) Choose your Framework:  cd v4.0.30319

4) To encripty the connectionStrings section in the web.config located
in C:\inetpub\wwwroot\Maragna.Net run the following command:

aspnet_regiis -pe "connectionStrings" -app "/adfin" -prov "RsaProtectedConfigurationProvider"

(or aspnet_regiis -pef "connectionStrings" "C:\inetpub\wwwroot\Maragna.Net\Web.config" -prov "RsaProtectedConfigurationProvider")


5) Decrypt
aspnet_regiis -pd "connectionStrings" -app "/adfin"

Si è verificato un errore imprevisto. Ricarica

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.