EPS Conduits  v0.0.2-2413
networking over networking
EPS::Cipher Namespace Reference

Cipher takes care of calling OpenSSL to encrypt and decrypt NetBuffer objects. More...

Functions

void reset (void)
 Reset OpenSSL. More...
 
void initialize (EPS::StrMap &configuration)
 Initialize OpenSSL ciphers. More...
 
void get_cipher_key_and_iv (EPS::StrMap &configuration)
 Get and parse the key and iv from configuration. More...
 
EPS::NetBufferencrypt (EPS::NetBuffer &buffer)
 Encrypt a network buffer. Return a pointer to the newly-encrypted buffer. The original buffer remains untouched. More...
 
EPS::NetBufferdecrypt (EPS::NetBuffer &buffer)
 Decrypt a network buffer. Return a pointer to the newly-decrypted buffer. The original buffer remains untouched. More...
 
EPS::NetBufferdecrypt_header (EPS::NetBuffer &buffer)
 Decrypt only the first few bytes ("header") of a network buffer. Return a pointer to the newly-decrypted buffer. The original buffer remains untouched. More...
 

Variables

std::array< uint8_t, 32 > key
 OpenSSL: 256-bit encryption/decryption key. More...
 
std::array< uint8_t, 16 > iv
 OpenSSL: 128-bit encryption/decryption iv. More...
 
const EVP_CIPHER * cipher = nullptr
 OpenSSL: cipher to use for encryption/decryption. More...
 
EVP_CIPHER_CTX * decrypt_ctx = nullptr
 OpenSSL: ctx needed for decryption. More...
 
EVP_CIPHER_CTX * encrypt_ctx = nullptr
 OpenSSL: ctx needed for encryption. More...
 
size_t size_of_keys_in_bytes = 0
 OpenSSL: size of the cipher key. More...
 
size_t size_of_iv_in_bytes = 0
 OpenSSL: size of the cipher initialization vector. More...
 
std::string name = "<invalid>"
 OpenSSL: text name of the cipher in use. More...
 
std::string hash = "<invalid>"
 nonsense text string to help validate encryption key and iv More...
 

Detailed Description

Cipher takes care of calling OpenSSL to encrypt and decrypt NetBuffer objects.

Function Documentation

◆ decrypt()

EPS::NetBuffer * EPS::Cipher::decrypt ( EPS::NetBuffer buffer)

Decrypt a network buffer. Return a pointer to the newly-decrypted buffer. The original buffer remains untouched.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrypt_header()

EPS::NetBuffer * EPS::Cipher::decrypt_header ( EPS::NetBuffer buffer)

Decrypt only the first few bytes ("header") of a network buffer. Return a pointer to the newly-decrypted buffer. The original buffer remains untouched.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encrypt()

EPS::NetBuffer * EPS::Cipher::encrypt ( EPS::NetBuffer buffer)

Encrypt a network buffer. Return a pointer to the newly-encrypted buffer. The original buffer remains untouched.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_cipher_key_and_iv()

void EPS::Cipher::get_cipher_key_and_iv ( EPS::StrMap configuration)

Get and parse the key and iv from configuration.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void EPS::Cipher::initialize ( EPS::StrMap configuration)

Initialize OpenSSL ciphers.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void EPS::Cipher::reset ( void  )

Reset OpenSSL.

Here is the caller graph for this function:

Variable Documentation

◆ cipher

const EVP_CIPHER * EPS::Cipher::cipher = nullptr

OpenSSL: cipher to use for encryption/decryption.

◆ decrypt_ctx

EVP_CIPHER_CTX * EPS::Cipher::decrypt_ctx = nullptr

OpenSSL: ctx needed for decryption.

◆ encrypt_ctx

EVP_CIPHER_CTX * EPS::Cipher::encrypt_ctx = nullptr

OpenSSL: ctx needed for encryption.

◆ hash

std::string EPS::Cipher::hash = "<invalid>"

nonsense text string to help validate encryption key and iv

◆ iv

std::array< uint8_t, 16 > EPS::Cipher::iv

OpenSSL: 128-bit encryption/decryption iv.

◆ key

std::array< uint8_t, 32 > EPS::Cipher::key

OpenSSL: 256-bit encryption/decryption key.

◆ name

std::string EPS::Cipher::name = "<invalid>"

OpenSSL: text name of the cipher in use.

◆ size_of_iv_in_bytes

size_t EPS::Cipher::size_of_iv_in_bytes = 0

OpenSSL: size of the cipher initialization vector.

◆ size_of_keys_in_bytes

size_t EPS::Cipher::size_of_keys_in_bytes = 0

OpenSSL: size of the cipher key.