- Simple cryptographic C++ library based on OpenSSL for C++11
- Wraps around the EVP C api to allow easy keypair generation with simplfied API
- RSA keyc container and management
- RSA encrypt, decrypt, sign and verify
- AES key container
- AES encrypt, decrypt
- Custom data buffer
https://sora3e8.github.io/tancrypt
- OpenSSL3.0+
git clone https://github.com/Sora3e8/tancrypt && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .#include <iostream>
#include "tancrypt/rsa.hpp"
int main()
{
// Makes life easier
using namespace tancrypt;
// Keypair generation
RSA::pkic key;
key.generate_keypair(2048);
// Preparing example buffer from string
dutils::dbuffer data_in("Hewwo, I am secret ^.^");
// Encrypting data
dutils::dbuffer encrypted_buffer = RSA::encrypt(key,data_in);
// You can check the results via helper function dutils::hexStr
std::cout << "Original:" << data_in.toStr()<< std::endl;
std::cout << "Original(hex):" << dutils::hexStr(data_in) << std::endl;
std::cout << "Encrypted:" << encrypted_buffer.toStr() << std::endl;
std::cout << "Encrypted(hex):" << dutils::hexStr(encrypted_buffer) << std::endl;
return 0;
}