求大佬,这段JAVA代码怎么转换成php

@Ta 2020-10-13 4228点击
public static String Decrypt(String str) {
        try {
            Response response = (Response) new GsonBuilder().enableComplexMapKeySerialization().create().fromJson(str, Response.class);
            byte[] seed = "P.8CGq@Wr~Vs]!4!".getBytes();
            String iv = response.getIv();
            String encrypted = response.getData();
            SecretKeySpec skeySpec = new SecretKeySpec(seed, "AES");
            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
            cipher.init(2, skeySpec, new IvParameterSpec(SecrecyBase64Utils.decode(iv)));
            return new String(cipher.doFinal(SecrecyBase64Utils.decode(encrypted))).trim();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
回复列表(4|隐藏机器人聊天)
添加新回复
回复需要登录