Relationship between XOR and "AND" 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?
XOR is associative. Therefore, denoting XOR by ^, you can do

&gt;&gt;&gt; 0x3D ^ 0x42 ^ 0x51 ^ 0xF7 ^ 0x6F
182


but also

&gt;&gt;&gt; 0x3D ^ (0x42 ^ 0x51 ^ 0xF7 ^ 0x6F)
182


which is

&gt;&gt;&gt; 0x3D ^ 0x8B
182


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.
(p XOR q) = (¬p AND q) OR (p AND ¬q), if that was what you were asking.