It is possible to use aspnet_regiis.exe from the .NET Framework to encrypt sections of web.config.
Assuming the SPML webservice application is placed in C:\inetpub\wwwroot\D1IMSPML, it is possible to use the following commands to encrypt and decrypt the application section, which holds the ConnectionString, of web.config.
To encrypt:
- Open a cmd window.
- Change to the application path, e.g. cd C:\inetpub\wwwroot\D1IMSPML .
- Enter the command %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pe "application" -app "/D1IMSPML" -prov "DataProtectionConfigurationProvider" . Please note that the app Parameter has to match the application path mentioned above.
- The application section of web.config should now be encrypted.
To decrypt:
- Open a cmd window.
- Change to the application path, e.g. cd C:\inetpub\wwwroot\D1IMSPML .
- Enter the command %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pd "application" -app "/D1IMSPML" . Please note that the app Parameter has to match the application path mentioned above.
- The application section of web.config should now be unencrypted.