Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.security.NoSuchAlgorithmException: Algorithm PBKDF2WithHmacSHA1 not available

 
Phanikumar Balla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii,
I have code in java 1.4 version there we got a new requirement like have decrypt a password from another webservice response, for that have to use AES 256 decryption, getting following exception:

SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");

java.security.NoSuchAlgorithmException: Algorithm PBKDF2WithHmacSHA1 not available
at javax.crypto.SunJCE_b.a(DashoA12275)
at javax.crypto.SecretKeyFactory.getInstance(DashoA12275)
at ftpserver.AESEncrypter.main(AESEncrypter.java:107)

I tried by copying jce_policy_1-4 version jars into java home security folder still am getting the above exception.
Is there any solution in Java 1.4 without changing to 1.5 because running jboss server version 3.2.3 will not support java 1.5.

Please help me
 
Phanikumar Balla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Decryption is working after adding http://www.bouncycastle.org/download/bcprov-jdk14-149.jar and http://www.bouncycastle.org/download/bcpkix-jdk14-149.jar dependency and
import org.bouncycastle.jce.provider.BouncyCastleProvider;
...
Security.addProvider(new BouncyCastleProvider());


http://www.bouncycastle.org/wiki/display/JA1/Provider+Installation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic