On Sat, Jan 30, 2010 at 07:26:21PM -0800, Thotheolh wrote:
Cipher text:
5effffffc15fffffffc46b26ffffffcd56ffffffdfffffffd0113556ffffffcd2ffffff9bffffffd1ffffffa4670fffffff1fffffff640ffffffc7761ffffffb5ffffffb2ffffffb36ffffffcb
           String hexcode = Integer.toHexString(byteArray[i]);

Change this to:

            String hexcode = Integer.toHexString(byteArray[i] & 0xff);

You might also have to cast the byte-array reference to an int, it's
been a while since I done something like this.

otherwise the bytes that have the high bit set get sign-extended, and
that's where all of your extra 'ff's are coming from.  Your ciphertext
is likely so much longer because it has more bytes with the high-bit
set.

The joy of Java not having unsigned integers.

David

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-datab...@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to