I have had a couple questions regarding encrypting the identity section of the web.config file, so here’s how.
In my example, I use identity impersonate in my web.config file and the physical path is “c:\sourcecode\BigWebApplication\web.config”
<system.web>
<identity impersonate="true" userName="Alastair" password="password" />
</system.web>
aspnet_regiis –pef system.web/identity c:\sourcecode\BigWebApplication
and to decrypt
aspnet_regiis –pdf system.web/identity c:\sourcecode\BigWebApplication