openssl 0.9.7g encrypt/decrypt not able to interoperate with Java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

openssl 0.9.7g encrypt/decrypt not able to interoperate with Java

Belliappa, Ashith Muddiana (STSD)
Hi All,

I am facing a problem while performing encryption and decryption using
0.9.7g. Here I am encrypting data using openssl 0.9.7g and decrypting
using Java, and vice versa. Basically, I find the interoperability with
Java to be broken (see detail of exception below).

The same was working fine with OpenSSL 0.9.6m. Recently I have changed
my Openssl version from 0.9.6m to 0.9.7g. Note that, encrypting with
OpenSSL and decrypting with OpenSSL works fine in both versions.

I am using Blowfish algorithm in CBC Mode with 128bit key (C code) and
decrypting with JRE 1.4.202 (Java code). I get the following error
message:

Caused by: javax.crypto.IllegalBlockSizeException: Input length (with
padding) not multiple of 8 bytes
        at com.sun.crypto.provider.SunJCE_h.a(DashoA6275)
        at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
        at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
        at
com.sun.crypto.provider.BlowfishCipher.engineDoFinal(DashoA6275)
        at javax.crypto.Cipher.doFinal(DashoA6275)
        ... 2 more

Could anyone help?

TIA. Rgds,
Ashith





______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]