QuickCrypt Library C++ Interface

CDES_EDE2::CDES_EDE2

CDES_EDE2( SL_CIPHER_DIR dir, const unsigned char* pKey );

CDES_EDE2( SL_CIPHER_DIR dir, const unsigned char* pKey, unsigned int );

Parameters

dir

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

 pKey

    [in] Pointer to the secret key.

 

The third parameter of type unsigned int was added for consistency with other encryption algorithms and it is ignored.

Remarks

Both constructors work in the same way.

They construct a CDES_EDE2 object and initialize it with the secret key pointed by pKey. Note that the first CDES_EDE2::DEFAULTKEYSIZE bytes of the memory buffer pointed by pKey are used as the secret key.

The CDES_EDE2 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 for DES-EDE2 encryption algorithm
char key[CDES_EDE2::DEFAULTKEYSIZE] = 
{
    'v','e','r','y','l','o','n','g','p','a','s','s','w','o','r','d'
};

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

//Declare a dynamic CDES_EDE2 object
CDES_EDE2* pCipher = new CDES_EDE2( SLC_DECRYPT, (const unsigned char*)key );

 

 

CDES_EDE2 Overview   |   Class Members   |   Useful Links

 

See Also    CDES_EDE2::ProcessBlock


 

 

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