#include <DataBlockEncryptor.h>
Public Member Functions | |
DataBlockEncryptor () | |
Constructor. | |
~DataBlockEncryptor () | |
Destructor. | |
bool | IsKeySet (void) const |
| |
void | SetKey (const unsigned char key[16]) |
void | UnsetKey (void) |
Unset the encryption key. | |
void | Encrypt (unsigned char *input, int inputLength, unsigned char *output, int *outputLength) |
bool | Decrypt (unsigned char *input, int inputLength, unsigned char *output, int *outputLength) |
void DataBlockEncryptor::SetKey | ( | const unsigned char | key[16] | ) |
Set the encryption key
[in] | key | The new encryption key |
void DataBlockEncryptor::Encrypt | ( | unsigned char * | input, | |
int | inputLength, | |||
unsigned char * | output, | |||
int * | outputLength | |||
) |
Encryption adds 6 data bytes and then pads the number of bytes to be a multiple of 16. Output should be large enough to hold this. Output can be the same memory block as input
[in] | input | the input buffer to encrypt |
[in] | inputLength | the size of the input buffer |
[in] | output | the output buffer to store encrypted data |
[in] | outputLength | the size of the output buffer |
bool DataBlockEncryptor::Decrypt | ( | unsigned char * | input, | |
int | inputLength, | |||
unsigned char * | output, | |||
int * | outputLength | |||
) |
Decryption removes bytes, as few as 6. Output should be large enough to hold this. Output can be the same memory block as input
[in] | input | the input buffer to decrypt |
[in] | inputLength | the size of the input buffer |
[in] | output | the output buffer to store decrypted data |
[in] | outputLength | the size of the output buffer |