Example #1
0
        public static string GetSecureString(string name, string defaultValue = "")
        {
            var value = GetString(DESEncryption.Encrypt(name, false));

            if (!string.IsNullOrEmpty(value) &&
                DESEncryption.Decrypt(value.ToString(), out string decrypted))
            {
                return(decrypted);
            }
            return(defaultValue);
        }
Example #2
0
 public static void SetSecureString(string name, string value)
 {
     SetString(DESEncryption.Encrypt(name, false), DESEncryption.Encrypt(value));
 }