ToyCrypto is a dynamically linked crypto library written in C++. It should work on both *nix-like systems, MacOSX and Windows.
This library is the result of me toying with C++ and crypto (hence the name), and can not be
relied upon to work correctly, obviously :]
This is for experimental use only! Use at your own risk!
ToyCrypto is very much a work in progress, and so far only a few hashing functions has been implemented:
- SHA2:
- SHA224
- SHA256
- SHA384
- SHA512
- SHA3:
- SHA3-224
- SHA3-256
- SHA3-384
- SHA3-512
- SHAKE:
- SHAKE128
- SHAKE256
- BLAKE
- BLAKE224
- BLAKE256
- BLAKE384
- BLAKE512
- BLAKE2
- BLAKE2s
- BLAKE2b
The following hash algorithms have also been implemented, but these have been deprecated by NIST.
-
MD2 -
MD4 -
MD5 -
SHA1
- C++20
- CMake 3.16 or higher
ninja-build
I use GTest for testing, and it should be downloaded automagically when you run cmake :]
Building is pretty straight forward:
cmake -S . -B build
cmake --build build
# To run the tests
cd build
ctest
Note: CTest appears to only run one test, and that is because all the tests are built into one single executable named unittests. To see the actual tests you should run the unittests executable directly. It should be in ./build/tests/ somewhere.