LOGBOOK

HELP

1 / 46
Other keys: show • Space: good • 1-4: rate • 0: skip • 5: flag

Question

What is the XOR operation and why is it fundamental to symmetric cryptography?

Answer

XOR (exclusive OR) outputs 1 when the two input bits differ, and 0 when they are the same.

XOR is self-inverse: the same operation encrypts and decrypts

* The same XOR with the key both encrypts and decrypts — $(A \oplus B) \oplus B = A$. *

Truth table:

A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

Why it matters for cryptography:

  • XOR is its own inverse: $(A \oplus B) \oplus B = A$ — this means the same operation encrypts and decrypts
  • It's extremely fast in hardware (single gate)
  • It perfectly mixes bits without losing information (bijective for a fixed key)

Tip: Think of XOR as a "toggle switch" — applying the same key toggles between plaintext and ciphertext.

Go deeper:

or press any other key

Question

How do you perform XOR on binary numbers? Calculate: $1010\,0111 \oplus 0011\,1100$

Answer

Apply XOR bit by bit — where bits differ you get 1, where they match you get 0. Result: $1001\,1011$.

Step by step:

$$\begin{array}{r} 1010\,0111 \\ \oplus\; 0011\,1100 \\ \hline 1001\,1011 \end{array}$$

Each column is independent — just compare the two bits:

  • $1 \oplus 0 = 1$, $0 \oplus 0 = 0$, $1 \oplus 1 = 0$, $0 \oplus 1 = 1$, $0 \oplus 1 = 1$, $1 \oplus 1 = 0$, $1 \oplus 0 = 1$, $1 \oplus 0 = 1$

Tip: "Same = 0, Different = 1" — that's all you need to remember for XOR.

or press any other key