|
|
@@ -89,6 +89,17 @@ namespace Filters
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ public static string Encrypt(string str)
|
|
|
+ {
|
|
|
+ if(string.IsNullOrEmpty(str)) return "";
|
|
|
+ str = str.Trim('"');
|
|
|
+ str = HttpUtility.UrlDecode(str);
|
|
|
+ var options = App.OptionsSetting;
|
|
|
+ var aes = options.Aes;
|
|
|
+ var result = Dbconn.AesEncrypt(str, aes.EncodeKey, aes.EncodeIv);
|
|
|
+ return Convert.ToBase64String(Encoding.UTF8.GetBytes(result));
|
|
|
+ }
|
|
|
+
|
|
|
public static string Decrypt(string str)
|
|
|
{
|
|
|
if(string.IsNullOrEmpty(str)) return "";
|