C# Base64加密/解密
1. Base64加密
public static string Encrypt(string clearText)
{
byte[] bytes = Encoding.UTF8.GetBytes(clearText);
return Convert.ToBase64String(bytes);
}
2. Base64解密
public static string Decrypt(string base64Text)
{
byte[] bytes = Convert.FromBase64String(base64Text);
return Encoding.UTF8.GetString(bytes);
}