Skip to content

Instantly share code, notes, and snippets.

@mainframed
Created January 23, 2026 14:42
Show Gist options
  • Select an option

  • Save mainframed/1fc9645da2edd4efe4ff6b2d6a458990 to your computer and use it in GitHub Desktop.

Select an option

Save mainframed/1fc9645da2edd4efe4ff6b2d6a458990 to your computer and use it in GitHub Desktop.
Decode Websphere XOR
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