Java System Properties
Quick Reference Guide


jdk.crypto.disabledAlgorithms Java Security Property

The jdk.crypto.disabledAlgorithms Java Security Property allows you to disable algorithms for JCE/JCA cryptographic services.

Default Value

Currently no algorithms are disabled by default, however this may change in the future. Check your current java.security file to see if any are disabled.

jdk.crypto.disabledAlgorithms Explained

If an algorithm is listed in this property the JCA/JCE cryptographic services will prevent it from loading at runtime.

WARNING Be careful when changing this value, you don't want to accidentally enable a weak algorithm. Doing so may significantly decrease the security of your Java Application.

Exceptions Thrown

You will get a java.security.NoSuchAlgorithmException if you attempt to instantiate an algorithm on the jdk.crypto.disabledAlgorithms list at runtime (for example via java.security.MessageDigest.getInstance("MD5") if you had disabled MessageDigest.MD5).

Related Properties

References

Supported Since

Java has supported the jdk.crypto.disabledAlgorithms security property since Java 26+, Java 25.0.3, 21.0.11, 17.0.19, 11.0.31, 8u491.

Setting / Reading jdk.crypto.disabledAlgorithms at Runtime

You can set jdk.crypto.disabledAlgorithms at runtime with the following Java code:

java.security.Security.setProperty("jdk.crypto.disabledAlgorithms", "MessageDigest.MD5");

Please note that the jdk.crypto.disabledAlgorithms value needs to be specified early, before the internal java classes are loaded that might use this value otherwise it will be ignored.

To read the value of jdk.crypto.disabledAlgorithms at runtime, you can use this Java code:

String propertyValue = java.security.Security.getProperty("jdk.crypto.disabledAlgorithms");
if (propertyValue != null) {
    System.out.println("jdk.crypto.disabledAlgorithms = " + propertyValue);
} else {
    System.out.println("jdk.crypto.disabledAlgorithms was null");
}

Setting jdk.crypto.disabledAlgorithms on Startup

Be aware that jdk.crypto.disabledAlgorithms is not a Java System Property, it is a Java Security Property. Therefore you cannot set it from the command line using -Djdk.crypto.disabledAlgorithms. You have to set jdk.crypto.disabledAlgorithms in the java.security properties file.