Skip to main content

One of my questions still remains unresolved. I still don't know why XOR, bit shifting and the like are used for hashes and ciphers in the first place - if there is any mathematical reasoning behind this, why it's exactly these operations and nothing else?

One of the reasons why exactly XOR is used is that because XOR has an important property: reversibility. If you XOR a number with a key and then XOR the result with same key again, you will get your original number.