By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
XOR is the building block of many modern ciphers. A repeating-key XOR cipher is simple, and it is a classic first exercise in cryptography courses and capture-the-flag games.
Enter text and a key to get hex, or paste hex and the key to get the text back.
How to Use This Tool
- Type your text, or paste hex to decrypt.
- Enter the key.
- Choose the direction.
- Press Run.
How the Calculation Works
The text and key are turned into bytes with UTF-8. Each byte of the text is XORed with the next byte of the key, and the key repeats. The result bytes are shown as hex. Decryption does the same on the hex bytes and reads the result as text.
Worked Example
The text abc with the key k gives the bytes 0A 09 08, shown as 0a0908.
Common Uses
- Teaching cryptography.
- Capture-the-flag challenges.
- Simple obfuscation.
- Understanding XOR.
Tips and Common Mistakes
- Never use a short repeating key for real secrets.
- The key must not be empty.
- Hex input may include spaces.
Related Tools
Next, you may need the Vigenère cipher, bitwise calculator, checksum calculator, Caesar cipher.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.