Modern Cryptography
for C++
Actively maintained fork of Crypto++ with modern algorithms,
better organisation, and regular security updates.
Why cryptopp-modern?
🔐 Modern Algorithms
Post-quantum cryptography (ML-KEM, ML-DSA, SLH-DSA, LMS/HSS), BLAKE3 hash function, and Argon2 password hashing (RFC 9106) - algorithms built for current and future security requirements.
🔄 Active Maintenance
Regular releases with security patches. Calendar versioning (2026.8.1) for clear release tracking.
📦 Drop-in Compatible
Full backward compatibility with Crypto++ 8.9.0. Same namespace, same APIs. Easy migration.
🏗️ Better Organisation
Source files organised in categorised directories. Easier to navigate and understand.
✅ Thoroughly Tested
45+ build configurations across Windows, Linux, and macOS. Sanitizer testing for memory safety.
🆓 Free & Open Source
Boost Software License 1.0. All code is public. No restrictions on commercial use.
What’s New
2026.9.1
- ARM acceleration restored: the CRC32 and PMULL feature probes could not find
arm_simd.hsince 2025.12.0, so default CMake and GNUmakefile builds left CRC32 and GCM multiplication on the software paths - Apple arm64 hardware dispatch: hardware AES, PMULL, SHA-1 and SHA-256 on Apple Silicon, with the optional CRC32, SHA-3 and SHA-512 extensions detected through
sysctl - HSS error paths: signer caches are rebuilt after a failed signing attempt, so a retry no longer produces an invalid signature and a burned index; LMS and HSS key generation leaves the key unchanged on failure
- Shared and static in one pass:
CRYPTOPP_BUILD_STATICalongsideCRYPTOPP_BUILD_SHARED, andBUILD_SHARED_LIBSnow selects the library type - CMake packaging and detection: the configured include directory is exported, pkg-config output is per configuration and carries the Debug postfix, the feature probes no longer fail on warnings under
-Werror, a failed AVX-512 probe falls back cleanly, and a newCRYPTOPP_WERRORoption turns warnings into errors for the library build
Previously in 2026.9.0
- RFC 9802 LMS encoding: standalone LMS public keys now use the RFC form, keys saved by earlier releases still load, and HSS L=1 parameter sets are added (details)
- PQC key hardening: failed BER decodes leave keys unchanged, unset keys refuse to encode, and ML-KEM key generation is transactional
- FileStateStore durability: the parent directory is flushed when a state file is created on POSIX systems
- Packaging:
CRYPTOPP_INSTALL_CRYPTESTinstalls thecryptesttool and its data; pkg-config output handles absolute install directories
Previously in 2026.8.1
- BLAKE3 multi-chunk fixes: digests of messages longer than 1024 bytes could be wrong on big-endian targets, while partial final blocks could depend on uninitialised stack contents on any architecture. The x86 wide hashing paths could also read outside the chaining-value stack for some exact power-of-two chunk counts
- DEFLATE hardening: malformed streams declaring an invalid HLIT value are rejected instead of overrunning the inflator’s code-length table
- Shared-build tests:
cryptestno longer fails RTTI casts against hidden-visibility shared builds, as seen on FreeBSD with Clang and libc++
Previously in 2026.8.0
- Unix shared libraries: CMake and GNUmakefile build
libcryptopp.soand.dylib; the ELF SONAME series starts atlibcryptopp.so.9 - Mixed-parameter HSS: per-level LMS/LM-OTS parameters with
HSS_SHA256_H10W4_H5W8_L2and LM-OTS W1/W2/W4 sets (details) - ChaCha SIMD fix: counter carry in the NEON, SSE2, and Altivec backends; the keystream was wrong when the 32-bit block counter overflowed inside a multi-block request
- Input validation: BLAKE3 public inputs checked at runtime; zero-length AEAD tags and invalid zero-iteration PBKDF calls rejected
Previously in 2026.7.1
- Packaging: CMake and pkg-config files install under the library directory
- pkg-config:
libcryptopp.pcrestored, with acryptopp-modern.pcalias - Distribution: signed
.tar.gzrelease (LF) alongside the.zip(CRLF); repository line endings normalised - Release-signing key published for archive verification
Quick Example
#include <cryptopp/blake3.h>
#include <cryptopp/hex.h>
#include <iostream>
int main() {
CryptoPP::BLAKE3 hash;
std::string message = "Hello, cryptopp-modern!";
std::string digest;
CryptoPP::StringSource(message, true,
new CryptoPP::HashFilter(hash,
new CryptoPP::HexEncoder(
new CryptoPP::StringSink(digest))));
std::cout << "BLAKE3: " << digest << std::endl;
return 0;
}