Does anyone know how to use Password Based Encryption with TripleDES?
Thanks,
Alex.
see
http://forum.java.sun.com/thread.jsp?forum=9&thread=455076&tstart=0&trange=15
With the following code:
pbeParamSpec = new PBEParameterSpec(salt, count);
keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
pbeKey = keyFac.generateSecret(new PBEKeySpec(passwd));
pbeCipherEncrypt = Cipher.getInstance("PBEWithMD5AndTripleDES");
pbeCipherEncrypt.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);
I get the following exception thrown:
java.lang.SecurityException: Unsupported keysize or algorithm parameters
at javax.crypto.Cipher.init(DashoA6275)
at abcbackup.datacoder.DataCryptor.<init>(DataCryptor.java:41)
at abcbackup.ABCBackup.main(ABCBackup.java:51)
Karl Scheibelhofer - 20 Nov 2003 12:09 GMT
i assume you are using Java 1.4. did you install the unlimited strength
policy files in your JRE? you can download them from the same page as the
JDK and JRE.
Karl
> Does anyone know how to use Password Based Encryption with TripleDES?
>
> Thanks,
> Alex.
>
> see
http://forum.java.sun.com/thread.jsp?forum=9&thread=455076&tstart=0&trange=15
> With the following code:
>
[quoted text clipped - 10 lines]
> at abcbackup.datacoder.DataCryptor.<init>(DataCryptor.java:41)
> at abcbackup.ABCBackup.main(ABCBackup.java:51)
Hans Granqvist - 03 Dec 2003 18:24 GMT
> Does anyone know how to use Password Based Encryption with TripleDES?
>
[quoted text clipped - 18 lines]
> at abcbackup.datacoder.DataCryptor.<init>(DataCryptor.java:41)
> at abcbackup.ABCBackup.main(ABCBackup.java:51)
You need to use the same algorithm for the key and the cipher.
'pbeKey' is not a Triple DES key above.
See if that helps.
-Hans