//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
|