小程序手机号解密 偶发性解密异常?
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");