Some of my students have asked why we always use XOR (Exclusive OR) in encrypting plaintext into ciphertext. To answer this question, please take a look first at the output of the various combinations of inputs for XOR function.

Input A
Input B
A XOR B

1
1
0

1
0
1

0
1
1

0
0
0

Suppose we have a plaintext of 1100001111100 and a key of any arbitrary [...]