CryptoTools is a portable c++14 library containing a collection of tools for building cryptographic protocols. This include asynchronous networking (Boost Asio), several fast primitives such as AES (AES-NI), Blake2 (assembly), and eliptic curve crypto (Relic-Toolkit, Miracl, or libsodium). There are also several other utilities tailored for implementing protocols.

Thirdparty networking is also supported. See frontend_cryptoTools/tutorial/Network.cpp for an example.


The library is cross platform and has been tested on Windows, Mac and Linux. There is one mandatory dependency on Boost 1.75 (networking), and optional dependency on Relic. CMake 3.18+ is required and the build script assumes python 3.

git clone
cd cryptoTools
python --setup --boost --relic

It is possible to build only the protocol(s) that are desired via cmake command. In addition, if boost and or relic are already installed, then boost or relic can be ommitted from python setup boost relic.

See the output of python or cmake . for available compile options. For example,


will build without SSE instrisics. Argument after the -- are forwarded to cmake.

The main executable with examples is frontend and is located in the build directory, eg out/build/linux/frontend/frontend_cryptoTools, out/build/x64-Release/frontend/Release/frontend_cryptoTools.exe depending on the OS.

Enabling/Disabling dependancies:

  • The library can be built without Relic as
    python --setup --boost
    python -D -D ENABLE_RELIC=OFF
  • The library can be built without Boost as
    python --setup --relic
    python -D -D ENABLE_BOOST=OFF


cryptoTools can be installed and linked the same way as other cmake project. By default the dependancies are not installed. To install then, run the following

python --setup --boost --relic --install

You can also provide and install location by specifying --install=path/to/installation.

The main library is similarly installed as

python --install 

By default, sudo is not used. If installation requires sudo access, then call

python --install --sudo

See python --help for full details.


cryptoTools can be linked via cmake as

find_package(cryptoTools REQUIRED)

target_link_libraries(myProject oc::cryptoTools)

Other exposed targets are oc::tests_cryptoTools. In addition, cmake variables cryptoTools_LIB, cryptoTools_INC, ENABLE_XXX will be defined when found, where XXX is one of the cryptoTools options.

To ensure that cmake can find cryptoTools, you can either install cryptoTools or build it locally and include cryptoTools in the CMAKE_PREFIX_PATH variable or provide its location as a cmake HINTS.


This project is dual licensed under MIT and Unlicensed.

For Unlicensed, this project has been placed in the public domain. As such, you are unrestricted in how you use it, commercial or otherwise. However, no warranty of fitness is provided. If you found this project helpful, feel free to spread the word and cite us.


Contact Peter Rindal for any assistance on building or running the library.


A repo to hold common tools used by my crypto projects

Cryptotools Info

⭐ Stars 48
🔗 Source Code
🕒 Last Update 7 months ago
🕒 Created 6 years ago
🐞 Open Issues 0
➗ Star-Issue Ratio Infinity
😎 Author ladnir