本人微信公众号"aeolian"~

AES加密报错Illegal key size

报错

java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039) ~[na:1.8.0_71]
    at javax.crypto.Cipher.implInit(Cipher.java:805) ~[na:1.8.0_71]
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864) ~[na:1.8.0_71]
    at javax.crypto.Cipher.init(Cipher.java:1396) ~[na:1.8.0_71]
    at javax.crypto.Cipher.init(Cipher.java:1327) ~[na:1.8.0_71]

《AES加密报错Illegal key size》

 

解决方案

下载lib包

https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

替换jdk安装目录下 jre* \lib\security 中的 local_policy.jar  和 US_export_policy.jar 两个jar包

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *