How xor cipher works
XOR (exclusive OR) is the simplest cipher there is: each byte of the message is paired with a byte of the key and combined with the bitwise XOR operation, which outputs 1 when the two input bits differ. The magic property is self-inverse — anything XORed with the same value twice comes back unchanged — so encryption and decryption are the same operation, and this tool runs in both directions.
The key repeats across the message (repeating-key XOR): a key of length 4 is applied to bytes 1, 5, 9... and so on. Text keys are encoded as UTF-8 bytes; you can also paste a key as hex for byte-exact control, which is how CTF challenges usually specify keys. Encrypted output is shown as hex or base64 — both are safe ways to represent the arbitrary bytes XOR produces, which rarely form printable text.
This is a classic teaching cipher and CTF staple, not real encryption: reusing a key across messages lets an attacker XOR two ciphertexts together and cancel the key out, and statistical attacks recover short keys quickly. Real systems build on the same XOR primitive but with keys that never repeat (stream ciphers like ChaCha20) — same operation, vastly better key discipline. Everything runs client-side.