• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoSuchAlgorithmException after java 6 migration

 
sabarishreddy ozili
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12085
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sabarishreddy ozili
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for that.
And i am Eagerly waiting for solution.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd. That algorithm works on my machine, which has Java 1.6.0_23 installed.
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you install the 'unlimited strength' files? DESede needs them.
 
sabarishreddy ozili
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic