Created
January 23, 2026 14:42
-
-
Save mainframed/1fc9645da2edd4efe4ff6b2d6a458990 to your computer and use it in GitHub Desktop.
Decode Websphere XOR
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
| import base64 | |
| def decode_was_xor(xor_string): | |
| if not xor_string.lower().startswith("{xor}"): | |
| raise ValueError("Not a WebSphere {xor} string") | |
| xor_data = xor_string[5:] # Remove {xor} prefix | |
| # Base64 decode | |
| decoded_bytes = base64.b64decode(xor_data) | |
| key = 0x5A # WebSphere XOR key | |
| decoded = "" | |
| for byte in decoded_bytes: | |
| decoded += chr(byte ^ key) | |
| return decoded | |
| # Example usage | |
| xor_value = "{xor}ABo9hHg=" | |
| password = decode_was_xor(xor_value) | |
| print(password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment