Skip to content

Instantly share code, notes, and snippets.

@emboss
Last active December 10, 2015 17:58
Show Gist options
  • Save emboss/4470795 to your computer and use it in GitHub Desktop.
Save emboss/4470795 to your computer and use it in GitHub Desktop.
Test program to detect the need for "Unlimited Strength Policy Files"
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
public class TestPolicyFiles {
public static void main(String[] args) {
try {
KeyGenerator keygen = KeyGenerator.getInstance("AES");
keygen.init(256);
SecretKey key = keygen.generateKey();
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5PAdding");
aes.init(Cipher.ENCRYPT_MODE, key);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
@simi
Copy link

simi commented Jan 6, 2013

@emboss ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment