Question: why xor operation is used in cryptography?
Answer: XOR allows you to easily encrypt and decrypt a string, the other logic operations don't. Here's a wikipedia link on the XOR cipher. I can see 2 reasons: 1) (Main reason) XOR does not leak information about the original plaintext.