Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java <--> openssl interop

843811May 18 2007 — edited May 18 2007
Hello.

I have a problem when trying to decrypt data in java, which was encrypted using openssl.
I keep getting a BadPaddingException("Given final block not properly padded").

After trying to come up with a simple test case, i found the following strange fact;
when encrypting a string in openssl using blowfish in ECB mode (I know, not secure, but bare with me) using a simple key, the encrypted text is different than when I use the same key in java and a "Blowfish/CBC/PKCS5Padding" cipher.

I have no clue as to what the problem might be, and an ready to give up.....

Can someone please please help?? I can post relevant code if necessary.

Cheers ;)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2007
Added on May 18 2007
11 comments
680 views