tools / Reverse Engineering & CTF

XOR Calculator

XOR some data against a key, with either side as hex or text and the key repeating across the data. A staple for CTF crypto and for peeling the light obfuscation you find in malware and firmware.

result (hex)
0a 27 2e 2e 2d 6e 62 35 2d 30 2e 26 63
result (text)
'..-nb5-0.&c
result (base64)
CicuLi1uYjUtMC4mYw==

Single-byte XOR is symmetric: run the output back through the same key to decrypt.

How it works

XOR is its own inverse

A ^ B ^ B = A, so encrypting and decrypting are the same operation. Run the output back through the same key and you get the original bytes.

FAQ

How do I brute a single-byte XOR key?

This does one key at a time. Try each byte 0x00 to 0xff and look for readable output, or a known plaintext fragment, in the result.

Related tools

> more from the blog

Mushraf Mustafa logo