-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
FNV is not suitable for Hashcash.
Ruffles/Ruffles/Hashing/HashCash.cs
Line 23 in 3f0c582
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working