Skip to content

Modern Cryptography 
for C++

Actively maintained fork of Crypto++ with modern algorithms, 
better organisation, and regular security updates.

Why cryptopp-modern?

What’s New

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_CRYPTEST installs the cryptest tool 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: cryptest no 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.so and .dylib; the ELF SONAME series starts at libcryptopp.so.9
  • Mixed-parameter HSS: per-level LMS/LM-OTS parameters with HSS_SHA256_H10W4_H5W8_L2 and 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.pc restored, with a cryptopp-modern.pc alias
  • Distribution: signed .tar.gz release (LF) alongside the .zip (CRLF); repository line endings normalised
  • Release-signing key published for archive verification

Previously in 2026.7.0

  • SLH-DSA external interface: FIPS 205 external pure signatures interoperate with OpenSSL, X.509, and CMS; signatures are not compatible with 2026.3.0 through 2026.6.0 (details)
  • SLH-DSA context support: SLHDSA_MessageAccumulator::SetContext for explicit-context signing
  • Stateful-signing hardening: LMS/HSS sign paths fail closed on invalid state reservations; reservations are bound to their issuing store
  • FileStateStore hardening: state-file size validation on open, zero-capacity rejection, and POSIX exclusive locking

View Full Changelog

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;
}