openssl 中的 RijndaelManaged 等效项
有一些使用 C# 编写的代码,其中使用 RijndaelManaged 加密数据的类和模式 = CipherMode.CBC
我需要使用 OpenSSl 在 Mac 中实现等效代码。
OpenSSl 中与 RijndaelManaged 等效的是什么?
There is some code written using C# which uses RijndaelManaged class to encrypt data andMode = CipherMode.CBC
I need implement the equivalent code in Mac using OpenSSl.
What is the equivalent to RijndaelManaged in OpenSSl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RijndaelManaged 只是 Rijndael 算法的 .NET 实现。 Rijndael 是为 AES 选择的算法,但 AES 并未使用 Rijndael 可能的所有密钥长度(AES 是 Rijndael 的子集)。
如果您的代码在 RijndaelManaged 中使用的密钥也是有效的 AES 密钥,您可以只使用 OpenSSL 的 AES 功能;否则我不确定......但我建议您坚持使用 Rijndael 的 AES 子集,因为这就是其他人所做的,它将帮助您实现互操作性。
RijndaelManaged is just a .NET implementation of the Rijndael algorithm. Rijndael is the algorithm that was chosen for AES, but AES doesn't use all of the key lengths that are possible with Rijndael (AES is a subset of Rijndael).
If the keys that your code uses with RijndaelManaged are also valid AES keys you can just use OpenSSL's AES functionality; otherwise I'm not sure ... but I'd advise you to stick to the AES subset of Rijndael because that's what everyone else does and it will help you to achieve interoperability.