[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] PBE: NegativeArraySizeException when decrypt with wrong password

Hello all,
I am using PBE encryption (Algorithm: PbeWithSHAAnd3_KeyTripleDES_CBC) of
the IAIK JCE 2.51.
If I encrypt the plaintext message and then decrypt the cyphertext
with the correct password everthing works fine.
But in some cases if I try to decrypt with a wrong password I am getting
an Exception:
        at iaik.utils.CryptoUtils.resizeArray(Unknown Source)
        at iaik.security.cipher.v.engineDoFinal(Unknown Source)
        at javax.crypto.Cipher.doFinal(Unknown Source)
        at javax.crypto.CipherInputStream.a(Unknown Source)
        at javax.crypto.CipherInputStream.read(Unknown Source)
        at javax.crypto.CipherInputStream.read(Unknown Source)
        at dox.clientsecurity.Example.decrypt(Example.java, Compiled Code)
        at dox.clientsecurity.Example.main(Example.java:273)
As mentioned this occurs only for some wrong passwords.
Is this a known problem with some possible workaround? Any comments are
very much appreciated.
Thomas Steinbach
memIQ AG
Hans-Pinsel-Strasse 9a
D-85540 Haar