Skip to main content

Posts

Showing posts from November, 2014

Encrypt Web.config in DNN or ASP.net web application

Granting Read Access to an RSA Encryption Key Step 1: Go to the appropriate framework directory for the ASP.NET files:cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319


Step 2:
From here we can grant read access to an RSA encryption key by running this command:.\aspnet_regiis.exe -pa "NetFrameworkConfigurationKey" "IIS APPPOOL\MySite"


How to Identify the APP  Pool "IIS APPPOOL\MySite" is the identity that my App Pool runs under. If you don't know what yours is, create an .aspx file in your website with the following content:
<%@ Page Language="C#" %>  <%
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
%>

Encrypting Sections of the Web.config File At this point, we are ready to run the command that will actually encrypt the web.config.  MAKE SURE THAT YOU HAVE A BACKUP OF ALL THE DATA STORED IN THE SECTION YOU ARE ABOUT THE ENCRYPT. .\aspnet_regiis.exe -pe "connectionStrings" -app "/MySite…