Skip to content

Aseman-Land/neo-crypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeoCrypt

NeoCrypt is a cryptographic library based on OpenSSL, designed to provide an easy-to-use asymmetric encryption API for C++.

Dependencies

There are no dependencies other than OpenSSL.

How to Build

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make -j8
sudo make install

How to Use

using namespace Neo::Crypto;

const auto asym = Asymmetric::generate(Asymmetric::TypeSchnorrsigSECP);
std::cout << "Private Key: " << asym.privateKey() << std::endl;
std::cout << "Private Key: " << asym.publicKey() << std::endl;

const auto data = Neo::ByteArray::fromString("Hello world :)");
const auto enc_data = asym.encrypt(data);
const auto dec_data = asym.decrypt(enc_data);

std::cout << "Data " << data.toString() << std::endl;
std::cout << "Encrypted Data: " << enc_data.base64() << std::endl;
std::cout << "Decrypted Data: " << dec_data.toString() << std::endl;

const auto sign = asym.sign(data);
const auto verify = asym.verify(sign, data);

std::cout << "Sign " << sign.base64() << std::endl;
std::cout << "Verified: " << verify << std::endl;

About

A cryptographic library based on **OpenSSL**, designed to provide an easy-to-use **asymmetric encryption** API for C++.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors