java 的bouncycastle AES加密,怎么处理成php的,疑惑

JAVA AES 程序

public static String decryptWithBC(String data, String key) throws Exception {
     
	ByteBuffer buffer = ByteBuffer.allocate(32);
    buffer.put(key.getBytes());
    KeyParameter kp = new KeyParameter(buffer.array());
    
    byte[] bytes = Base64.decodeBase64(data);

    CBCBlockCipher aes = new CBCBlockCipher(new AESEngine());
       PKCS7Padding p7 = new PKCS7Padding();
    PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher(aes, p7);
    cipher.init(false, kp);

    byte[] output = new byte[cipher.getOutputSize(bytes.length)];
    int len = cipher.processBytes(bytes, 0, bytes.length, output, 0);
    int len2 = cipher.doFinal(output, len);
    byte rawData[] = new byte[len+len2];
    System.arraycopy(output, 0, rawData, 0, rawData.length);
    String plainData = new String(rawData, Charset.forName("utf-8"));
    return plainData;
}

这是aes/cbc/pkcs7daddping 256 嘛? 搞不懂它这个IV 填充方式,如何翻译成php的 求大神帮忙

哪位帮解决,悬赏100

你可能感兴趣的:(AES,加密解密,php,java)