Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / December 2003

Tip: Looking for answers? Try searching our database.

Password Based Encryption with TripleDES

Thread view: 
Alex - 11 Nov 2003 22:00 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.