我尝试解密.xsh文件中的加密密码,我搜索了一段时间的答案,但几乎一无所获,有人说有python版本,我尝试用java重写它,但它不起作用。[这里是phython版本]:https ://github.com/dzxs/Xdecrypt/blob/master/Xdecrypt.py
这就是我得到的
String sid = "*********";
String encryptedPwd = "************";
byte[] encryptedPwdBytes = Base64.decode(encryptedPwd);
byte[] keyBytes = DigestUtil.digest(sid.getBytes(), "SHA-256");
SecretKeySpec key = new SecretKeySpec(keyBytes, "ARC4");
Cipher cipher = Cipher.getInstance("ARC4", new BouncyCastleProvider());
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] bytes = cipher.update(encryptedPwdBytes, 0, encryptedPwdBytes.length);
System.out.println(new String(bytes));
它不起作用。