← Tutorials & Labs

C/C++ Cryptography

Cryptographic libraries and implementation notes in C/C++.

A subcategory of Tutorials & Labs, collecting its introduction, articles and resource entry points.

§

Articles here

22 Nov 2026 Tutorials & Labs

Botan vs Crypto++: A Positioning Guide to the Two C++ Cryptography Libraries

Both are C++ cryptography libraries, but Botan pursues a modern interface with a full TLS stack while Crypto++ wins on algorithm breadth and heritage: interface styles, post-quantum status and the scenarios each fits.

C++BotanCrypto++Library Choice

Read more →
22 Nov 2026 Tutorials & Labs

Linking OpenSSL and liboqs into One Project with CMake

A walkthrough of a working CMakeLists: find_package for OpenSSL, pkg-config for liboqs, imported targets and link order, include paths and build types — with the reason behind every line.

CMakeOpenSSLliboqsEngineering

Read more →
22 Nov 2026 Tutorials & Labs

Constant-Time Comparison and Reliable Wiping in C

memcmp's early exit and an optimized-away memset are the two classic traps in C cryptography code: the real semantics of CRYPTO_memcmp and OPENSSL_cleanse, plus every platform's secure-wipe function.

CConstant TimeOpenSSLSide Channels

Read more →
22 Nov 2026 Tutorials & Labs

Handling Large Key Material in C++: From Stack Overflows to Buffer Strategy

A Classic McEliece public key can be 1.3 MB and an SLH-DSA signature nearly 50 KB: where the stack/heap boundary lies, how vector and span divide the work, avoiding pointless copies, and wiping strategies for large secret buffers.

C++Classic McElieceMemory ManagementBuffers

Read more →
22 Nov 2026 Tutorials & Labs

Memory Management and Key Destruction in the liboqs C API

liboqs keeps key material in caller-managed buffers: how the length fields of the OQS_KEM object define every allocation, who allocates and who frees, and the correct OQS_MEM_cleanse procedure for destroying secret keys.

liboqsCMemory SafetyML-KEM

Read more →
22 Nov 2026 Tutorials & Labs

OpenSSL EVP Usage Patterns: From Key Generation to Key Encapsulation

Use OpenSSL 3.x's high-level EVP interface to generate ML-KEM keys, encapsulate and decapsulate, with a clear account of context objects, parameter passing and error handling — the three things most often gotten wrong.

OpenSSLEVPML-KEMC

Read more →
22 Nov 2026 Tutorials & Labs

Wrapping Cryptographic Objects in RAII: Making Forget-to-Free Unwritable

Put C objects such as EVP_PKEY and OQS_KEM into std::unique_ptr with custom deleters, then write a self-wiping guard class for secret-key buffers, turning release and erasure from discipline into construction.

C++RAIIOpenSSLliboqs

Read more →
22 Nov 2026 Tutorials & Labs

Catching Bugs in Cryptographic Code with AddressSanitizer and UBSan

Turn on -fsanitize=address,undefined for test builds: what each sanitizer catches, what it cannot catch, and exactly how to wire a sanitizer build into CI.

CC++TestingDebugging

Read more →
§

More in this section