The encryption algorithm is not strong enoug

使用加密解密出现以下问题的解决办法:

1、 The encryption algorithm is not strong enoug

The encryption algorithm is not strong enoug_第1张图片

原因:因为我们没有在bootstrap.properties配置文件中配置密钥。

解决办法:在bootstrap.properties文件中配置密钥:encrypt.key=hdnspace12334566

2、Unable to initialize due to invalid secret key

The encryption algorithm is not strong enoug_第2张图片

控制台出现:java.security.InvalidKeyException: Illegal key size

The encryption algorithm is not strong enoug_第3张图片

原因:这是因为JRE中自带的JCE功能,默认使用的是有长度限制的版本,我们要将其替换成不限长度的JCE版本。

解决办法:通过下载jce8下载, 下载之后进行解压,有如下三个文件:

The encryption algorithm is not strong enoug_第4张图片

我们将local_policy.jar和US_export_policy.jar两个文件复制到jre目录下的security目录中(如:E:\java_dev\Java\jdk1.8.0_121\jre\lib\security),覆盖掉默认的内容就OK了!

你可能感兴趣的:(入坑解决方法)