In this article MERKLE PROOFS FOR OFFLINE DATA INTEGRITY there is a paragraph:
Warning: Cryptography is harder than it looks. The initial version of this article had the hash function hash(a^b). That was a bad idea because it meant that if you knew the legitimate values of a and b you could use b' = a^b^a' to prove any desired a' value. With this function you'd have to calculate b' such that hash(a') ^ hash(b') is equal to a known value (the next branch on the way to root), which is a lot harder.
I can see that this code seems to be insecure:
function pairHash(uint _a, uint _b) internal pure returns(uint) {
return uint(keccak256(abi.encode(_a ^ _b)));
}
Could somebody explain why and provide an example(real code appreciated)? Or maybe just a URL to corresponding article (the closest one I've found is this one)
Thanks in advance