CSC373/406: C: Using XOR [39/42] Previous pageContentsNext page

XOR is important in cryptography

the following hold for any x and y

x ^ x         ==  0
x ^ 00000000  ==  x
x ^ 11111111  == ~x

x ^ y == (~x | ~y) & ~(x & y)
x ^ y == (x & ~y) | (~x & y)

Previous pageContentsNext page