1 / 42
Other keys: show •
Space: good •
1-4: rate •
0: skip •
5: flag •
6: invert
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.
* The same XOR with the key both encrypts and decrypts — (A⊕B)⊕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 XOR B) XOR 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:
XOR cipher (Wikipedia) — how XOR builds the simplest symmetric cipher.
or press any other key
Note saved — thanks!