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

[iaik-jce] DES problem

Hi all

 I used DES_CBC encryption with SSLeay and am trying to decrypt the same
using javax.crypto.Cipher, but am unable to get the correct plain text. I
assume it is because of the setting of the initialization vector and the
secret key. In SSLeay, there is EVP_BytesToKey() that initializes both the
key and the initialization vector from a given password. I don't see any
such equivalent in IAIK.

But I used the same password to construct, my initialization vector and
the key as follows

     Key key = new iaik.security.cipher.SecretKey(password.getBytes(),
     IvParameterSpec param = new IvParameterSpec(password.getBytes());

It gives me a different output. Also I use doUpdate instead of doFinal for
decryption which takes care of the problem when the input cipher text is
not a multiple of the DES block length.

Any suggestions on why it is not working?



Srilekha Mudumbai			WORK# (510) 486 6297
Staff Scientist				FAX#  (510) 486 6363
Lawrence Berkeley National Laboratory   Email: SSMudumbai@lbl.gov
Berkeley, CA 94704

Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce