Does the output hash of simple hash and Merkle hash are same for same data>>??

  • 1
    $\begingroup$ You are confusing the concepts. Hashing a data is a single step use of a hash algorithm whereas Merkle Tree is an idea of providing integrity for the contents of large data set using a tree approach. $\endgroup$ – kelalaka May 26 at 4:43
  • $\begingroup$ Calling a Merkle tree a Merkle hash is somewhat confusing. There is also the Merkle–Damgård construction for building secure hash algorithms (such as SHA-1 and SHA-2). Calling it a Merkle tree or hash tree (or hash list for a 2 level tree) is probably best. $\endgroup$ – Maarten Bodewes May 26 at 17:09

No, they aren't, at least if you assume that the Merkle tree has a height of over 1 node, because in that case the "tree" would contain a single node and the two are equivalent. The height and amount of data / number of hashes per node are generally configured beforehand, and specifying 1 doesn't make sense.

A Merkle tree consists of multiple nodes, and each node consist of the hash of the underlying layer. That layer can consist either of other nodes or of data (I've not seen that data and nodes are mixed, and that would be dangerous practice). However, even for a two-height / two-node tree you would have $\text{H}(\text{H}(M))$ instead of just $\text{H}(M)$.

As finding a hash where $\text{H}(\text{H}(M)) = \text{H}(M)$ would amount to a collision, a secure hash will never output the same value for a hash and a Merkle tree.

| improve this answer | |
  • $\begingroup$ Did this answer your question Raghul? $\endgroup$ – Maarten Bodewes May 29 at 20:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.