Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 2.92 KB

README.md

File metadata and controls

47 lines (29 loc) · 2.92 KB

Crypter

Crypter module provides a capability to encrypt a message using combination of AES-RSA hybrid encryption.

aes-rsa encryption schema

AES algorithm is implemented based on:

Improvement of Advanced Encryption Standard Algorithm with Shift Row and S.Box Modification Mapping In Mix Column

Dependencies

Botan - Crypto and TLS for Modern C++

https://botan.randombit.net/

Usage Example

AES
unsigned char data[] = "crypter";
int dataLength = strlen((const char *)data);

AESData *plain = new AESData(data, dataLength);

AutoSeeded_RNG rng;
AESKey *key = (AESKey *)Crypto::generateKey(&rng, Crypto::AES_KEY, 128);

AESData *cipher = (AESData *)Crypto::encrypt(Crypto::AES, plain, key);

AESData *decrypted = (AESData *)Crypto::decrypt(Crypto::AES, cipher, key);
RSA
RSAData *plain = new RSAData(BigInt("12345"));

AutoSeeded_RNG rng;
RSAKey *rsaKey = (RSAKey *)Crypto::generateKey(&rng, Crypto::RSA_KEY, 2048);

RSAData *cipher = (RSAData *) Crypto::encrypt(Crypto::RSA, plain, rsaKey);

RSAData *decrypted = (RSAData *) Crypto::decrypt(Crypto::RSA, cipher, rsaKey);