简体   繁体   中英

java.security.NoSuchAlgorithmException: Algorithm PBKDF2WithHmacSHA1 not available

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 try to install the Bouncy Castle cryptography provider .

It can be found starting from here . Look for PBKDF2WithHmacSHA1 on the front page and you will see that it is supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM