QuickCrypt Library C++ Interface

CBlowfish::ProcessBlock

void ProcessBlock( unsigned char* pDestBlock, const unsigned char* pSrcBlock );

void ProcessBlock( unsigned char* pBlock );
 

Parameters

pDestBlock

    [out] Pointer to the memory block that will receive the result of encryption/decryption. 

 pSrcBlock

    [in] Pointer to the memory block that has to be encrypted/decrypted.

 pBlock

    [in/out] Pointer to the memory block that has to be in-place encrypted/decrypted.

Remarks

Example

//Define the key for Blowfish encryption algorithm
char key[CBlowfish::DEFAULTKEYSIZE] = 
{
    'v','e','r','y','l','o','n','g',
    'p','a','s','s','w','o','r','d',
    '0','1','2','3','4','5','6','7',
    '9','8','7','7','7','2','2','1',
    '0','0','0','1','1','2','2','2',
    '2','3','5','6','5','6','3','3',
    '2','2','1','1','1','7','7','7'
};
//Define the block for Blowfish encryption algorithm
unsigned char block[CBlowfish::BLOCKSIZE] = 
{
    0x8C, 0x5B, 0x3C, 0x42, 0xDE, 0xB1, 0x11, 0xA0
};

//Declare a CBlowfish object
CBlowfish cipher( SLC_ENCRYPT, (const unsigned char*)key );

//Encrypt the block
cipher.ProcessBlock( block ); //in-place encryption

//Change chipher direction to perform decryption
cipher.Init( SLC_DECRYPT, (const unsigned char*)key );

//Decrypt the block
cipher.ProcessBlock( block ); //in-place decryption

 

 

CBlowfish Overview   |   Class Members   |   Useful Links

 

See Also    CBlowfish::Init


 

 

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