https://weblogs.asp.net/jongalloway/encrypting-passwords-in-a-net-app-config-file This page uses: System.Runtime.InteropServices.Marshal.SecureStringToBSTR System.Runtime.InteropServices.Marshal.PtrToStringBSTR System.Runtime.InteropServices.Marshal.ZeroFreeBSTR System.Security.Cryptography.ProtectedData.Unprotect System.Security.Cryptography.ProtectedData.Protect System.Security.Cryptography.DataProtectionScope.CurrentUser