XOR two hexadecimal strings together.
XOR (exclusive OR, written as ⊕) is a fundamental binary operation in cryptography and computer science. It compares two bits and returns 1 when they differ and 0 when they match. The truth table is exhaustive: 0⊕0=0, 0⊕1=1, 1⊕0=1, 1⊕1=0. This deceptively simple operation underpins almost every modern encryption algorithm, message authentication code, and key derivation function used in payment systems. In payment security, XOR is everywhere: PIN Block construction under ISO 9564, key component combining for split-knowledge ceremonies, MAC calculations under ANSI X9.19 and ISO 9797-1, IV chaining in CBC mode, the round-function mixing inside DES and AES, and the keystream layer in DUKPT and stream ciphers. The reason XOR is so popular is its self-inverse property: A ⊕ B ⊕ B = A. This means the same operation that encrypts a block also decrypts it when applied with the same key, which is why XOR forms the foundation of the one-time pad — the only cipher with proven unconditional security, provided the key is truly random, kept secret, and never reused.
XOR outputs 1 exactly when the two input bits differ — the property every construction below relies on:
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Each hex character is 4 bits, so the operation runs nibble by nibble. Here is A5 ⊕ 3C, bit by bit, and the same idea scaled up to combining two key components into a working key:
A5 = 1010 0101
3C = 0011 1100
---------
99 = 1001 1001 (A5 ⊕ 3C)
Key component ceremony (split knowledge):
Component 1: 0123 4567 89AB CDEF 0123 4567 89AB CDEF
Component 2: FEDC BA98 7654 3210 FEDC BA98 7654 3210
-----------------------------------------
Key: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFFCombine and split key components with KCV verification →