XOR CIPHER

XOR cipher, encode and decode alike.

XOR each character with the key; XOR again to recover. A staple in CTF challenges.

Everything runs locally in your browser

What is this?

XOR returns 0 when bits match and 1 when they differ. XORing twice with the same key returns the original, so encryption and decryption are the same step. The key repeats across the whole text.

FAQ

Why is the output garbled?

XOR results are often non-printable bytes. Tick “Show output as hexadecimal” for a clean hex view.

Is anything uploaded?

No. Everything runs in your browser.

示例与注意事项Example & notes

一个例子A worked example

用密钥 key 异或一段文字得到密文,再用同一密钥异或一次即可还原明文。XOR some text with the key "key" to get ciphertext, and XOR it again with the same key to recover the original.

注意事项Things to watch

相关问答More Q&A

能加密文件吗?Can it encrypt files?

当前处理文本;文件可先转 Base64 再处理,或使用专门的加密工具。Text only for now — convert files to Base64 first, or use a dedicated encryption tool.

密钥要多长?How long should the key be?

越长越好;演示场景建议不短于 8 位,且不要用常见单词。Longer is better: at least eight characters for a demo, and avoid common words.

Further reading

觉得好用?Found it useful?