aspose file tools*
The moose likes Java in General and the fly likes NoSuchAlgorithmException after java 6 migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "NoSuchAlgorithmException after java 6 migration" Watch "NoSuchAlgorithmException after java 6 migration" New topic
Author

NoSuchAlgorithmException after java 6 migration

sabarishreddy ozili
Greenhorn

Joined: Dec 29, 2010
Posts: 3
i am also using java 1.4 for password encryption we are using PBEWithMD5AndTripleDES algorithm provided in security package provided by java. but after migrating to java 1.6 it is displaying an error NoSuchAlgorithmException.

some of the database fields are encrypeted with the algorithm.
Please provide a solution.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11497
    
  16

sabarishreddy,

Welcome to the javaranch. We ask that everyone try and keep threads to a single issue, and that you don't hijack another person's thread (even if it has been dormant for 6+ months).

I have split your post off into a new thread, and move it to what I think is a more appropriate forum.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
sabarishreddy ozili
Greenhorn

Joined: Dec 29, 2010
Posts: 3
Sorry for that.
And i am Eagerly waiting for solution.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
You updated software without testing it first?

It seems unlikely that an algorithm would have been removed. Maybe it was added to the Java 1.4 installation through a 3rd party security provider?

If it indeed got removed then the obvious solution is to install Java 1.4, decrypt all values, and then re-encrypt them with an algorithm that is supported by Java 6. Make sure that from now on to the end of your career you always thoroughly test software. If data is important enough to be encrypted, then an untested update is an unacceptable risk.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

Odd. That algorithm works on my machine, which has Java 1.6.0_23 installed.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

That algorithm used to have to be applied by a separate JAR (SunJCE I think), but has since been rolled into the standard release. Could it be you have the old provider JAR hanging around and perhaps interfering with the the Java 6 implementation?


Steve
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Did you install the 'unlimited strength' files? DESede needs them.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
sabarishreddy ozili
Greenhorn

Joined: Dec 29, 2010
Posts: 3
I will explain my problem clearly.

first we had eclipse 3.0 , j2sdk1.4.2_10 , tomcat 5.0.
Now we want to uses TPTP . so we downloaded
Eclipse Platform
Version: 3.5.2
Build id: M20100211-1343

and jdk-1_5_0_19-windows-i586-p.exe , jdk-6u14-windows-i586.exe

now i started the eclipse Build id: TPTP-4.6.2-201002162125

started import your web project.

and then running it from tomcat inside eclipse itself.

then i got the following error.

java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.init(DashoA13*..)
at javax.crypto.Cipher.init(DashoA13*..)
at com.arch.util.SBPassword.decrypt(Password.java:103)
at Pcheck.doSelectTest(Pcheck.java:75)
at Pcheck.<init>(Pcheck.java:39)
at Pcheck.main(Pcheck.java:25)
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

sabarishreddy ozili wrote:I will explain my problem clearly.

first we had eclipse 3.0 , j2sdk1.4.2_10 , tomcat 5.0.
Now we want to uses TPTP . so we downloaded
Eclipse Platform
Version: 3.5.2
Build id: M20100211-1343

and jdk-1_5_0_19-windows-i586-p.exe , jdk-6u14-windows-i586.exe

now i started the eclipse Build id: TPTP-4.6.2-201002162125

started import your web project.

and then running it from tomcat inside eclipse itself.

then i got the following error.

java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.a(DashoA13*..)
at javax.crypto.Cipher.init(DashoA13*..)
at javax.crypto.Cipher.init(DashoA13*..)
at com.arch.util.SBPassword.decrypt(Password.java:103)
at Pcheck.doSelectTest(Pcheck.java:75)
at Pcheck.<init>(Pcheck.java:39)
at Pcheck.main(Pcheck.java:25)


On last time - did you install the 'unlimited strength' files? This exception occurs with TripleDES/DESede if you haven't.

P.S. From the exception stack trace it seems that you are encrypting passwords! Though there are times when this is necessary, this is generally considered insecure. Passwords should be digested (MD5, SHA1, SHA2 etc) together with a random seed to inhibit simple rainbow attacks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoSuchAlgorithmException after java 6 migration