Created
February 7, 2026 15:50
-
-
Save gardar/af5cd6c379c46c2c41c08a24668a834a to your computer and use it in GitHub Desktop.
Decrypt ruckus backups, debug info files, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Decrypt Ruckus Unleashed encrypted files | |
| Algorithm source: https://ms264556.net/ruckus/DecryptRuckusBackups | |
| """ | |
| import struct, sys, os | |
| def ruckus_decrypt(input_path, output_path): | |
| (xor_int, xor_flip) = struct.unpack('QQ', b')\x1aB\x05\xbd,\xd6\xf25\xad\xb8\xe0?T\xc58') | |
| structInt8 = struct.Struct('Q') | |
| with open(input_path, "rb") as f_in, open(output_path, "wb") as f_out: | |
| data = f_in.read() | |
| prev = 0 | |
| for block in struct.unpack_from(str(len(data) // 8) + "Q", data): | |
| out = structInt8.pack(prev ^ xor_int ^ block) | |
| xor_int ^= xor_flip | |
| prev = block | |
| f_out.write(out) | |
| padding = out[-1] & 0xf | |
| if padding: | |
| f_out.seek(-padding, os.SEEK_END) | |
| f_out.truncate() | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 2: | |
| print(f"Usage: {sys.argv[0]} <encrypted_file> [output]") | |
| sys.exit(1) | |
| output = sys.argv[2] if len(sys.argv) >= 3 else sys.argv[1] + ".decrypted" | |
| ruckus_decrypt(sys.argv[1], output) | |
| print(f"Decrypted: {output}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment