Crypter module provides a capability to encrypt a message using combination of AES-RSA hybrid encryption.
AES algorithm is implemented based on:
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);
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);