hi guys,

i'm a newbie in cryptogrphy programming.  i got this code example in a
previous posting in the mailing list, but i could not find it back
anywhere by using the search tool in the archieve.   I'm currently
playing around with some symmeteric encryption like blowfish in trying
to understand how they work.  But the thing is this is part of the
code that i'm being tried to study but could no fully understand:

#define KEY_LENGTH 16

byte key[KEY_LENGTH]= //32bytes
{0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xF};

byte iv[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

CryptoPP::BlowfishEncryption enc(key, KEY_LENGTH);
CryptoPP::CBC_CTS_Encryptor cbcEnc(enc, iv);

first question is, the KEY_LENGTH.  Can i just put any number from
1-32 to define the key lenght?

second is what is the 0x0,0x1,0x2,0x3,0x4,0x5 or sometimes 0x48, 0x93,
0x46, 0x67, 0x98, 0x3D, 0xE6, 0x8D all about? is it specific to lenght
of KEY_LENGTH defined earlier? how to create those number for the
KEY_LENGHT?

i did some timing function to the code that i'm running to see how
fast compared to other algoritm like DES, TWOFISH etc2.  But the
problem is when i changed the KEY_LENGHT from 32 to either 16, 8 or
anynumber, the time recorded is still the same. Either i used
KEY_LENGHT 32,16,8 for blowfish it just giving out the same timing
results. Isnt it supposed to be if the keylenght is extend, then the
encrypting time should be extended to?

hope you guys can give some enligtment..

thanks in advance..

japp.

Reply via email to