Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy MD5 is required for JCE initialization
    primarykey
    data
    text
    <p>I am experimenting on enabling FIPS 180-3 on my java application. FIPS 180-3 allows only usage of 5 secure [hashes] (http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf) , MD5 is not one among them. Hence i am trying to programatically remove MD5 algorithms from the Sun provider. This is the sample code.</p> <hr> <pre><code>public static void main(String[] args) throws Exception { Security.removeProvider("SUN"); Sun sun = new Sun(); sun.remove("MessageDigest.MD5"); //Comment and it will work !!! Security.addProvider(sun); Cipher ciph = Cipher.getInstance("AES"); } </code></pre> <hr> <p>But this is throwing the following exception. If you comment "sun.remove(.." the program works fine. If i remove MD2, instead of MD5 then also it works fine.</p> <p>To me it looks like the jre libs are using MD5 for their signing, but i checked jre/lib/ext/sunjce_provider.jar signer and its using sha1.</p> <p>Any idea why my code is failing with this error?</p> <p>Exception in thread "main" java.lang.ExceptionInInitializerError at javax.crypto.Cipher.getInstance(DashoA13*..) at TestRemoveMD5.main(TestRemoveMD5.java:20)</p> <p>Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs at javax.crypto.SunJCE_b.(DashoA13*..) ... 3 more</p> <p>Caused by: java.lang.SecurityException: Signature classes have been tampered with at javax.crypto.SunJCE_b.d(DashoA13*..) at javax.crypto.SunJCE_b.c(DashoA13*..) at javax.crypto.SunJCE_b$1.run(DashoA13*..) at java.security.AccessController.doPrivileged(Native Method) ... 4 more</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload