Example #1
0
 public static string EncryptToBase64(string plainInput, string confusionCode)
 {
     if (string.IsNullOrEmpty(plainInput))
     {
         return(string.Empty);
     }
     return(Base64Encoders.Base64Encode(EncryptToBase256(SecureUtf8Encoding.GetBytes(plainInput), confusionCode)));
 }
Example #2
0
 public static string DecryptFromBase64(string encryptText, string confusionCode)
 {
     if (string.IsNullOrEmpty(encryptText))
     {
         return(string.Empty);
     }
     CheckIsBase64(encryptText);
     byte[] bytes = DecryptFromBase256(Base64Encoders.Base64Decode(encryptText), confusionCode);
     return(SecureUtf8Encoding.GetString(bytes));
 }