Created
July 7, 2016 18:02
-
-
Save ryanwoodsmall/12837ef0cee94d099bc819c72c555fa5 to your computer and use it in GitHub Desktop.
JCE unlimited strength crypto checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exit code 0 if JCE is available, 1 otherwise | |
/* | |
* one-liner: | |
* jrunscript -e 'exit (javax.crypto.Cipher.getMaxAllowedKeyLength("AES") < 256);' | |
*/ | |
import javax.crypto.Cipher; | |
public class jcecheck { | |
public static void main(String[] args) throws Exception { | |
int maxrc5 = Cipher.getMaxAllowedKeyLength("RC5"); | |
int maxaes = Cipher.getMaxAllowedKeyLength("AES"); | |
//System.out.println("max RC5 = " + maxrc5); | |
//System.out.println("max AES = " + maxaes); | |
System.exit((maxaes < 256) ? 1 : 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment