获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
https://blog.csdn.net/wh7pwb98/article/details/131115516
小程序手机号解密 偶发性解密异常?javax.crypto.BadPaddingException: Given final block not properly padded 后台解密 偶尔解密失败 重新调用都是成功的 byte[] encData = Base64.decodeBase64(encryptedData); byte[] ivStr = Base64.decodeBase64(iv); byte[] key = Base64.decodeBase64(sessionKey); AlgorithmParameterSpec ivSpec = new IvParameterSpec(ivStr); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); SecretKeySpec keySpec = new SecretKeySpec(key, "AES"); cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); String dataResult = new String(cipher.doFinal(encData),"UTF-8");
2023-09-18