C/C++ 中最好的加密库是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/180870/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 13:30:12  来源:igfitidea点击:

What is the best encryption library in C/C++?

c++cencryption

提问by paxos1977

What is the best encryption library in C/C++ In terms of:

C/C++ 中最好的加密库是什么?

  • entropy
  • quality
  • ease of use
  • readability
  • portability
  • performance
  • 质量
  • 便于使用
  • 可读性
  • 可移植性
  • 表现

What's your favorite and why do you like it?

你最喜欢什么,为什么喜欢它?

回答by Rob Walker

We've used OpenSSLwith good success. Portable, standards compliant and easy to use.

我们已经成功地使用了OpenSSL。便携、符合标准且易于使用。

回答by Roel

I've used CryptoPP in the past (http://www.cryptopp.com/) and although its API style and programming paradigms take a little getting used to, I liked it in the end. It provides a wide range of symmetric and asymmetric algorithms with much flexibility. Documentation is so-so, the API docs are there but there's little 'high-level' overview and simple sample code. I ended up puzzling together pieces of code from around the net. It was easy to integrate into my project (linked statically). I'm using MSVC - 2003 when I started using it, now switched to 2008. It's portable across several platforms (check out the website). I've always used the default RNG, don't know which one that is.

我过去曾使用过 CryptoPP ( http://www.cryptopp.com/),虽然它的 API 风格和编程范式需要一点时间来适应,但我最终还是喜欢它。它提供了广泛的对称和非对称算法,具有很大的灵活性。文档一般般,API 文档在那里,但几乎没有“高级”概述和简单的示例代码。我最终将网络上的代码拼凑在一起。很容易集成到我的项目中(静态链接)。我开始使用时使用的是 MSVC - 2003,现在切换到 2008。它可以跨多个平台移植(查看网站)。我一直用默认的RNG,不知道是哪个。

回答by bmdhacks

I'm gonna have to go with LibTomCrypt. It's often overlooked for OpenSSL, but TomCrypt is just so lightweight and simple. As for quality, TomCrypt is widely accepted as top-quality encryption. Also, it's license is public domain which avoids the attribution hassle for your documentation that BSD licenses give you when writing commercial software.

我将不得不使用LibTomCrypt。OpenSSL 经常忽略它,但 TomCrypt 是如此轻量级和简单。至于质量,TomCrypt 被广泛接受为顶级加密。此外,它的许可证是公共领域的,这避免了 BSD 许可证在编写商业软件时为您提供的文档归属麻烦。

回答by dicroce

My favorite is GNU's library:

我最喜欢的是 GNU 的库:

libgcrypt

libgcrypt

It's performance is good, and its used EVERYWHERE so it's very well tested.

它的性能很好,而且无处不在,因此经过了很好的测试。

回答by warren

回答by Martin Beckett

The C++ version isn't out yet but goolge KeyCzar http://code.google.com/p/keyczar/might be worth looking at. Whatever you feel about their business they do have a lot of smart programmers working for them.

C++ 版本尚未发布,但 goolge KeyCzar http://code.google.com/p/keyczar/可能值得一看。不管你对他们的业务有什么看法,他们确实有很多聪明的程序员为他们工作。

回答by bortzmeyer

GPGme. Simple to use and compatible with the OpenPGP format

GPGme。使用简单且与OpenPGP 格式兼容