Installation
cryptopp-modern is distributed as source releases. Download the latest release package, build, and install on Windows, Linux, and macOS.
Downloads
Latest Release (2026.12.0)
| File | Description |
|---|---|
| cryptopp-modern-2026.12.0.zip | Source release (Windows, CRLF) |
| cryptopp-modern-2026.12.0.zip.sig | GPG signature (binary) |
| cryptopp-modern-2026.12.0.zip.asc | GPG signature (ASCII) |
| cryptopp-modern-2026.12.0.zip.sha256 | SHA256 checksum |
| cryptopp-modern-2026.12.0.tar.gz | Source release (Unix, LF) |
| cryptopp-modern-2026.12.0.tar.gz.sig | GPG signature (binary) |
| cryptopp-modern-2026.12.0.tar.gz.asc | GPG signature (ASCII) |
| cryptopp-modern-2026.12.0.tar.gz.sha256 | SHA256 checksum |
Verify Download
Release archives are signed with the CoraleSoft release key, fingerprint 844D CFC4 4A5D E9C1 4C3A 2F62 497A 4CFB B700 543E. Import the key once and check its fingerprint before verifying, as described in Security.md. The key is in the KEYS file at the repository root and in the archive root, and on keys.openpgp.org.
# Import the release signing key and check its fingerprint
gpg --keyserver keys.openpgp.org --recv-keys 844DCFC44A5DE9C14C3A2F62497A4CFBB700543E
gpg --fingerprint 844DCFC44A5DE9C14C3A2F62497A4CFBB700543E
# Verify GPG signature
gpg --verify cryptopp-modern-2026.12.0.tar.gz.sig cryptopp-modern-2026.12.0.tar.gz
# Verify SHA256 checksum (on macOS use: shasum -a 256 -c)
sha256sum -c cryptopp-modern-2026.12.0.tar.gz.sha256- All Releases: Release History
Build Systems
cryptopp-modern can be built with either CMake or the provided GNUmakefile, with additional Visual Studio and nmake options on Windows. Choose the option that best fits your development environment.
| Build System | Best For |
|---|---|
| CMake | IDE integration, presets, find_package() support |
| GNUmakefile | Traditional Make-based workflows, Linux/macOS |
| Visual Studio | Native Windows development with full IDE |
| nmake | Windows command-line builds without IDE |
Building with CMake
Linux / macOS
# Download and extract release
cd /tmp
curl -fLO https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2026.12.0/cryptopp-modern-2026.12.0.tar.gz
tar -xzf cryptopp-modern-2026.12.0.tar.gz
cd cryptopp-modern-2026.12.0
# Configure with default preset (Release, Ninja)
cmake --preset=default
# Build
cmake --build build/default --parallel 4
# Run tests
./build/default/cryptest.exe v
# Install
sudo cmake --install build/default --prefix /usr/localWindows (MSVC)
# Download and extract release, then in the extracted folder:
# Configure with MSVC preset
cmake --preset=msvc
# Build Release configuration
cmake --build build\msvc --config Release
# Run tests
.\build\msvc\Release\cryptest.exe v
# Install (run as Administrator)
cmake --install build\msvc --config Release --prefix C:\cryptoppWindows (MinGW)
# Download and extract release, then in the extracted folder:
# Configure with default preset
cmake --preset=default
# Build
cmake --build build/default --parallel 4
# Run tests
./build/default/cryptest.exe vCMake Presets
The project includes pre-configured build presets:
| Preset | Generator | Build Type | Description |
|---|---|---|---|
default | Ninja | Release | Default build for Linux/macOS/MinGW |
debug | Ninja | Debug | Debug build with symbols |
release | Ninja | Release | Release build with optimizations |
relwithdebinfo | Ninja | RelWithDebInfo | Release build with debug symbols |
msvc | Visual Studio 17 2022 | Debug or Release, chosen at build time | Windows MSVC build |
no-asm | Ninja | Release | Pure C++ (no assembly) |
The Visual Studio generator is multi-config, so msvc configures once and the configuration is chosen when building: cmake --build --preset=msvc-debug or cmake --build --preset=msvc-release, with ctest --preset=msvc-debug and ctest --preset=msvc-release to match.
# List all available presets
cmake --list-presetsCMake Options
| Option | Default | Description |
|---|---|---|
CRYPTOPP_BUILD_TESTING | ON | Build the test executable |
CRYPTOPP_INSTALL | ON | Generate install targets |
CRYPTOPP_DISABLE_ASM | OFF | Disable all assembly optimisations |
CRYPTOPP_USE_OPENMP | OFF | Enable OpenMP for parallel algorithms |
# Example: Build without assembly
cmake -B build -DCRYPTOPP_DISABLE_ASM=ON
cmake --build buildBuilding with GNUmakefile
The GNUmakefile provides a straightforward Make-based build for cryptopp-modern, suitable for classic command-line workflows and packaging scripts.
Linux
# Prepare build environment
sudo apt-get update
sudo apt-get install -y build-essential g++ make curl
# Download and extract
cd /tmp
curl -fLO https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2026.12.0/cryptopp-modern-2026.12.0.tar.gz
tar -xzf cryptopp-modern-2026.12.0.tar.gz
cd cryptopp-modern-2026.12.0
# Build and test
make -j$(nproc)
./cryptest.exe v
# Install
sudo make install PREFIX=/usr/local
sudo ldconfigWindows (MinGW)
# Download release from:
# https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2026.12.0/cryptopp-modern-2026.12.0.zip
# Extract the zip file
# Open MinGW terminal and navigate to extracted folder
# Build (use -j4 or similar if nproc is unavailable)
mingw32-make.exe -j$(nproc)
# Release build (small binaries, no debug symbols)
mingw32-make.exe -j$(nproc) BUILD=release
# Test
./cryptest.exe vmacOS
# Download and extract
cd /tmp
curl -fLO https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2026.12.0/cryptopp-modern-2026.12.0.tar.gz
tar -xzf cryptopp-modern-2026.12.0.tar.gz
cd cryptopp-modern-2026.12.0
# Build and test
make -j$(sysctl -n hw.ncpu)
./cryptest.exe v
# Install
sudo make install PREFIX=/usr/localBuilding with Visual Studio
Visual Studio provides native Windows development with full IDE support, debugging, and IntelliSense.
# Clone or download the source
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
# Open cryptest.sln in Visual Studio
# Build > Build Solution (Ctrl+Shift+B)The solution includes projects for:
cryptlib- Static librarycryptdll- Dynamic library (DLL)cryptest- Test executable
Building with nmake
nmake provides Windows command-line builds without requiring the full Visual Studio IDE, using the MSVC compiler toolchain.
# Open "Developer Command Prompt for VS" or "x64 Native Tools Command Prompt"
# Clone or download the source
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
# Build
nmake /f cryptest.nmake
# Test
cryptest.exe vBuilding from Git Source
Note: For most users, we recommend using the release packages. Building from git is intended for developers who want to contribute or test unreleased changes.
Linux (GNUmakefile)
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
make -j$(nproc)
./cryptest.exe v
sudo make install PREFIX=/usr/local
sudo ldconfigmacOS (GNUmakefile)
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
make -j$(sysctl -n hw.ncpu)
./cryptest.exe v
sudo make install PREFIX=/usr/localLinux / macOS / Windows (CMake)
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
cmake --preset=default
cmake --build build/defaultWindows (MinGW)
git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
mingw32-make.exe -j10Prerequisites
All Platforms
- C++11 (or newer) compatible compiler
For CMake Builds
- CMake 3.25 or higher (the presets file uses schema version 6)
- Ninja (recommended) or Make
Linux
- GCC or Clang with C++11 support
- GNU Make (for GNUmakefile builds)
Install on Ubuntu/Debian:
sudo apt-get update
sudo apt-get install build-essential cmake ninja-buildInstall on Fedora/RHEL:
sudo dnf install gcc-c++ make cmake ninja-buildmacOS
- Xcode Command Line Tools
xcode-select --install
brew install cmake ninja # For CMake buildsWindows
For CMake builds:
For GNUmakefile builds:
For Visual Studio builds:
- Visual Studio 2022 (or 2019) with “Desktop development with C++” workload
For nmake builds:
- Visual Studio Build Tools (includes nmake and MSVC compiler)
Build Configuration
Static Library (Default)
The default make command produces libcryptopp.a, a static library:
makeThis produces libcryptopp.a which can be linked statically into your applications.
Dynamic/Shared Library
make dynamicmake dynamic builds libcryptopp.so on Linux or libcryptopp.dylib on macOS. Neither the GNUmakefile nor CMake builds a Windows DLL; Windows builds use the static library.
Build Types
The BUILD variable controls optimization and debug symbol settings:
# Release with debug info (default)
make -j$(nproc)
make -j$(nproc) BUILD=relwithdebinfo
# Release - optimized, no debug symbols (smallest binaries)
make -j$(nproc) BUILD=release
# Debug - no optimization, debug symbols, assertions enabled
make -j$(nproc) BUILD=debug| Build Type | Optimization | Debug Symbols | Define | Use Case |
|---|---|---|---|---|
relwithdebinfo (default) | -O3 | -g2 | -DNDEBUG | Development and debugging |
release | -O3 | none | -DNDEBUG | Production deployment |
debug | -O0 | -g2 | -DDEBUG | Debugging and diagnostics |
Custom C++ Standard
Export CXXFLAGS rather than passing it as a make argument, so the GNUmakefile keeps the flags it adds itself. Run make clean when changing the standard, because make does not rebuild when only the flags change.
# Build with C++11
export CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
make -j$(nproc)
# Build with C++17 (clean first, because the flags changed)
make clean
export CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++17"
make -j$(nproc)Custom Installation Location
# Install to custom prefix
make install PREFIX=/opt/cryptopp-modern
# Install to user directory (no sudo needed)
make install PREFIX=$HOME/.localVerify Installation
Run the validation tests:
# Quick validation
./cryptest.exe v
# Full test vectors
./cryptest.exe tv allExpected output:
All tests passed!Using in Your Project
Compiler Flags
# Compile
g++ -std=c++11 myapp.cpp -I/usr/local/include -L/usr/local/lib -lcryptopp
# Link the static library directly
g++ -std=c++11 myapp.cpp -I/usr/local/include /usr/local/lib/libcryptopp.aCMake (find_package)
If you built cryptopp-modern with CMake and installed it, you can use find_package():
cmake_minimum_required(VERSION 3.20)
project(MyApp)
find_package(cryptopp-modern REQUIRED)
add_executable(myapp main.cpp)
target_link_libraries(myapp PRIVATE cryptopp::cryptopp)Build your project:
cmake -B build -DCMAKE_PREFIX_PATH=/path/to/cryptopp-install
cmake --build buildCMake (Manual)
If you installed with GNUmakefile or need manual configuration:
cmake_minimum_required(VERSION 3.10)
project(MyApp)
set(CMAKE_CXX_STANDARD 11)
find_library(CRYPTOPP_LIB cryptopp PATHS /usr/local/lib)
include_directories(/usr/local/include)
add_executable(myapp main.cpp)
target_link_libraries(myapp ${CRYPTOPP_LIB})Makefile
CXX = g++
CXXFLAGS = -std=c++11 -I/usr/local/include
LDFLAGS = -L/usr/local/lib -lcryptopp
myapp: main.cpp
$(CXX) $(CXXFLAGS) -o myapp main.cpp $(LDFLAGS)
Link-Time Optimisation
LTO is supported. Builds with -flto pass the test suite in continuous integration with the assembly and SIMD code enabled, in these configurations:
| Compiler | Build system | Architecture | Flags |
|---|---|---|---|
| GCC | GNUmakefile | x86-64 | a distribution’s hardening and optimisation flags, including -flto, with gcc-ar/gcc-ranlib |
| GCC | GNUmakefile | 32-bit x86 | -m32 -O2 -flto=auto -flto-partition=max |
| Clang | GNUmakefile | x86-64 | -O2 -flto, with llvm-ar/llvm-ranlib |
| GCC | CMake | x86-64 | -flto in CMAKE_CXX_FLAGS, Release (-O3), with gcc-ar/gcc-ranlib |
| GCC | CMake | x86-64 | CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON, Release (-O3) |
With the GNUmakefile, export CXXFLAGS rather than passing it on the make command line, and use the compiler’s archiver wrapper (gcc-ar or llvm-ar).
Advanced Build Options
For advanced build options including sanitisers, code coverage, SIMD feature flags, and more, see the detailed documentation in the source distribution:
CMAKE.md- Full CMake build system referenceGNUMAKEFILE.md- Full GNUmakefile build system reference
Next Steps
- Quick Start Guide - Get started with your first program
- Beginner’s Guide - Complete tutorial for beginners
- Security Concepts - Essential security practices