Hi Marek Marcola, thanks for helping. i tried compiling the source code u gave me but it returns the same error, which is: [C++ Error] testDes.cpp(23): E2034 Cannot convert 'des_ks_struct ( *)[16]' to 'des_ks_struct *' [C++ Error] testDes.cpp(23): E2342 Type mismatch in parameter 'schedule' (wanted 'des_ks_struct *', got 'des_ks_struct ( *)[16]').
Anyway to be honest, i don't really know what's happening inside your source code (as well as mine). What do all these things ============ unsigned char key08[] = {0,1,2,3,4,5,6,7}; unsigned char key16[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char key24[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}; unsigned char key32[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; unsigned char iv[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char inbuf[1024]="abcdefg\x01"; unsigned char outbuf[1024]; ============= means? what does all the number represents? and at the inbuf variable, what does \x01 means? I'm really new to all this encryption things, and really hope you could help me understand all this. Or if you don't mind, could you lead me to anyway i can learn all this? thanks a lot On 3/28/07, Marek Marcola <[EMAIL PROTECTED]> wrote:
This source code use ECB mode to encrypt disk file which is not recommended. Use CBC or other suggested mode for this encryption. I do not know Borlad compiler but maybe two attached very simple examples may be helpful. After compiling des_enc.c you may decrypt his output for example with: $ ./des_enc > enc.bin $ openssl des-ede3-cbc -in enc.bin -K 000102030405060708090A0B0C0D0E0F1011121314151617 -iv 0001020304050607 -d Best regards, -- Marek Marcola <[EMAIL PROTECTED]>