Photon Fusion 2.1.1

IDataEncryption Interface Reference

Interface for classes that manage the encryption/decryption of byte arrays. More...

Inherited by DataEncryptor.

Public Member Functions

bool ComputeHash (byte *buffer, ref int bufferLength, int capacity)
 Compute the Buffer hash and append it to the buffer itself.
bool DecryptData (byte *buffer, ref int bufferLength, int capacity)
 Decrypt data in place and update it's length.
bool EncryptData (byte *buffer, ref int bufferLength, int capacity)
 Encrypt data in place and update it's length.
byte[] GenerateKey ()
 Generate the key used used by the encryption implementation.
void Setup (byte[] key)
 Setup the encryption implementation with the right key.
bool ValidateKey (byte[] key)
 Check if the given key is valid.
bool VerifyHash (byte *buffer, ref int bufferLength, int capacity)
 Verify the buffer hash that was appended to the buffer.

Detailed Description

Interface for classes that manage the encryption/decryption of byte arrays.

Member Function Documentation

◆ ComputeHash()

bool ComputeHash ( byte * buffer,
ref int bufferLength,
int capacity )

Compute the Buffer hash and append it to the buffer itself.

Parameters
bufferData to compute the hash
bufferLengthLength of the data to hash
capacityBuffer total capacity
Returns
True if the hash was properly computed, false otherwise

Implemented in DataEncryptor.

◆ DecryptData()

bool DecryptData ( byte * buffer,
ref int bufferLength,
int capacity )

Decrypt data in place and update it's length.

Parameters
bufferData to decrypt
bufferLengthLength of the data to decrypt
capacityBuffer total capacity
Returns
True if the decryption was completed, false otherwise

Implemented in DataEncryptor.

◆ EncryptData()

bool EncryptData ( byte * buffer,
ref int bufferLength,
int capacity )

Encrypt data in place and update it's length.

Parameters
bufferData to encrypt
bufferLengthLength of the data to encrypt
capacityBuffer total capacity
Returns
True if the encryption was completed, false otherwise

Implemented in DataEncryptor.

◆ GenerateKey()

byte[] GenerateKey ( )

Generate the key used used by the encryption implementation.

Returns
Key used to setup the encryption implementation

Implemented in DataEncryptor.

◆ ValidateKey()

bool ValidateKey ( byte[] key)

Check if the given key is valid.

Returns
True if fulfills all requirements for a valida key

Implemented in DataEncryptor.

◆ VerifyHash()

bool VerifyHash ( byte * buffer,
ref int bufferLength,
int capacity )

Verify the buffer hash that was appended to the buffer.

Parameters
bufferBuffer to check the hash
bufferLengthLength of the data to hash
capacityBuffer total capacity
Returns
True if the hash was properly verified, false otherwise

Implemented in DataEncryptor.