【发布时间】:2021-10-01 16:18:45
【问题描述】:
因此,在谷歌搜索了 2 个多小时后,我还没有真正找到解决此问题的任何有效解决方案。我正在尝试加密一个链接,但它每次都向我显示这个错误。
声明:
if (F != null)
{
text = text.Replace("string license", "string license = @\"" + Convert.ToBase64String(F) + "\"");
}
加密:
{
try
{
Aes aes = new AesManaged
{
Key = new byte[] {},
IV = new byte[16],
Mode = CipherMode.CBC,
Padding = PaddingMode.Zeros
};
ICryptoTransform crypto;
crypto = aes.CreateEncryptor();
return crypto.TransformFinalBlock(message, 0, message.Length); //return encrypted value
}
catch (Exception x)
{
MessageBox.Show(x.Message);
return null;
}
}
感谢您的回答。
【问题讨论】:
-
你的代码有很多我不想评论的问题。尝试将此链接中的代码作为测试的基础(免责声明:我是作者)github.com/java-crypto/cross_platform_crypto/blob/main/…
标签: c# string encryption base64