liveBook · Manning

Merkle–Damgård construction

The Merkle–Damgård construction builds an arbitrary-length hash function by iteratively applying a fixed-size compression function to padded message blocks.

How 2 Manning books explain it

Hacking Cryptography

A hash function built by repeatedly applying a compression function to message blocks in the Merkle–Damgård construction.

How it is used
Explains why familiar hash functions process blocks iteratively and why that structure matters for authentication failures.
How deep it goes
Traces padding, chained compression, exposed final state, and a SHA-256 length-extension exploit without detailing compression-function internals.
Examples
Demonstrates chained message blocks and a forged bank transaction request that extends a SHA-256 secret-prefix MAC.
What you can do after
Evaluate/understand why a published Merkle–Damgård digest can enable extension of secret-prefix MAC inputs.

Read how Hacking Cryptography explains Merkle–Damgård construction →

Real-World Cryptography

The Merkle–Damgård construction builds an arbitrary-length hash function by iteratively applying a fixed-size compression function to padded message blocks.

How it is used
Explains how SHA-2 hashes arbitrary-length messages using repeated fixed-size compression calls.
How deep it goes
Defines padding, blocking, and chaining, but treats the compression function as a black box.
Examples
Uses SHA-256’s 512-bit blocks, block-processing diagrams, and OpenSSL digest commands for SHA-2 variants.
What you can do after
Evaluate/understand how fixed-size compression supports arbitrary-length hashing and where collision resistance comes from.

Read how Real-World Cryptography explains Merkle–Damgård construction →

What to know first

Related concepts

Questions about Merkle–Damgård construction

What is Merkle–Damgård construction?

The Merkle–Damgård construction builds an arbitrary-length hash function by iteratively applying a fixed-size compression function to padded message blocks.

Which Manning books explain Merkle–Damgård construction?

Hacking Cryptography and Real-World Cryptography.

What should I know before learning Merkle–Damgård construction?

Manning books that teach Merkle–Damgård construction usually introduce hash function first.

What is the difference between Merkle–Damgård construction and sponge construction?

The Merkle–Damgård construction builds an arbitrary-length hash function by iteratively applying a fixed-size compression function to padded message blocks. A sponge construction absorbs input into a state through repeated permutation applications and squeezes output from that state, supporting outputs of arbitrary length.

What kinds of Merkle–Damgård construction are there?

Kinds of Merkle–Damgård construction include SHA-2.

What are the parts of Merkle–Damgård construction?

Merkle–Damgård construction includes compression function and message block.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.