1 XOR 1 = 0
0 XOR 0 = 0
1 XOR 0 = 1
0 XOR 1 = 1


If we have two binary numbers "A" and "B" where:
A XOR B = C then:

C XOR A = B and C XOR B = A

For example:

101101110111011100 "A" XOR
101010001011100101 "B"
------------------
000111111100111001 "C" XOR
101010001011100101 "B"
------------------
101101110111011100 "A"



Coincidentally, This is also how microsoft encrypted their MS word documents awhile back. XOR'ing a 16 byte key throughout the document when the key can be extracted from the header of the file is not very smart.
I haven't checked to see if this is still how things are done, but if it is, Keep your eyes open for an example perl script