Installation

Installation

cryptopp-modern is distributed as source releases. Download the latest release package, build, and install on Windows, Linux, and macOS.

Downloads

Latest Release (2025.12.0)

FileDescription
cryptopp-modern-2025.12.0.zipSource release
cryptopp-modern-2025.12.0.zip.sigGPG signature (binary)
cryptopp-modern-2025.12.0.zip.ascGPG signature (ASCII)
cryptopp-modern-2025.12.0.zip.sha256SHA256 checksum

Verify Download

# Verify GPG signature
gpg --verify cryptopp-modern-2025.12.0.zip.sig cryptopp-modern-2025.12.0.zip

# Verify SHA256 checksum
sha256sum -c cryptopp-modern-2025.12.0.zip.sha256

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 SystemBest For
CMakeIDE integration, presets, find_package() support
GNUmakefileTraditional Make-based workflows, Linux/macOS
Visual StudioNative Windows development with full IDE
nmakeWindows command-line builds without IDE

Building with CMake

CMake is one of the supported build systems for cryptopp-modern. It provides IDE integration, presets for common configurations, and proper find_package() support for consuming projects.

Linux / macOS

# Download and extract release
cd /tmp
wget https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2025.12.0/cryptopp-modern-2025.12.0.zip
unzip -q cryptopp-modern-2025.12.0.zip -d cryptopp
cd cryptopp

# Configure with default preset (Release, Ninja)
cmake --preset=default

# Build
cmake --build build/default -j$(nproc)

# Run tests
./build/default/cryptest.exe v

# Install
sudo cmake --install build/default --prefix /usr/local

Windows (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 --prefix C:\cryptopp

Windows (MinGW)

# Download and extract release, then in the extracted folder:

# Configure with default preset
cmake --preset=default

# Build (use -j4 or similar if nproc is unavailable)
cmake --build build/default -j$(nproc)

# Run tests
./build/default/cryptest.exe v

CMake Presets

The project includes pre-configured build presets:

PresetGeneratorBuild TypeDescription
defaultNinjaReleaseDefault build for Linux/macOS/MinGW
debugNinjaDebugDebug build with symbols
msvcVisual Studio 17 2022-Windows MSVC build
msvc-releaseVisual Studio 17 2022ReleaseMSVC release build
no-asmNinjaReleasePure C++ (no assembly)
# List all available presets
cmake --list-presets

CMake Options

OptionDefaultDescription
CRYPTOPP_BUILD_TESTINGONBuild the test executable
CRYPTOPP_INSTALLONGenerate install targets
CRYPTOPP_DISABLE_ASMOFFDisable all assembly optimisations
CRYPTOPP_USE_OPENMPOFFEnable OpenMP for parallel algorithms
# Example: Build without assembly
cmake -B build -DCRYPTOPP_DISABLE_ASM=ON
cmake --build build

Building 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 \
  wget \
  unzip

# Download and extract
cd /tmp
wget https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2025.12.0/cryptopp-modern-2025.12.0.zip
unzip -q cryptopp-modern-2025.12.0.zip -d cryptopp
cd cryptopp

# Build and install
make -j$(nproc)
sudo make install PREFIX=/usr/local
sudo ldconfig

# Verify installation
./cryptest.exe v

Windows (MinGW)

# Download release from:
# https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2025.12.0/cryptopp-modern-2025.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)

# Test
./cryptest.exe v

macOS

# Download and extract
cd /tmp
curl -L -O https://github.com/cryptopp-modern/cryptopp-modern/releases/download/2025.12.0/cryptopp-modern-2025.12.0.zip
unzip -q cryptopp-modern-2025.12.0.zip -d cryptopp
cd cryptopp

# Build and install
make -j$(sysctl -n hw.ncpu)
sudo make install PREFIX=/usr/local

# Verify installation
./cryptest.exe v

Building 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 library
  • cryptdll - 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 v

Building 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 / macOS (GNUmakefile)

git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
make -j$(nproc)
sudo make install PREFIX=/usr/local
sudo ldconfig  # Linux only

Linux / macOS / Windows (CMake)

git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
cmake --preset=default
cmake --build build/default

Windows (MinGW)

git clone https://github.com/cryptopp-modern/cryptopp-modern.git
cd cryptopp-modern
mingw32-make.exe -j10

Prerequisites

All Platforms

  • C++11 (or newer) compatible compiler

For CMake Builds

  • CMake 3.20 or higher
  • Ninja (recommended) or Make

Linux

  • GCC 4.8+ or Clang 3.4+
  • GNU Make (for GNUmakefile builds)

Install on Ubuntu/Debian:

sudo apt-get update
sudo apt-get install build-essential cmake ninja-build

Install on Fedora/RHEL:

sudo dnf install gcc-c++ make cmake ninja-build

macOS

  • Xcode Command Line Tools
xcode-select --install
brew install cmake ninja  # For CMake builds

Windows

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:

make

This produces libcryptopp.a which can be linked statically into your applications.

Dynamic/Shared Library

make dynamic

This produces libcryptopp.so on Linux, libcryptopp.dylib on macOS, or libcryptopp.dll on Windows.

Debug Build

make CXXFLAGS="-g -O0"

Custom C++ Standard

# Build with C++11
make CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"

# Build with C++17
make CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++17"

Custom Installation Location

# Install to custom prefix
make install PREFIX=/opt/cryptopp-modern

# Install to user directory (no sudo needed)
make install PREFIX=$HOME/.local

Verify Installation

Run the validation tests:

# Quick validation
./cryptest.exe v

# Full test vectors
./cryptest.exe tv all

Expected 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

# With static linking
g++ -std=c++11 myapp.cpp -I/usr/local/include -L/usr/local/lib -lcryptopp -static

CMake (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 build

CMake (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)

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 reference
  • GNUMAKEFILE.md - Full GNUmakefile build system reference

Next Steps