BowerStudios.com

  • My Lab
  • Family
  • Friends
  • Professional
  • About
Home

Determine whether your java install has limited key strength due to export restrictions

daniel —Tue, 07/16/2013 - 2:28pm

  • Groovy
  • Java

Detect the allowed size of AES keys on the JVM on github by jehrhardt

Or, in Groovy:
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
int allowedKeyLength = 0
try {
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES")
} catch (NoSuchAlgorithmException e) {
e.printStackTrace()
}
if(allowedKeyLength < Integer.MAX_VALUE){
println "The allowed key length for AES is: $allowedKeyLength, which is less than Integer.MAX_VALUE, and therefore 'Limited' as defined in the JavaDoc for Cipher.getMaxAllowedKeyLength()"
}else{
println "The allowed key length for AES is: $allowedKeyLength, which is equal to Integer.MAX_VALUE, and therefore 'Unlimited' as defined in the JavaDoc for Cipher.getMaxAllowedKeyLength()"
}

  • Log in to post comments

Navigation

  • Search
  • Recent content
  • Contact Me
  • Mail
  • Pass Hasher
  • Bower Studios Admin

Quotes

daniel —Mon, 02/26/2007 - 12:19pm

All human situations have their inconveniences. We feel those of the present but neither see nor feel those of the future; and hence we often make troublesome changes without amendment, and frequently for the worse.

—

Benjamin Franklin

  • Log in to post comments
  • daniel's quotes

Popular content

Last viewed:

  • Collectd on Ubuntu (Monitoring)
  • Postgresql - Search all tables for a column name
  • Adding Environment Variables to Tomcat
  • Linux Consoles
  • Nice Tutorial for Trace route on Linux (mtr)

Copyright 2021 Daniel Bower
  • My Lab
  • Family
  • Friends
  • Professional
  • About