Encrypt_Base Class Reference

Base encryptor wrapper class. More...

#include <crypto.h>

Inheritance diagram for Encrypt_Base:

RefCount IRefCount AESEncrypt List of all members.

Public Member Functions

 Encrypt_Base ()
virtual ~Encrypt_Base ()
bool SetKey (DataChunk &Key)
 Set an encryption key.
bool SetKey (DataChunkPtr &Key)
 Set an encryption key.
virtual bool SetKey (size_t KeySize, const UInt8 *Key)=0
 Set an encryption key.
virtual bool SetIV (size_t IVSize, const UInt8 *IV, bool Force=false)=0
 Set an encryption Initialization Vector.
bool SetIV (DataChunk &IV, bool Force=false)
 Set an encryption Initialization Vector.
bool SetIV (DataChunkPtr &IV, bool Force=false)
 Set an encryption Initialization Vector.
virtual DataChunkPtr GetIV (void)=0
 Get the Initialization Vector that will be used for the next encryption.
virtual bool CanEncryptInPlace (size_t BlockSize=0)=0
 Can this encryption system safely encrypt in place?
virtual bool EncryptInPlace (size_t Size, UInt8 *Data)=0
 Encrypt data bytes in place.
bool EncryptInPlace (DataChunk &Data)
 Encrypt data bytes in place.
bool EncryptInPlace (DataChunkPtr &Data)
 Encrypt data bytes in place.
virtual DataChunkPtr Encrypt (size_t Size, const UInt8 *Data)=0
 Encrypt data and return in a new buffer.
DataChunkPtr Encrypt (DataChunk &Data)
 Encrypt data and return in a new buffer.
DataChunkPtr Encrypt (DataChunkPtr &Data)
 Encrypt data and return in a new buffer.

Detailed Description

Base encryptor wrapper class.

Note:
Classes derived from this class must not include their own RefCount<> derivation


Constructor & Destructor Documentation

Encrypt_Base (  )  [inline]

virtual ~Encrypt_Base (  )  [inline, virtual]


Member Function Documentation

bool SetKey ( DataChunk Key  )  [inline]

Set an encryption key.

Returns:
True if key is accepted

bool SetKey ( DataChunkPtr Key  )  [inline]

Set an encryption key.

Returns:
True if key is accepted

virtual bool SetKey ( size_t  KeySize,
const UInt8 Key 
) [pure virtual]

Set an encryption key.

Returns:
True if key is accepted

Implemented in AESEncrypt.

virtual bool SetIV ( size_t  IVSize,
const UInt8 IV,
bool  Force = false 
) [pure virtual]

Set an encryption Initialization Vector.

Returns:
False if Initialization Vector is rejected
Note:
Some crypto schemes, such as cypher block chaining, only require the initialization vector to be set at the start - in these cases Force will be set to true when the vector needs to be initialized, and false for any other calls. This allows different schemes to be used with minimal changes in the calling code.

Implemented in AESEncrypt.

bool SetIV ( DataChunk IV,
bool  Force = false 
) [inline]

Set an encryption Initialization Vector.

Returns:
False if Initialization Vector is rejected
Note:
Some crypto schemes, such as cypher block chaining, only require the initialization vector to be set at the start - in these cases Force will be set to true when the vector needs to be initialized, and false for any other calls. This allows different schemes to be used with minimal changes in the calling code.

bool SetIV ( DataChunkPtr IV,
bool  Force = false 
) [inline]

Set an encryption Initialization Vector.

Returns:
False if Initialization Vector is rejected
Note:
Some crypto schemes, such as cypher block chaining, only require the initialization vector to be set at the start - in these cases Force will be set to true when the vector needs to be initialized, and false for any other calls. This allows different schemes to be used with minimal changes in the calling code.

virtual DataChunkPtr GetIV ( void   )  [pure virtual]

Get the Initialization Vector that will be used for the next encryption.

If called immediately after SetIV() with Force=true or SetIV() for a crypto scheme that accepts each offered vector (rather than creating its own ones) the result will be the vector offered in that SetIV() call.

Implemented in AESEncrypt.

virtual bool CanEncryptInPlace ( size_t  BlockSize = 0  )  [pure virtual]

Can this encryption system safely encrypt in place?

If BlockSize is 0 this function will return true if encryption of all block sizes can be "in place". Otherwise the result will indicate whether the given blocksize can be encrypted "in place".

Implemented in AESEncrypt.

virtual bool EncryptInPlace ( size_t  Size,
UInt8 Data 
) [pure virtual]

Encrypt data bytes in place.

Returns:
true if the encryption is successful

Implemented in AESEncrypt.

bool EncryptInPlace ( DataChunk Data  )  [inline]

Encrypt data bytes in place.

Returns:
true if the encryption is successful

bool EncryptInPlace ( DataChunkPtr Data  )  [inline]

Encrypt data bytes in place.

Returns:
true if the encryption is successful

virtual DataChunkPtr Encrypt ( size_t  Size,
const UInt8 Data 
) [pure virtual]

Encrypt data and return in a new buffer.

Returns:
NULL pointer if the encryption is unsuccessful

Implemented in AESEncrypt.

DataChunkPtr Encrypt ( DataChunk Data  )  [inline]

Encrypt data and return in a new buffer.

Returns:
NULL pointer if the encryption is unsuccessful

DataChunkPtr Encrypt ( DataChunkPtr Data  )  [inline]

Encrypt data and return in a new buffer.

Returns:
NULL pointer if the encryption is unsuccessful


The documentation for this class was generated from the following file:
Generated on Mon Apr 2 15:20:57 2007 for MXFLib by  doxygen 1.5.1-p1