Linux AES加密解密报错Given final block not properly padded

解决办法:

//防止linux下 随机生成key
SecureRandom secureRandom = SecureRandom.getInstance(“SHA1PRNG” );
secureRandom.setSeed(keycontent.getBytes());
// 根据密钥初始化密钥生成器
kgen.init(keyNum, secureRandom);

posted @ 2020-12-14 13:48  D·Felix  阅读(541)  评论(0编辑  收藏  举报