Skip to content
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

Hashcash should use stronger hash #30

Open
paulpach opened this issue Oct 16, 2020 · 0 comments
Open

Hashcash should use stronger hash #30

paulpach opened this issue Oct 16, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@paulpach
Copy link

paulpach commented Oct 16, 2020

Describe the bug
FNV is not suitable for Hashcash.

return (difficulty == 0 || ((HashProvider.GetStableHash64(challenge + additionsRequired) << ((sizeof(ulong) * 8) - difficulty)) >> ((sizeof(ulong) * 8) - difficulty)) == 0);

Any math undergrad can break this in his spare time.
You need a stronger cryptographic algorithm for hashcash. The state of the art appears to be sha256, or at least sha1:
https://en.bitcoin.it/wiki/Hashcash#Hash_function_choices

@paulpach paulpach added the bug Something isn't working label Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant