Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-13 Thread Bear Giles
Dominique Lohez wrote: This could be due to the fact that in JAVA character are coded in UNICODE ( Each character uses 2 bytes) While in C each character is coded with only one byte for each character. This could be checked from JAVA by squeezing the first byte of each character. I would hav

Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-13 Thread Dominique Lohez
uno wand wrote: From: "Dr. Stephen Henson" <[EMAIL PROTECTED]> The block size of AES is 128 bits, you therefore need 16 characters or 32 hex digits in the IV. Steve. -- Thanks for the reply, I figured that out earlier too, by re-reading the documentation I have on hand. I always had the

Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-11 Thread uno wand
From: "Dr. Stephen Henson" <[EMAIL PROTECTED]> The block size of AES is 128 bits, you therefore need 16 characters or 32 hex digits in the IV. Steve. -- Thanks for the reply, I figured that out earlier too, by re-reading the documentation I have on hand. I always had the impression that if

Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-11 Thread Dr. Stephen Henson
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 t

Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-10 Thread uno wand
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

Re: Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-10 Thread Girish Venkatachalam
You should take care that the key and IV are indeed same. What I mean by that is that in the C and Java code you should hardcode the actual hex values and it should have the exact length. For instance DES requires 8 byte key and you should hardcode something like this. unsigned char key[8] = {0x1

Encrypt in Java and decrypt in Openssl (and vice versa)

2006-03-10 Thread uno wand
Hi all, I've been pulling my hair for two days, trying to figure out why a msg encrypted in Java can not be decrypted with Openssl, and vice versa. It'd be very much appreciated if someone could give a hint. Here's the Java code (apologize for that) (no exception handling): byte[] key; // g