-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secure xor hashes #4092
Comments
We should remove the XOR operator we added to MassaHash to avoid errors |
Adapting the code to use extended hash for the db xor seems relatively straightforward, but I was thinking about what we print in the node. Printing 512 bytes of hash every slot on finalize() seems too much, but I assume everything else (such as printing the first and last bytes, but cutting out the middle) would decrease the security? |
This is what printing the whole thing would look like:
so what I recommend is to print the normal hash of the big hash :) (but just for the logs !!) |
Oops forgot to make :
|
After further study with Seb, there is a way to make the XOR secure against the algorithm we mentioned.
The paper states an attack complexity of
O(2^'2sqrt(n))
where n is the number of bits of the hash.So if we want a 128 bit security (the same as the one of 256bit hash collisions) we need to increase the hash size to
n=4096bits
which is 512 bytes. (that's a big hash !). This can be done with the blake3 crate using XOF extensions, see the "extended output" example in https://docs.rs/blake3/latest/blake3/#examplesOriginally posted by @damip in #3852 (comment)
The text was updated successfully, but these errors were encountered: