Library / SDK
weidai11/cryptopp avatar
weidai11/cryptopp

Crypto++, three years of commits past the 8.9 tag

free C++ class library of cryptographic schemes

5,526 stars1,681 forksC++NOASSERTION

At a glance

What is it?
Crypto++ is a C++ class library of cryptographic schemes, originally written by Wei Dai and now maintained by a team and the community. The algorithm list is enormous, the build is make and Visual Studio rather than CMake, and the DLL that used to carry a FIPS validation now ships with a warning not to use it.
Who is it for?
Crypto++ fits a C++ codebase that needs one algorithm done in house with a filter and pipeline interface and no runtime dependency, and that accepts carrying its own crypto code. It does not fit a team that needs a current FIPS validation, a build driven by CMake, or an algorithm set trimmed to what you actually ship.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 45 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • weidai11/cryptopp5,526 ★ · +21
Star history
Repository2026-09-232026-11-14
weidai11/cryptopp5.5k5.5k

21 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The branch has moved three years past the last tag

The readme carries a version line in its own header, and it says version 8.9 dated October 1, 2023. The release list agrees: CRYPTOPP_8_9_0 on 2023-10-01, CRYPTOPP_8_8_0 on 2023-06-26, and CRYPTOPP_8_7_0 on 2022-08-07. The main branch is called master, it is not archived, and its last commit is dated 2026-10-02. Put those two facts together and the practical reading is that the code keeps moving while the tags do not. For a library that gets vendored into a product, that means the choice is between a three-year-old tag with a release note and an untagged master with three years of fixes and no version number attached. There is also History.txt at the root, which is where a change log would live if you are trying to work out what changed between the two. The default branch name being master rather than main is worth knowing before you script anything against it.

There is no CMakeLists.txt, only make and a Visual Studio solution

Build integration is the first thing to sort out, and the answer is that this is a make and Visual Studio project. The top level of the repository carries GNUmakefile and GNUmakefile-cross, plus Install.txt for the instructions, Filelist.txt for the file inventory, and Doxyfile for the generated documentation. There is no CMakeLists.txt at the top level, so a build system that expects to declare dependencies finds nothing to consume. On Windows the readme tells you to open cryptest.sln, which is noted as the file for MSVC 2003 through 2015, and pick one of four project configurations: a non-DLL-Import build producing the full static library with a full test driver, a DLL-Import build producing a static library holding only the algorithms not in the DLL, a cryptdll project that builds the DLL itself, and dlltest, a sample application that uses only the DLL. The supported compiler range is broad.

text
  * Visual Studio 2003 - 2022
  * GCC 3.3 - 13.1
  * Apple Clang 4.3 - 12.0
  * LLVM Clang 2.9 - 14.0
  * C++ Builder 2015
  * Intel C++ Compiler 9 - 16.0
  * Sun Studio 12u1 - 12.7
  * IBM XL C/C++ 10.0 - 14.0

Three continuous integration configurations sit at the root as well, from AppVeyor, Travis, and Cirrus, and the validation assets are a set of directories: TestData, TestPrograms, TestScripts, and TestVectors.

A pointer argument transfers ownership, a reference argument does not

Two notes are flagged in the readme as Important Usage Notes, and they are about C++ semantics rather than cryptography. The first is that if a constructor for a class A takes a pointer to an object B, except for primitive types such as int and char, then A owns B and will delete B at A's destruction. If the same constructor takes a reference instead, the caller keeps ownership and must not destroy B until A no longer needs it. That single distinction decides whether a stack object, a heap object, or a member can be passed in safely, and getting it wrong is a double free or a dangling pointer rather than a wrong answer.

text
1. If a constructor for A takes a pointer to an object B (except primitive
   types such as int and char), then A owns B and will delete B at A's
   destruction.

The second note is about threads. The library is thread safe at the class level, which means separate objects in separate threads are fine, but you must provide synchronization yourself when multiple threads touch one common object. There is no internal lock, so an object shared between a request thread and a worker thread is your problem to guard.

The DLL that used to carry FIPS validation is now a warning

One of the four Visual Studio configurations is now documented as a dead end, and the readme is unusually direct about it. The DLL used to provide FIPS validated cryptography, and the library and the DLL have been moved to the CMVP's historical validation list. The conclusion the readme draws is that neither the library nor the DLL is considered validated any more, and that you should no longer use the DLL. If a requirement in your organisation says the module must be FIPS validated, this library cannot satisfy it from source, and the only route the readme mentions is a pre-built DLL that has been through the validation process instead of building your own. The mechanics of using the DLL are otherwise simple: include dll.h before any other Crypto++ header file and place the DLL alongside the application.

cpp
#include "dll.h"

MD5, DES, and RC4 are still compiled in, on purpose

