小游戏解密分享群的openGid报错pad block corrupted
[代码]public[代码] [代码]static[代码] [代码]byte[代码][代码][] decryptOfDiyIV([代码][代码]byte[代码][代码][] encryptedData, [代码][代码]byte[代码][代码][] keyBytes,[代码][代码]byte[代码][代码][] ivs) {[代码][代码] [代码][代码]byte[代码][代码][] encryptedText = [代码][代码]null[代码][代码];[代码][代码] [代码][代码]init(keyBytes);[代码][代码] [代码][代码]try[代码] [代码]{[代码][代码] [代码][代码]Cipher cipher = Cipher.getInstance(algorithmStr, [代码][代码]"BC"[代码][代码]);[代码][代码] [代码][代码]cipher.init(Cipher.DECRYPT_MODE, key, [代码][代码]new[代码] [代码]IvParameterSpec(ivs));[代码][代码] [代码][代码]encryptedText = cipher.doFinal(encryptedData);[代码][代码] [代码][代码]} [代码][代码]catch[代码] [代码](Exception e) {[代码][代码] [代码][代码]// TODO Auto-generated catch block[代码][代码] [代码][代码]e.printStackTrace();[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]encryptedText;[代码][代码] [代码][代码]}[代码]登录获取userinfo,解密是没有问题的。分享群获取openGid的时候,有些人是正常的,有些就会报错 javax.crypto.BadPaddingException: pad block corrupted at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.doFinal(Unknown Source) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) at javax.crypto.Cipher.doFinal(Cipher.java:2165)