A simple Python terminal tool for practicing and visualizing XOR operations at the byte level (0–255). Perfect for beginners learning bitwise logic and binary math — especially in offensive security contexts like payload encoding, shellcode obfuscation, and CTFs.
- Accepts two byte-sized integers (0–255)
- Displays:
- 8-bit padded binary of each input
- XOR result in both binary and decimal
- Validates inputs and handles errors cleanly
- Loops for repeated use
XOR (exclusive OR) is a fundamental operation in:
- Cryptography
- Payload encoding
- Malware evasion
- Shellcode and binary exploitation
Understanding XOR is a must-have skill for for offensive security enthusiasts.
python xor_tool.py XOR Byte Tool (0–255 only) Enter the first number (0–255): 5 Enter the second number (0–255): 3
5 in binary: 00000101 3 in binary: 00000011 XOR result: 00000110 (decimal: 6)
This tool was created as part of learning Python for offensive security and red team tradecraft. It reinforces:
-
Binary representation
-
Bitwise operations
-
Input validation
-
Loop logic and control flow
MIT — do whatever you want with it. Attribution appreciated but not required.