- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# DataBlockEncryptor Class Reference

Encrypts and decrypts data blocks. More...

`#include <DataBlockEncryptor.h>`

List of all members.

## 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)
## Protected Attributes
keyInstance | keyEncrypt
keyInstance | keyDecrypt
cipherInstance | cipherInst
bool | keySet

## Detailed Description

Encrypts and decrypts data blocks.

## Member Function Documentation

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 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

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

  | Encryption adds up to 15 bytes. 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

bool DataBlockEncryptor::IsKeySet | ( | void |  | ) | const

| Returns: true if SetKey has been called previously

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

  | Set the encryption key Parameters:
  `[in]` | key | The new encryption key

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

- C:/RakNet 2.518/Include/DataBlockEncryptor.h
- C:/RakNet 2.518/Source/DataBlockEncryptor.cpp