openikev2::Cipher Class Reference

This abstract class represets a cipher, with methods to encrypt, decrypt, and to compute integrity of byte array. More...

#include <cipher.h>

List of all members.

Public Member Functions

virtual auto_ptr< ByteArrayencrypt (ByteArray &plain_text, ByteArray &initialization_vector)=0
 Encrypts a plain text using the internal crypto algorithm and the internal key.
virtual auto_ptr< ByteArraydecrypt (ByteArray &cipher_text, ByteArray &initialization_vector)=0
 Decrypts a cipher text using the internal crypto algorithm and the internal key.
virtual auto_ptr< ByteArraycomputeIntegrity (ByteArray &data_buffer)=0
 Computes the integrity of a data buffer using the internal auth algorithm and the internal key.
virtual auto_ptr< ByteArrayhmac (ByteArray &data_buffer, ByteArray &hmac_key)=0
 Generates a HMAC value using the internal auth algorithm, a data buffer and a key.

Public Attributes

uint32_t encr_block_size
 Encryption block size.
uint32_t integ_hash_size
 Integrity hash size.


Detailed Description

This abstract class represets a cipher, with methods to encrypt, decrypt, and to compute integrity of byte array.

This class holds internally the keys, so it is no needed to pass them as argument.

Author:
Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj.fernandez@dif.um.es, alejandro_perez@dif.um.es>


Member Function Documentation

virtual auto_ptr<ByteArray> openikev2::Cipher::encrypt ( ByteArray plain_text,
ByteArray initialization_vector 
) [pure virtual]

Encrypts a plain text using the internal crypto algorithm and the internal key.

Parameters:
plain_text Plain text to be encrypted. Its size must be multiple of the block size.
initialization_vector Initialization vector. Its size must be equal to the block size
Returns:
The resulting cipher text. Its size is equal to the plain text one.

virtual auto_ptr<ByteArray> openikev2::Cipher::decrypt ( ByteArray cipher_text,
ByteArray initialization_vector 
) [pure virtual]

Decrypts a cipher text using the internal crypto algorithm and the internal key.

Parameters:
cipher_text Cipher text to be decrypted. Its size must be multiple of the block size.
initialization_vector Initialization vector. Its size must be equal to the block size
Returns:
The resulting plain text. Its size is equal to the cipher text one.

virtual auto_ptr<ByteArray> openikev2::Cipher::computeIntegrity ( ByteArray data_buffer  )  [pure virtual]

Computes the integrity of a data buffer using the internal auth algorithm and the internal key.

Parameters:
data_buffer Data buffer to compute its integrity
Returns:
Computed integrity data

virtual auto_ptr<ByteArray> openikev2::Cipher::hmac ( ByteArray data_buffer,
ByteArray hmac_key 
) [pure virtual]

Generates a HMAC value using the internal auth algorithm, a data buffer and a key.

Parameters:
data_buffer Data buffer to compute the HMAC value
hmac_key Key to compute the HMAC value
Returns:
Computed HMAC value


Generated on Fri Jul 27 11:04:50 2007 for libopenikev2 by  doxygen 1.5.1