The algorithm inventory has a category of its own for algorithms the project calls insecure or obsolescent, and it is a long one. MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL, WAKE-OFB, DESX, RC2, SAFER, 3-WAY, GOST, SHARK, CAST-128, and Square are all listed there, with the stated reason being backwards compatibility and historical value. Nothing stops you from calling them. There is no deprecation warning attached to any of them in that list. For a codebase that only ever calls AES-GCM and HMAC, that is dead weight in the binary and in the review conversation, because a reader cannot tell from the class list alone whether a given cipher is in the current category or the historical one. The practical advice is to check the category before you pick a class, not after. On the other side of the inventory, the current schemes include GCM, CCM, EAX, ChaCha20Poly1305, XChaCha20Poly1305, ed25519, x25519, ECDSA, HKDF, and Scrypt, with the standards cited inline, such as RFC 5869 for HKDF and RFC 7914 for Scrypt.

SIMD code is compiled in, and the CPU is detected at run time

Performance is handled by shipping assembly for specific architectures rather than by asking your compiler for it. The library carries in-core code for x86, x64, x32 in the ILP32 flavour, ARM-32, Aarch32, Aarch64, and Power8, and it does run-time CPU feature detection and code selection on top of that. So one binary contains several implementations of the commonly used algorithms and picks one when it starts. The instruction set coverage is spelled out per family: the x86 line, x64, and x32 provide MMX, SSE2, and SSE4 implementations, the ARM line through Aarch64 provides NEON, ASIMD, and ARMv8, and Power8 provides in-core AES using NX Crypto Acceleration. Assembly dialects are handled separately, with GCC-style and MSVC-style inline assembly supported plus MASM for x64. Two consequences follow. Your build gets bigger, since the unused paths are still linked, and the source tree needs per-architecture files, which is why you will find a file such as aes_armv4.S and a matching header sitting next to it at the root. The root layout is flat throughout, with each algorithm as its own pair of files rather than collected in subdirectories.

The filter pipeline is the layer most callers meet first

Above the classes sits what the readme calls a high level interface built on a filter and pipeline metaphor, and it is the layer that decides how much of the class API you need. Underneath it the utility inventory is just as wide as the cipher list. There are password based key derivation functions including PBKDF1 and PBKDF2 from PKCS #5, PBKDF from PKCS #12 appendix B, HKDF from RFC 5869, and Scrypt from RFC 7914. There are pseudo random number generators covering ANSI X9.17 appendix C, RandomPool, DARN, VIA Padlock, RDRAND, RDSEED, and NIST hash and HMAC DRBGs, plus Shamir's secret sharing and Rabin's information dispersal algorithm. The arithmetic underneath is a fast multi-precision integer and polynomial library with finite field arithmetic over GF(p) and GF(2^n) and prime generation. Then there is the non-cryptographic layer, which is DEFLATE with gzip and zlib support, hex, base-32, base-64, and URL safe base-64, plus CRC, CRC-C, and Adler32. Optional platform wrappers cover high resolution timers, the random device files, and CryptGenRandom or BCryptGenRandom on Windows.

Licensing is the last loose end. The readme says you are welcome to use the library for any purpose without paying anyone, and then points to License.txt for the fine print, while no licence identifier appears in the repository metadata at all. For code that ends up inside a shipped product, that file is the one to read before you commit.

Editorial conclusion

Crypto++ fits a C++ codebase that needs one algorithm done in house with a filter and pipeline interface and no runtime dependency, and that accepts carrying its own crypto code. It does not fit a team that needs a current FIPS validation, a build driven by CMake, or an algorithm set trimmed to what you actually ship. Before adopting, read License.txt, pin a tag rather than tracking master, and confirm which of the four Visual Studio configurations you need, because the FIPS note rules one of them out.

Frequently asked questions

What is the Crypto++ library and what does it contain?

A free C++ class library of cryptographic schemes, originally written by Wei Dai and now maintained by several team members and the community. It holds authenticated encryption schemes, block and stream ciphers, block cipher modes, message authentication codes, hash functions, public-key and elliptic curve schemes, and key agreement.

How do I install Crypto++ and which compilers are supported?

Build instructions and porting notes are at cryptopp.com, and the repository ships GNUmakefile, GNUmakefile-cross, Install.txt, and cryptest.sln for Visual Studio. Listed compilers are Visual Studio 2003 to 2022, GCC 3.3 to 13.1, Apple Clang 4.3 to 12.0, LLVM Clang 2.9 to 14.0, C++ Builder 2015, Intel C++ Compiler 9 to 16.0, Sun Studio 12u1 to 12.7, and IBM XL C/C++ 10.0 to 14.0.

How does Crypto++ compare with OpenSSL?

The readme's feature list describes a class-per-algorithm design with a filter and pipeline interface on top, in-core SIMD implementations for x86, x64, x32, ARM-32, Aarch32, Aarch64, and Power8, and optional platform wrappers for system random sources.

Which alternatives to Crypto++ does the project itself name?

None in its algorithm and feature lists. It points to cryptopp.com for the most up to date build instructions and porting notes, and to License.txt for the usage terms.

Official sources

  1. Issues
  2. Project website
  3. README
  4. Releases
  5. weidai11/cryptopp on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/weidai11-cryptopp.svg)](https://hysenlabs.com/projects/weidai11-cryptopp)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/weidai11-cryptopp.svg)](https://hysenlabs.com/projects/weidai11-cryptopp)

Was this useful?