|
QuickCrypt Library |
C++ Interface |
|
CCBCMode
template< class T > class
CCBCMode
Parameters
T
Template parameter specifying the
type of the encryption object. It can be one of the following:
CDES,
CDES_EDE2,
CDES_EDE3,
CDESX,
CRijndael or
CAES,
CBlowfish,
CGOST.
Remarks
CCBCMode class assists you in performing encryption/decryption in
CBC mode
of operation.
To encrypt/decrypt a continuous memory buffer,
perform the following:
-
Instantiate a
CCBCMode object passing to the constructor the initialization vector, the
secret key and the cipher direction (SLC_ENCRYPT or
SLC_DECRYPT).
-
Call the
Process
member
function to encrypt/decrypt the memory buffer.
Note.
The
Process member
function can be replaced with
ProcessBlock
and
ProcessLastBlock
member functions. Divide the memory buffer into blocks of
CCBCMode<T>::BLOCKSIZE bytes each and call
ProcessBlock
member function for each of them.
If the last block that has to be processed
is shorter than
CCBCMode<T>::BLOCKSIZE bytes call
ProcessLastBlock
member function instead of
ProcessBlock.
-
Call the
Init member function to
initialize the CCBCMode object with another initialization vector, secret key, and/or to change its cipher direction.
| #include <QuickCrypt.h>
using namespace QuickCrypt; |
Class Members
|
Useful Links
|