Contents 

QuickCrypt Library
QuickCrypt Library Overview
QuickCrypt Library Installation
Register QuickCrypt Library
DES
CDES ( C++ Interface )
CDES Class Members
DES API ( QuickCrypt API )
DES API Functions
DES-EDE2
CDES_EDE2 ( C++ Interface )
CDES_EDE2 Class Members
DES-EDE2 API ( QuickCrypt API )
DES-EDE2 API Functions
DES-EDE3
CDES_EDE3 ( C++ Interface )
CDES_EDE3 Class Members
DES-EDE3 API ( QuickCrypt API )
DES-EDE3 API Functions
DESX
CDESX ( C++ Interface )
CDESX Class Members
DESX API ( QuickCrypt API )
DESX API Functions
Rijndael (AES)
CRijndael ( C++ Interface )
CRijndael Class Members
Rijndael (AES) API ( QuickCrypt API )
Rijndael (AES) API Functions
Blowfish
CBlowfish ( C++ Interface )
CBlowfish Class Members
Blowfish API ( QuickCrypt API )
Blowfish API Functions
GOST
CGOST ( C++ Interface )
CGOST Class Members
GOST API ( QuickCrypt API )
GOST API Functions
ECB Mode
C++ Interface
QuickCrypt API
CBC Mode
CCBCMode ( C++ Interface )
CCBCMode Class Members
CBC Mode API ( QuickCrypt API )
CBC Mode API Functions
CFB Mode
CCFBMode ( C++ Interface )
CCFBMode Class Members
CFB Mode API ( QuickCrypt API )
CFB Mode API Functions
OFB Mode
COFBMode ( C++ Interface )
COFBMode Class Members
OFB Mode API ( QuickCrypt API )
OFB Mode API Functions
CTR Mode
CCounterMode ( C++ Interface )
CCounterMode Class Members
CTR Mode API ( QuickCrypt API )
CTR Mode API Functions
QuickCrypt Library Run-Time Dynamic Linking
License Agreement
Samples

SlavaSoft QuickCrypt Library Online Help

Prev Page Next Page
QuickCrypt Library C++ Interface

CCFBMode::Init

void Init( SL_CIPHER_DIR dir, const unsigned char* pIV, const unsigned char* pKey, unsigned int nKeyLen = DEFAULTKEYSIZE, unsigned int fs = 0 );

void Init( SL_CIPHER_DIR dir, const unsigned char* pIV, unsigned int fs = 0 );

Parameters

dir

    [in] Cipher direction. It can be SLC_ENCRYPT or SLC_DECRYPT.

 pIV

    [in] Pointer to the initialization vector.

 pKey

    [in] Pointer to the secret key.

 nKeyLen

    [in] Length in bytes of the secret key.

 fs

    [in] Feedback size in bytes. By default fs is 0 which means to use the maximum feedback size. This size is the mostly used feedback size.

Remarks

Both member functions initialize the CCFBMode object. A brief description of both of them follows.

  • void Init( SL_CIPHER_DIR dir, const unsigned char* pIV, const unsigned char* pKey, unsigned int nKeyLen = DEFAULTKEYSIZE, unsigned int fs = 0 );

Call this member function to initialize the CCFBMode object with the initialization vector pointed by pIV, and the secret key pointed by pKey.

Notes. 

  • The first CCFBMode<T>::BLOCKSIZE bytes of the memory buffer pointed by pIV are used as the initialization vector.

  • nKeyLen can be CCFBMode<T>::DEFAULTKEYSIZE bytes. For Rijndael (AES) algorithm it can also be 24 or 32 bytes. For Blowfish algorithm it can be in the range 1 through 72 bytes.

  • void Init( SL_CIPHER_DIR dir, const unsigned char* pIV, unsigned int fs = 0 );

Call this member function to initialize the CCFBMode object with the initialization vector pointed by pIV without changing the key set by previous initialization. Note that the first CCFBMode<T>::BLOCKSIZE bytes of the memory buffer pointed by pIV are used as the initialization vector.

 

The CCFBMode object is initialized for encryption if dir is SLC_ENCRYPT, or it is initialized for decryption if dir is SLC_DECRYPT.

Example

 

//Define the key
char key[CDES::DEFAULTKEYSIZE] = 
{
    'p', 'a', 's', 's', 'w', 'o', 'r', 'd'
};

//Define the initialization vector
unsigned char iv[CDES::BLOCKSIZE] = 
{
    0x41, 0x3E, 0xF0, 0xA1, 0xC6, 0x11, 0xE5, 0x50
};

//Instantiate a CCFBMode object that will use DES encryption algorithm  
CCFBMode<CDES> cipher( SLC_ENCRYPT, iv, (const unsigned char*)key );
//...

//Change cipher direction
cipher.Init( SLC_DECRYPT, iv );

 

CCFBMode Overview   |   Class Members   |   Useful Links

 

See Also    CCFBMode::Process


 

 

Send Feedback to SlavaSoft Inc. Tell a friend about QuickCrypt Library