/***** Define the key for Rijndael (AES) encryption algorithm *****/
char key[SLC_RIJNDAEL_DEFAULTKEYSIZE] =
{
'v','e','r','y','l','o','n','g',
'p','a','s','s','w','o','r','d'
};
/***** Define the block for Rijndael (AES) encryption algorithm ***/
unsigned char block[SLC_RIJNDAEL_BLOCKSIZE] =
{
0x8C, 0x5B, 0x3C, 0x42, 0xDE, 0xB1, 0x11, 0xA0,
0x42, 0xE7, 0x29, 0xC0, 0x41, 0x9D, 0x09, 0xE1,
};
/***** Initialize context ******************************/
unsigned char context[SLC_RIJNDAEL_CONTEXTSIZE];
SL_RIJNDAEL_Init( context, SLC_ENCRYPT, key, SLC_RIJNDAEL_DEFAULTKEYSIZE );
/***** Encrypt the block *******************************/
SL_RIJNDAEL_ProcessBlock( context, block, block ); /* in-place encryption */
/***** Change context direction to perform decryption **/
SL_RIJNDAEL_Init( context, SLC_DECRYPT, key, SLC_RIJNDAEL_DEFAULTKEYSIZE );
/***** Decrypt the block *******************************/
SL_RIJNDAEL_ProcessBlock( context, block, block ); /* in-place decryption */
|