Fawkes API  Fawkes Development Version
protobuf_comm::BufferDecryptor Class Reference

#include <>>

Public Member Functions

 BufferDecryptor (const std::string &key)
 Constructor. More...
 
 ~BufferDecryptor ()
 Destructor. More...
 
size_t decrypt (int cipher, const void *enc, size_t enc_size, void *plain, size_t plain_size)
 Decrypt a buffer. More...
 

Detailed Description

Decrypt buffers encrypted with BufferEncryptor.

Author
Tim Niemueller

Definition at line 83 of file crypto.h.

Constructor & Destructor Documentation

◆ BufferDecryptor()

protobuf_comm::BufferDecryptor::BufferDecryptor ( const std::string &  key)

Constructor.

Parameters
keyencryption key, can be any string, will be processed to meet AES128 requirements.

Definition at line 176 of file crypto.cpp.

◆ ~BufferDecryptor()

protobuf_comm::BufferDecryptor::~BufferDecryptor ( )

Destructor.

Definition at line 181 of file crypto.cpp.

Member Function Documentation

◆ decrypt()

size_t protobuf_comm::BufferDecryptor::decrypt ( int  cipher,
const void *  enc,
size_t  enc_size,
void *  plain,
size_t  plain_size 
)

Decrypt a buffer.

Parameters
ciphercipher ID
encencrypted buffer
enc_sizenumber of bytes in enc
plainon return contains plain text data
plain_sizesize in bytes of plain
Returns
number of bytes that were in the encrypted buffer (this can be shorter if the data did not exactly fit the AES block size.

Definition at line 226 of file crypto.cpp.


The documentation for this class was generated from the following files: