0

i try to decrypt the encrypted password in .xsh file, i'v searched the answers for sometime, but got almost nothing, some one say there is a python version, i try to rewrite it in java, but it does't work. [here is the phython version]: https://github.com/dzxs/Xdecrypt/blob/master/Xdecrypt.py

this is what i got

        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));

it doen't work.

Pthahnil
  • 61
  • 3
  • 2
    So does the python version work for you ? In what step do you code give another result than the python version ? – Ebbe M. Pedersen Jun 25 '21 at 15:01
  • i didn't wirte the python version, i know waggly what the author try to do, sorry. – Pthahnil Jun 28 '21 at 06:35
  • "It does not work" is the worst problem description. What does not work? Does it not compile? Does it crash at runtime? Does it give the wrong result for some/all inputs? Is the output format incorrect? If you run it in a debugger, where do the states of the Python and Java code start to differ? – knittl Sep 07 '21 at 05:08

0 Answers0