|
public static string AES解密TO64(string BS64密文, string 向量 = null)
{
byte[] buffer = Convert.FromBase64String(BS64密文);
string result = null;
using (AesManaged aesManaged = new AesManaged())
{
aesManaged.Key = 数据加密.MD5加密("123456");
DateTime date = DateTime.Now.Date;
if (向量 == null)
{
aesManaged.IV = 数据加密.MD5加密("ABCDEF");
}
else
{
aesManaged.IV = 数据加密.MD5加密(向量);
}
ICryptoTransform transform = aesManaged.CreateDecryptor(aesManaged.Key, aesManaged.IV);
using (MemoryStream memoryStream = new MemoryStream(buffer))
{
using (CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read))
{
using (StreamReader streamReader = new StreamReader(cryptoStream))
{
result = streamReader.ReadToEnd();
}
}
}
}
return result;
}
}
这个易语言应该怎么表示啊?
|
|