Comparison of cryptography libraries

The tables below compare cryptography libraries that deal with cryptography algorithms and have api function calls to each of the supported features.

Cryptography libraries and their origin

Implementation Company Development Language Open Source Software License FIPS 140 validated[1] FIPS 140-2 mode Latest Update Origin
Botan Jack Lloyd C++ Yes Simplified BSD No No 2.1.0 (April 4, 2017 (2017-04-04)[2]) [±] USA
Bouncy Castle Legion of the Bouncy Castle Java, C♯ Yes MIT License No No 1.57 (Java) (May 11, 2017 (2017-05-11) [3]) [±]

1.8.1 (C#) (December 28, 2015 (2015-12-28) [4]) [±]

Australia
CryptoComply SafeLogic Java, C Yes GNU LGPL v2.1+ and commercial license Yes Yes Continuous USA
cryptlib Peter Gutmann C Yes Sleepycat License and commercial license No[lower-alpha 1] Yes 3.4.3.1 (January 30, 2017 (2017-01-30) [5]) [±] New Zealand
Crypto++ The Crypto++ project C++ Yes Boost Software License 1.0, all individual files are public domain Yes Yes October 11, 2016 (5.6.5)
Libgcrypt GnuPG community and g10code C Yes GNU LGPL v2.1+ Yes Yes 1.8.0 (July 18, 2017 (2017-07-18)[6]) [±]

1.7.8 (June 29, 2017 (2017-06-29)[7]) [±]

Germany
libsodium Frank Denis C Yes ISC license No No July 15, 2017 (1.0.13) France
libtomcrypt Tom St Denis C Yes Public Domain or WTFPL No Yes Continuous Canada
NaCL Bernstein, Lange, Schwabe C Yes Public domain No No February 21, 2011[8] Netherlands
Nettle C Yes GNU GPL v2, GNU LGPL v3 No No 3.3 (October 1, 2016 (2016-10-01)[9]) [±] Sweden
OpenSSL The OpenSSL Project C Yes Apache Licence 1.0 or 4-Clause BSD Licence Yes Yes 1.1.0f (May 25, 2017 (2017-05-25)[10]) [±]

1.0.2l (May 25, 2017 (2017-05-25)[10]) [±]

wolfCrypt wolfSSL, Inc. C Yes GPL v2 and commercial license Yes Yes 3.12 (August 4, 2017 (2017-08-04)[11]) [±] USA
  1. The actual cryptlib is not FIPS 140 validated, although a validation exists for an adapted cryptlib as part of a third party, proprietary, commercial product.

Key operations

Key operations include key generation algorithms, key exchange agreements and public key cryptography standards.

Key generation and exchange

Implementation EDH DH DSA RSA ElGamal NTRU DSS
Bouncy Castle No Yes Yes Yes
Yes No
CryptoComply Yes Yes Yes Yes Yes Yes Yes
cryptlib Yes Yes Yes Yes
No Yes
Crypto++ Yes Yes Yes Yes
No No
Libgcrypt Yes[lower-alpha 1] Yes Yes Yes Yes No Yes
libsodium No Yes Yes No
No No
Nettle No No Yes Yes
No No
wolfCrypt Yes Yes Yes Yes
Yes Yes
  1. By using the lower level interface.

Elliptic curve cryptography (ECC) support

Implementation NIST SECG ECC Brainpool ECDSA ECDH Curve25519 EdDSA GOST R 34.10
Bouncy Castle Yes
Yes
CryptoComply Yes Yes Yes Yes Yes Yes Yes Yes
cryptlib Yes
Crypto++ Yes
No No
Libgcrypt Yes Yes Yes Yes Yes Yes Yes Yes
libsodium Yes
Yes Yes
Nettle Yes
No No
wolfCrypt Yes
Yes Yes

Public key cryptography standards

Implementation PKCS#1 PKCS#5 PKCS#8 PKCS#12 IEEE P1363 ASN.1
Bouncy Castle Yes Yes No Yes Yes Yes
CryptoComply Yes Yes Yes Yes Yes Yes
cryptlib Yes Yes Yes Yes No Yes
Crypto++ Yes Yes No No Yes Yes
Libgcrypt Yes Yes[lower-alpha 1] Yes[lower-alpha 1] Yes[lower-alpha 1] Yes[lower-alpha 1] Yes[lower-alpha 1]
libsodium No No No No No No
Nettle Yes Yes No No No No
wolfCrypt Yes Yes Yes Yes No Yes
  1. 1 2 3 4 5 These Public Key Cryptographic Standards (PKCS) are supported by accompanying libraries and tools, which are also part of the GnuPG framework, although not by the actual libgcrypt library.

Hash functions

Comparison of supported cryptographic hash functions. At the moment this section also includes ciphers that are used for producing a MAC tag for a message. Here hash functions are defined as taking an arbitrary length message and producing a fixed size output that is virtually impossible to use for recreating the original message.

Implementation MD5 SHA-1 SHA-2 SHA-3 RIPEMD-160 Tiger Whirlpool GOST Stribog BLAKE2
Botan Yes Yes Yes Yes Yes Yes Yes Yes
Yes
Bouncy Castle Yes Yes Yes Yes Yes Yes Yes Yes
Yes
CryptoComply Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
cryptlib Yes Yes Yes Yes Yes No Yes No No No
Crypto++ Yes Yes Yes Yes Yes Yes Yes Yes
Yes
Libgcrypt Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
libsodium No No Yes No No No No No No Yes
Nettle Yes Yes Yes Yes Yes No No Yes
No
OpenSSL Yes Yes Yes No Yes Yes Yes Yes
Yes
wolfCrypt Yes Yes Yes Yes Yes No No No
Yes

MAC algorithms

Comparison of implementations of message authentication code (MAC) algorithms. A MAC is a short piece of information used to authenticate a message—in other words, to confirm that the message came from the stated sender (its authenticity) and has not been changed in transit (its integrity).

Implementation HMAC-MD5 HMAC-SHA1 HMAC-SHA2 Poly1305-AES BLAKE2-MAC
Botan Yes Yes Yes Yes Yes
Bouncy Castle Yes Yes Yes Yes Yes
CryptoComply Yes Yes Yes Yes Yes
cryptlib Yes Yes Yes No No
Crypto++ Yes Yes Yes No Yes
Libgcrypt Yes Yes Yes Yes Yes
libsodium No No Yes Yes Yes
Nettle Yes Yes Yes Yes No
wolfCrypt Yes Yes Yes Yes Yes

Block ciphers

Table compares implementations of block ciphers. Block ciphers are defined as being deterministic and operating on a set number of bits (termed a block) using a symmetric key. Each block cipher can be broken up into the possible key sizes and block cipher modes it can be run with.

Block cipher algorithms

Implementation AES-128 AES-192 AES-256 Camellia 3DES Blowfish Twofish CAST5 IDEA GOST 28147-89
Bouncy Castle[12] Yes Yes Yes Yes Yes Yes
CryptoComply Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
cryptlib[13] Yes Yes Yes No Yes Yes
Crypto++[14] Yes Yes Yes Yes Yes Yes
Libgcrypt Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
libsodium Yes No Yes No No No
Nettle Yes Yes Yes Yes Yes Yes
wolfCrypt Yes Yes Yes Yes Yes No
Yes

Cipher modes

Implementation ECB CBC OFB CFB CTR CCM GCM OCB XTS AES-Wrap Stream
Bouncy Castle No Yes
Yes Yes Yes
CryptoComply Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
cryptlib Yes Yes
Yes No No
Crypto++ Yes Yes
Yes Yes Yes
Libgcrypt Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
libsodium No No
Yes No Yes
Nettle Yes Yes
Yes Yes Yes
wolfCrypt Yes Yes
Yes Yes Yes

Stream ciphers

Table compares implementations of the various stream ciphers. Stream ciphers are defined as using plain text digits that are combined with a pseudorandom cipher digit stream. Stream ciphers are typically faster than block ciphers and may have lower hardware complexity, but may be more susceptible to attacks.

Implementation RC4 HC-256 Rabbit Salsa20 ChaCha SEAL Panama WAKE Grain VMPC ISAAC
Bouncy Castle Yes Yes No Yes Yes No No No Yes Yes Yes
CryptoComply Yes Yes No Yes Yes No No No Yes Yes Yes
cryptlib Yes No No No No No No No No No No
Crypto++ Yes No No Yes No Yes Yes Yes No No No
Libgcrypt Yes No No Yes Yes No No No No No No
libsodium No No No Yes Yes No No No No No No
Nettle Yes No No Yes Yes No No No No No No
wolfCrypt Yes Yes Yes Yes Yes No No No No No No

Hardware-assisted support

Table compares the ability to utilize hardware enhanced cryptography. With using the assistance of specific hardware the library can achieve faster speeds and / or improved security than otherwise.

Smartcard, SIM and HSM protocol support

Implementation PKCS #11 PC/SC CCID
CryptoComply Yes
cryptlib Yes
Crypto++ No
Libgcrypt Yes [15] Yes [16] Yes [17]
libsodium No
wolfCrypt No

General purpose CPU / platform acceleration support

Implementation AES-NI SSSE3 / SSE4.1 AVX / AVX2 RdRand VIA PadLock Intel QuickAssist ARMv7-A NEON ARMv8-A
CryptoComply Yes Yes Yes Yes Yes No Yes Yes
cryptlib No
Yes No
No
Crypto++ Yes
No No
No
Libgcrypt[18] Yes Yes Yes Yes Yes No Yes Yes
libsodium Yes Yes Yes
No No
No
wolfCrypt Yes
Yes Yes No Yes[19]
Yes[20]

Microcontrollers' cryptographic accelerator support

Implementation STM32F2 STM32F4 Cavium NITROX Freescale CAU/mmCAU Microchip PIC32MZ Atmel ATECC508A TI TivaC Series CubeMX Nordic nRF51
cryptlib No No No No No No No No No
Crypto++ No No No No No No No No No
Libgcrypt No No No No No No No No No
libsodium No No No No No No No No No
wolfCrypt Yes Yes Yes Yes Yes Yes[21] Yes[22] Yes Yes

Code size and code to comment ratio

Implementation Source Code Size

(kSLOC = 1000 lines of source code)

Code Lines to Comment Lines Ratio
Botan 75[23] 4.28[23]
Bouncy Castle 1359[24] 5.26[24]
cryptlib 241 2.66
Crypto++ 159[25] 10.1[25]
Libgcrypt 216[26] 6.27[26]
libsodium 44[27] 21.92[27]
libtomcrypt 67[28] 3.98[28]
Nettle 111[29] 4.08[29]
OpenSSL 472[30] 4.41[30]
wolfCrypt 39 5.69

Portability

Implementation Supported Operating System Thread safe
CryptoComply Linux (RHEL, CentOS, Debian, Ubuntu, etc.), Windows, iOS, Android, FreeBSD, macOS, Solaris, Java Runtime Environment Yes
cryptlib AMX, BeOS, ChorusOS, DOS, eCOS, FreeRTOS/OpenRTOS, uItron, MVS, OS/2, Palm OS, QNX Neutrino, RTEMS, Tandem NonStop, ThreadX, uC/OS II, Unix (AIX, FreeBSD, HP-UX, Linux, macOS, Solaris, etc.), VDK, VM/CMS, VxWorks, Win16, Win32, Win64, WinCE/PocketPC/etc, XMK Yes
Crypto++ Unix (OpenBSD, Linux, macOS, etc.), Win32, Win64, Android, iOS, ARM
Libgcrypt All 32 and 64 bit Unix Systems (GNU/Linux, FreeBSD, NetBSD, macOS etc.), Win32, Win64, WinCE and more Yes[31]
libsodium macOS, Linux, OpenBSD, NetBSD, FreeBSD, DragonflyBSD, Android, iOS, 32 and 64-bit Windows (Visual Studio, MinGW, C++ Builder), NativeClient, QNX, JavaScript, AIX, MINIX, Solaris Yes
wolfCrypt Win32/64, Linux, macOS, Solaris, ThreadX, VxWorks, FreeBSD, NetBSD, OpenBSD, embedded Linux, WinCE, Haiku, OpenWRT, iPhone (iOS), Android, Nintendo Wii and Gamecube through DevKitPro, QNX, MontaVista, NonStop, TRON/ITRON/µITRON, Micrium's µC/OS, FreeRTOS, SafeRTOS, Freescale MQX, Nucleus, TinyOS, HP-UX Yes

References

  1. Validated FIPS 140 Cryptographic Modules, NIST.gov, retrieved 2015-12-22
  2. "Botan: Newslog". Retrieved 4 April 2017.
  3. "Latest Java Releases - bouncycastle.org". 2017-05-11. Retrieved 2017-08-03.
  4. "The Legion of the Bouncy Castle C# Cryptography APIs". 2015-12-28. Retrieved 2015-12-29.
  5. "cryptlib 3.4.3 released". 2016-03-25. Retrieved 2016-04-05.
  6. Koch, Werner (2017-07-18). "[Announce] Libgcrypt 1.8.0 released" (Mailing list). gnupg-announce. Retrieved 2017-07-19.
  7. "[Announce] Libgcrypt 1.7.8 released". gnupg-announce. 2017-06-29. Retrieved 2017-06-29.
  8. Downloading and installing NaCl, Bernstein, Lange, Schwabe, retrieved 2017-05-22
  9. "GNU Nettle". directory.fsf.org. FSF. 24 April 2015.
  10. 1 2 "OpenSSL: Newslog". Retrieved 2017-02-16.
  11. "wolfSSL ChangeLog". 2017-08-04. Retrieved 2017-08-07.
  12. Bouncy Castle Specifications, bouncycastle.org, retrieved 2015-11-28
  13. cryptlib Encryption Toolkit, Peter Gutmann, retrieved 2015-11-28
  14. Crypto++ Library, Cryptopp.com, retrieved 2015-11-28
  15. With Scute, scute.org
  16. With GnuPG's SCdaemon & gpg-agent, gnupg.org
  17. With GnuPG's SCdaemon & gpg-agent, gnupg.org
  18. hwfeatures.c, git.gnupg.org
  19. https://www.wolfssl.com/wolfSSL/Blog/Entries/2017/1/18_wolfSSL_Asynchronous_Intel_QuickAssist_Support.html
  20. https://www.wolfssl.com/wolfSSL/Blog/Entries/2016/10/13_wolfSSL_ARMv8_Support.html
  21. https://www.wolfssl.com/wolfSSL/wolfssl-atmel.html
  22. http://processors.wiki.ti.com/index.php/Using_wolfSSL_with_TI-RTOS
  23. 1 2 Language Analysis of Botan, OpenHub.net, retrieved 2017-05-07
  24. 1 2 Language Analysis of Bouncy Castle, OpenHub.net, retrieved 2015-12-23
  25. 1 2 Language Analysis of Crypto++, OpenHub.net, retrieved 2015-12-23
  26. 1 2 Language Analysis of Libgcrypt, OpenHub.net, retrieved 2015-12-23
  27. 1 2 Language Analysis of libsodium, OpenHub.net, retrieved 2017-05-07
  28. 1 2 Language Analysis of libtomcrypt, OpenHub.net, retrieved 2017-05-07
  29. 1 2 Language Analysis of Nettle, OpenHub.net, retrieved 2015-12-23
  30. 1 2 Language Analysis of OpenSSL, OpenHub.net, retrieved 2017-05-07
  31. GnuPG documentation: Libgcrypt overview - thread safety, GnuPG.org, retrieved 2016-04-16
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.