Apr 28, 2021 05:30 AM|ChaoDeng|LINK
ASP.NET IIS Registration tool enables you to encrypt and de-crypt the web config section info.
Steps to encrypt:
1.Run Command Prompt (cmd.exe) as admin
2.Go to path – C:\Windows\Microsoft.NET\Framework\v4.0.30319 . You can use following command – cd “C:\Windows\Microsoft.NET\Framework\v4.0.30319”
3.Now run following command- ASPNET_REGIIS -pef “connectionStrings” “D:\MyCode\w3techschools” . Replace your config path; in above command my code path is- “D:\MyCode\testCode”.
4.Now you will see your config file has connection string as encrypted.
In above command you have given name of section- “connectionStrings”, so it’ll encrypt your connection string section. Similarly you can encrypt other sections like -appSettings or even your any custom section created.
Similarly you can decrypt your connectionstring with below command (needs to be run as Admin only on same machine where it was encrypted)
ASPNET_REGIIS -pdf “connectionStrings” “D:\MyCode\testCode”.
You can also refer to the official