Introduction

This man in the picture above is Ralph Merkle — a highly influential computer scientist who is also known as the father of modern public key cryptography. Not bad, eh?

Merkle turned out be an exceptionally smart man already early on — while still being an undergrad, he coming up with an ingenious concept known as Merkle Puzzle in 1974. His idea was groundbreaking and revolved around the question, how two parties can safely exchange secrets even if they have never exchanged secrets before, without anybody else being able to listen in on their exchange.

His solution to this problem was astonishing and works the following way. Let’s assume that the super secret spy Alice wants to communicate with the heroic insider Bob from Evil Corporation, who has an important piece of information that could save the world from eternal evil.

In order for Alice to securely communicate with Bob, she decides to use Merkle’s Puzzle. By doing so, she sends Bob thousands of encrypted messages who all contain a different key. The interesting thing about all of those messages is, that while they are encrypted, this encryption is not super duper difficult to break — it takes a couple of minutes for each message though.

Now, Bob chooses a random message out of the thousands that he received from Alice and starts to decrypt it. After 15 minutes his computer has decrypted the message and now he can see the key that was hidden inside. He now writes a message, uses the key to encrypt it and sends it back to Alice.

Since Alice knows which keys she has sent and which keys belong together, she can now easily find out which key, out of the thousands she sent to Bob, has been chosen by him. From now on they both can easily communicate with each other — and any possible hacker or malicious party would have a very hard time of figuring out what’s happening. Why?

Well, in order to understand their encrypted messages, the hacker would need to decrypt all of the thousands of messages sent (which would require enormous amounts of processing power) and check every possible key with the messages.

So far, so good — Merkle’s Puzzle was an early idea for a public key environment. If you want to read more about Public Key Cryptography, check out this post:

Like this groundbreaking idea hasn’t been enough, five years later he and his college Ivan Damgård came up with another innovative concept known as the Merkle–Damgård construction, which he published as his PhD thesis in 1979. This idea is also known as a cryptographic hash function and plays a big role in Merkle Trees. But more on this later.

In the same year, he published his paper “A certified digital signature” — this idea became known as Merkle Trees.

Let’s see what it describes:

“The invention comprises a method of providing a digital signature for purposes of authentication of a message, which utilizes an authentication tree function of a one-way function of a secret number.”

Say what?

No worries, in this post we will dissect the different aspects of this and by the end you’ll have no problem understanding what Merkle Trees are and why they are incredibly important!

His idea revolved around a new and highly efficient way to create digital signatures or proofs. By using his idea, we now have a very practical way of efficiently summarizing large sets of data and verifying their integrity.

Before we get into the nitty gritty details of this, we need to recap one important building block of his idea — hash functions.