Public Member Functions | Protected Attributes

DataBlockEncryptor Class Reference

Encrypts and decrypts data blocks. More...

#include <DataBlockEncryptor.h>

Collaboration diagram for DataBlockEncryptor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DataBlockEncryptor ()
 ~DataBlockEncryptor ()
bool IsKeySet (void) const
void SetKey (const unsigned char key[16])
 Set the encryption key.
void UnsetKey (void)
 Unset the encryption key.
void Encrypt (unsigned char *input, unsigned int inputLength, unsigned char *output, unsigned int *outputLength, RakNetRandom *rnr)
 Encryption adds 6 data bytes and then pads the number of bytes to be a multiple of 16.
bool Decrypt (unsigned char *input, unsigned int inputLength, unsigned char *output, unsigned int *outputLength)
 Decryption removes bytes, as few as 6.

Protected Attributes

keyInstance keyEncrypt
keyInstance keyDecrypt
cipherInstance cipherInst
bool keySet

Detailed Description

Encrypts and decrypts data blocks.

Definition at line 18 of file DataBlockEncryptor.h.


Constructor & Destructor Documentation

DataBlockEncryptor::DataBlockEncryptor (  ) 

Definition at line 17 of file DataBlockEncryptor.cpp.

DataBlockEncryptor::~DataBlockEncryptor (  ) 

Definition at line 22 of file DataBlockEncryptor.cpp.


Member Function Documentation

bool DataBlockEncryptor::Decrypt ( unsigned char *  input,
unsigned int  inputLength,
unsigned char *  output,
unsigned 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

Parameters:
[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
Returns:
False on bad checksum or input, true on success

Definition at line 127 of file DataBlockEncryptor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DataBlockEncryptor::Encrypt ( unsigned char *  input,
unsigned int  inputLength,
unsigned char *  output,
unsigned int *  outputLength,
RakNetRandom rnr 
)

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

Parameters:
[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

Definition at line 44 of file DataBlockEncryptor.cpp.

Here is the call graph for this function:

bool DataBlockEncryptor::IsKeySet ( void   )  const
Returns:
true if SetKey has been called previously

Definition at line 25 of file DataBlockEncryptor.cpp.

Here is the caller graph for this function:

void DataBlockEncryptor::SetKey ( const unsigned char  key[16]  ) 

Set the encryption key.

Parameters:
[in] key The new encryption key

Definition at line 30 of file DataBlockEncryptor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DataBlockEncryptor::UnsetKey ( void   ) 

Unset the encryption key.

Definition at line 39 of file DataBlockEncryptor.cpp.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 62 of file DataBlockEncryptor.h.

Definition at line 61 of file DataBlockEncryptor.h.

Definition at line 60 of file DataBlockEncryptor.h.

bool DataBlockEncryptor::keySet [protected]

Definition at line 63 of file DataBlockEncryptor.h.


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