On Sat, Mar 11, 2006, uno wand wrote: > Thanks for replying. I have been verifying, and re-verifying that my key > and IV > are in fact the same in both C and Java. The hex printout of the key and IV > are exactly the same. > > Original Text: "This is a test" > > The hex print of Java cipher text is : > > 740A5DBD288340D7AC8F9F20587B7F4D > > And trying the command you gave, here is the result: > > [EMAIL PROTECTED]:~$ echo -n "This is a test" |openssl enc -aes-128-cbc -K > 9d320b14da2485e6dfa1a8eb5f2bd326 -iv 0102030405060708 |od -t x2 > 0000000 1e8b b7de 5736 ea6f bf54 1e6f d4d4 4a53 > 0000020 > > The value for -K is the hex printout of the key I used, both in Java and C. > the value of -iv is also the hex printout. > > The result looks quite different, isn't it? Am I missing something? >
The block size of AES is 128 bits, you therefore need 16 characters or 32 hex digits in the IV. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]