使用AES加密时,当密钥大于128时,代码会抛出Java.security.InvalidKeyException: Illegal key size or default parameters。
   Illegal key size or default parameters是指密钥长度是受限制的,java运行时环境读到的是受限的policy文件。文件位于${java_home}/jre/lib/security
    解决办法:
    需要下载Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files。

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 Download
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8 Download
Extract the jar files from the zip and save them in ${java.home}/jre/lib/security/

参考:http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters

无觅关联推荐,快速提升流量