Due to legal reasons the default jdk from oracle does not have strong encryption enabled by default the Java Cryptography Extension (JCE) Unlimited Strength needs to be downloaded and configured.
The following java code can be used to test if your jvm has it configured:
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class TestStrongEnc {
public static void main(String[] args) {
System.out.println("Do I have JCE unlimited java strong encryption extension installed? --->>> " + TestStrongEnc.isUnlimitedKeyStrength());
}
public static boolean isUnlimitedKeyStrength() {
try {
return Cipher.getMaxAllowedKeyLength("AES/GCM/NoPadding") == Integer.MAX_VALUE;
} catch (NoSuchAlgorithmException nsae) {
System.out.println("Your current in use jvm does NOT hava the JCE unlimited strengh ecnryption packages installed");
return false;
}
}
}