0

I am trying to find a good implementation of Merkle Tree generation in Golang, and I need the tree to be resilient to Second Preimage Attack

I have found this standard implementation in the golang docs, but it looks to me like it is susceptible to Second Preimage Attacks, since it only uses 1 hashing algorithm for the leaf and interior nodes. Is this right?

Is so, is there a standard implementation of this available?

  • Does this answer your question? [How does second pre-image attack on Merkle Signature Scheme work?](https://crypto.stackexchange.com/questions/81981/how-does-second-pre-image-attack-on-merkle-signature-scheme-work) – kodlu Aug 24 '22 at 19:39
  • 1
    I've had read through that, and this makes me believe that the above implementation is not safe, however I am not 100% sure so wanted clarification on here – Barney Chambers Aug 24 '22 at 20:03
  • ok fair enough... – kodlu Aug 24 '22 at 20:27
  • One cryptography hash function is enough as long as one puts level indicator into hashing, see [here](https://crypto.stackexchange.com/a/71313/18298) – kelalaka Aug 27 '22 at 11:38

0 Answers0