[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [iaik-jce] DES problem
The problem is fixed. Actually in the ssleay library, when you supply a
password, a message digest is created for that and the first 8 bytes of
the MD goes to the key and rest go to the initialization vector for a
password length of 8 bytes.
thanks for sending your code. It must work if you use the same IAIK
library for both DES encryption and decryption and I was using SSLeay for
encryption and IAIK for decryption and that is where I ran into problems.
On Tue, 29 Jun 1999, Srilekha Mudumbai (ITG staff) wrote:
> 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 firstname.lastname@example.org with the folowing content: UNSUBSCRIBE iaik-jce
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html
To unsubscribe send an email to email@example.com with the folowing content: UNSUBSCRIBE iaik-jce