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

CGOST::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

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

    Call this member function to encrypt/decrypt the first CGOST::BLOCKSIZE bytes of the memory block pointed by pSrcBlock. The result is retrieved in the memory block pointed by pDestBlock.

    To perform an in-place encryption/decryption, make pDestBlock equal to pSrcBlock.

  • void ProcessBlock( unsigned char* pBlock );

    Call this member function to perform an in-place encryption/decryption of the first CGOST::BLOCKSIZE bytes of the memory block pointed by pBlock.

Example

//Define the key for GOST encryption algorithm
char key[CGOST::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'
};
//Define the block for GOST encryption algorithm
unsigned char block[CGOST::BLOCKSIZE] = 
{
    0x8C, 0x5B, 0x3C, 0x42, 0xDE, 0xB1, 0x11, 0xA0
};

//Declare a CGOST object
CGOST 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

 

 

CGOST Overview   |   Class Members   |   Useful Links

 

See Also    CGOST::Init


 

 

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