QuickCrypt Library C++ Interface

CCFBMode::CCFBMode

CCFBMode( SL_CIPHER_DIR dir, const unsigned char* pIV, const unsigned char* pKey, unsigned int nKeyLen = DEFAULTKEYSIZE, 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

Constructs a CCFBMode object and initializes it with the initialization vector pointed by pIV, and the secret key pointed by pKey.

Notes. 

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
};

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

//Declare a dynamic CCFBMode object that will use the DES encryption algorithm
CCFBMode<CDES>* pCipher = new CCFBMode<CDES>( SLC_DECRYPT, iv, (const unsigned char*)key );

 

 

CCFBMode Overview   |   Class Members   |   Useful Links

 

See Also    CCFBMode::Process


 

 

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