0

Getting: Caused by: java.lang.Throwable: java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available

This worked with 1.8.0_111 -- what is the best workaround for backward compatibility (e.g., to read data obfuscated with PBEWithMD5AndDES?j

wnm3
  • 381
  • 3
  • 17
  • Did you change any of the JCE providers in `lib/security/java.security` in the JRE path? – Andy Jan 24 '17 at 21:17

2 Answers2

0

If you are trying to use Eclipse then it could be an issue as Eclipse set the bootclasspath to include the java.ext.dirs, which is normally supposed to be loaded with by extension class loader, not the bootclass. The classes loaded by the bootclassloader are handled differently from a security perspective than those loaded by other class loaders. Please check the similar issue here JDK-6446284

Fairoz
  • 1,616
  • 13
  • 16
  • I don't believe this is the issue. I simply changed the JVM directory back to version 111 and all problems went away, so unless external directory names have changed, I believe something is missing from the 121 release. This broke some calls in to Watson services as well. In my case it affected password obfuscation I'd used for properties files... Luckily (but surprisingly) Oracle's install didn't remove the old version of Java... – wnm3 Jan 25 '17 at 20:01
  • Is there any way to contact you @wnm3, possibly you can send mail to me fairoz.matte@oracle.com – Fairoz Jan 27 '17 at 06:14
  • Possibly you can try to run this code and let us know what is the output you are getting import java.security.NoSuchAlgorithmException; import javax.crypto.SecretKeyFactory; public class Test { public static void main(String[] args) throws NoSuchAlgorithmException { SecretKeyFactory.getInstance("PBEWithMD5AndDES"); } } – Fairoz Jan 27 '17 at 06:19
  • Could you run your program with option "-Djava.security.debug=provider" and provide the logs to us – Fairoz Jan 27 '17 at 12:49
0

I apologize -- I believe I had screwed up the various references to the newly installed JDK that resulted in a mixture of references to both the 121 release and the 111 release that likely caused the error.

After reviewing the JAVA_HOME declaration, the eclipse.ini vm entry, the Java / Installed VM settings, and the eclipse launcher JRE setting and ensuring they all pointed to the same JDK installation location, the problem has gone away.

Thank you all for trying to help. I'll try to remove any old remnant JDK installations to ensure only one is active.

wnm3
  • 381
  • 3
  • 17