The following code uses the Windows API CryptProtectData to encrypt the string strValue by using the logged-on user’s credentials as a key. The encrypted value is stored in the user’s personal application data directory with the name <strSettingName>.txt.
Settings.SaveEncrypted(strSettingName, strValue)
The next line of code uses the Windows API CryptUnprotectData to decrypt the setting stored in the file <strSettingName>.txt. The result is assigned to the string strValue:
strValue = Settings.LoadEncrypted(strSettingName)
18.116.23.118