JCE - Java 7...?

1.8k views Asked by At

I've installed JDK 7. Which already contains the following JARs:

local_policy
US_export_policy

But when I start my application, I was facing JCE error. So I googled and downloaded JDK 7 JCE from here.

My doubt is, when JDK 7 already has JCE JARs, why should I specifically download the same JCE JARs and replace the existing JCE JARs again..??

Edit:

I am using SSHA encryption.

Log:

java.security.invalidkeyexception: illegal key size
java.lang.illegalstateexception: cipher not initialized
2

There are 2 answers

1
Uwe Plonus On BEST ANSWER

The downloaded files are not the same.

Basically the named .jar files only contain property files which enable/disable some cryptography functions. This is because of several different export/import regulations in different countries.

You could also modify this files by yourself and enable/disable some cryptography functions for your application.

0
Stephen C On

My doubt is, when JDK 7 already has JCE JARs, why should I specifically download the same JCE JARs and replace the existing JCE JARs again..??

No. Or at least, not without understanding what the JCE error means.

If you showed us the error messages / stacktraces, maybe we could help you with that.


UPDATE

Those errors look like problems in your code rather than in JCE.

  1. SSHA stands for Salted SHA. SSH / SSHA are secure hash schemes, not an encryption schemes. Moreover, you won't find a JCE provider for SSHA ... because it is really just a variation on SHA where you add a "salt" to the input that you are hashing.

  2. The "illegal key size" exception looks like you are misusing one of the API methods.

If you showed us the code that throws the exceptions ... and the full stacktraces ... we could give you a more definite answer. But I'm convinced that replacing the JCE JARs will make no difference.