如何在 C++ 中计算 SHA-512 哈希值在 Linux 上?
是否有标准库或常用库可用于在 Linux 上计算 SHA-512 哈希值?
我正在寻找 C 或 C++ 库。
Is there a standard library or commonly used library that can be used for calculating SHA-512 hashes on Linux?
I'm looking for a C or C++ library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您检查过 OpenSSL 吗?我自己没有使用过它,但文档说它支持它。
以下是更多实现的列表。
示例代码
Have you checked OpenSSL. I myself have not used it but documentation says it supports it.
Here is list of few more implementations.
Example code
检查此代码。它是完全便携的,不需要任何额外的配置。只要STL就够了。您只需要声明
这些函数,然后
在需要时使用它们。它们的返回值为
std::string
Check this code. It is fully portable and does not need any additional configurations. Only STL would suffice. You'll just need to declare
and then use the functions
whenever you need them. Their return value is
std::string
我将 Botan 用于各种加密目的。它有多种SHA(-512)算法。
当我查看 C++ 加密库时,我还发现了 Crypto++。 Botan API 的风格对我来说更简单,但是这两个库都很可靠且成熟。
I'm using Botan for various cryptographic purposes. It has many kinds of SHA(-512) algorithms.
When I was looking at C++ crypto libraries I also found Crypto++. The style of the Botan API was more straightforward for me, but both of these libraries are solid and mature.
我在这方面取得了巨大成功:
安全哈希算法 (SHA)
BSD 许可证。它涵盖 SHA-1、SHA-224、SHA-256、SHA-384 和 SHA-512。它具有简洁的帮助函数,可以减少简单情况的步骤:
它还有很多性能调整选项。
I have had great success with this:
Secure Hash Algorithm (SHA)
BSD license. It covers SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. It has neat helper functions reduce steps for simple cases:
It also has a lot of performance tuning options.