As we talked about yesterday, the default JDK has a limitation on key size which is bounded by the JCE Jurisdiction Policy.
But actually, Java provides a JCE Patch such that you can remove the restriction on key size.
The patch is called Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files which can be download at Java SE Downloads.
Extract the download file and copy the following 2 files to your JDK which is $JAVA_HOME/jre/lib/security
- local_policy.jar
- US_export_policy.jar
Check the key size and now all algorithms will have unlimited key size restriction.
BLOWFISH : 2147483647bit ARCFOUR : 2147483647bit PBEWITHMD5ANDDES : 2147483647bit RC2 : 2147483647bit RSA : 2147483647bit PBEWITHMD5ANDTRIPLEDES: 2147483647bit PBEWITHSHA1ANDDESEDE : 2147483647bit DESEDE : 2147483647bit AESWRAP : 2147483647bit AES : 2147483647bit DES : 2147483647bit DESEDEWRAP : 2147483647bit RSA/ECB/PKCS1PADDING : 2147483647bit PBEWITHSHA1ANDRC2_40 : 2147483647bit
Done =)
