Cryptography & Security
Basic

XOR Cipher

Bitwise XOR of message and key; XOR again with k to decrypt.

Formula

c=mkc = m \oplus k

Variables

cCiphertext
mMessage bit
kKey bit

Example

1 XOR 1 = 0; applying key twice returns the message

Did You Know?

A one-time pad — XOR with a truly random key as long as the message — is the only cipher proven unbreakable.

Share this formula