AES加密异常处理 InvalidAlgorithmParameterException:expected IV length of 16 but was 32
来源:互联网 发布:全国医院数据库 编辑:程序博客网 时间:2024/06/07 13:57
java.security.InvalidAlgorithmParameterException: expected IV length of 16 but was 32.
大概的意思是:无效的算法参数异常:期望的阈值是16但是给的是32
注意到当前密码长度是32的,而我生成的密码配置是128bit(java int占4位,既32个整型)
那么既然要求长度16密码,生成密码的配置就是16x4=64bit。
这就简单了,处理如图生成秘钥的配置改成64bit:
ps:我这边AES加密配置的规则是“AES/CBC/PKCS5PADDING”,不知道是不是这里的规则导致对密码阈值的要求,知道的可以告知我下,非常感谢!ye.jg@qq.com
阅读全文
0 0
- AES加密异常处理 InvalidAlgorithmParameterException:expected IV length of 16 but was 32
- Expected BEGIN_ARRAY but was BEGIN_OBJECT
- Expected BEGIN_OBJECT but was BEGIN_ARRAY
- Expected BEGIN_OBJECT but was BEGIN_ARRAY
- Android开发报错:GoogleApiClient.isConnected()' was expected to be of type interface but instead was ...
- Bean named 'BService' is expected to be of type 'path1' but was actually of type 'path2'
- is expected to be of type but was actually of type 'com.sun.proxy.$Proxy70'
- Expected BEGIN_OBJECT but was BEGIN_ARRARY at line 1 column 2 path$异常解决方法
- Gson Expected BEGIN_ARRAY but was STRING
- expected:<Hello[]> but was:<Hello[maven]>
- JSON Expected BEGIN_OBJECT but was BEGIN_ARRAY
- ERROR:Terminal, but class was expected
- is expected to be of type 'org.com.ssh.hibernate.AOPService.EchoTest' but was actually of type 'com.
- AES加密中的异常
- go语言AES加密iv向量问题
- Gson解析Json字符串出现异常:Expected a BEGIN_ARRAY but was STRING at line 1 column 107 $的解决方法
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present
- BeanNotOfRequiredTypeException 异常:but was actually of type 'com.sun.proxy.$Proxy17'
- 从神经网络到深度学习(学习网址)
- SSM,在后台打印SQL
- android IPC笔记
- SpringMVC通过切面,实现超灵活的注解式数据校验
- JS——密码强度
- AES加密异常处理 InvalidAlgorithmParameterException:expected IV length of 16 but was 32
- curl发送请求简单实践
- MySQL优化之表结构优化的5大建议(数据类型选择讲的很好)
- Boost 随机数库的使用
- jetson 使用技巧
- 阿里云Elasticsearch的X-Pack:机器学习、安全保障和可视化
- GreenDao报Can't replace method in ...\mvp\model\BrandModel.java:120 with generated version.错误的解决办法
- Java获取当前时间及String、datetime、date相互转化
- No Identifier specified for entity