Skip to content

Hashcash should use stronger hash #30

Description

@paulpach

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions