I want to XOR the password (0x3d), byte by byte, with 0x42, then 0x51, then 0xF7, then 0x6F. this would give me 0xb6..... But, Is there a shortcut to this operation?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
XOR is associative. Therefore, denoting XOR by ^, you can do
So you can XOR with 0x8B instead. In other words, "multiple xor" is equivalent to a single one.
Associativity follows because XOR is associative on each bit.