Hello Everyone,
Currently my VB.NET project has two aspx pages that store strings containing my email server access credentials.
...
Has anyone done this before?
I'm really confused as to how I'm going to successfully encrypt these credentials.
Thanks in advance,
-Frinny
I've fixed this problem. After trying out 50 wrong ways to solve this problem I finally ended up doing something really simple to encrypt these credentials.
I ended up placing the credentials into <appSettings> in the web.config file and then encrypting the <appSettings> with the aspnet_regiis tool.
I learned how to do the encrypting on
this site.
So basically I added this to my web.config
-
<appSettings>
-
<add key="EmailUserName" value="userName"/>
-
<add key="EmailPassword" value="password" />
-
</appSettings>
-
Then using the Visual Studio command prompt went to the directory where my web site is on my web server and typed:
aspnet_regiis -pe "appSettings" -app "/ApplicationName" -prov "DataProtectionConfigurationProvider"
That resulted in
-
<appSettings configProtectionProvider="DataProtectionConfigurationProvider">
-
<EncryptedData>
-
<CipherData>
-
<CipherValue>AQAAANCMnd8BFdERFDSKLFewiondsDIFKODPSnfdaspfasdSfdsryPBDwQAAAACAAAAAAADZgAAqAAAABAAAACs2B+wjsvcnhVhkE+5iXGRAAAAAASAAACgAAAAEAAAABbj/SqXmvI8cBJAGqvzCeUgAQAAsbVwuLJYR6/h5hNpTd+UUqI22S3yX/LHi5VrByXfWPX2tadceln9YTzBty1iF5U/txlwFGY2VZHcAAt7fMamk7yLyJaOuwXJP9BBhWB7sMxxaZrpmhCI1pn+i3AfsuoavODj1Ib6Xln4rXcP+rwO9x+uxuRfDfaskGmVRrdXo/UTmTYY4+FdeqMxmLcLR0LSdnZ9FVt6nk/BZu57xXWQIqywiDnms3PXyDaKbyuvAIp40Gumtu19orx7pEOUMJGeEOSvbycCVmGxCWbCNgghzVMdmO7E6WicsjKF23IrBhTK/hk25KB4e4TEjtLfx77M0SYHmFoNcbyuHLSPHyF5yekkAGv3o3M3bRGGyDTxv2z+HWowp2I14nUiQTTI70cVFAAAAJmO9fUNqnH0XZiXbj6vTJ5kK0mZ</CipherValue>
-
</CipherData>
-
</EncryptedData>
-
</appSettings>
-
Which I'm happy with.
:)
Cheers!
-Frinny