← Back to section · Post-Quantum Cryptography

Lamport One-Time Signatures: The Origin of Hash-Based Signatures

Lamport's 1979 construction — the first hash-based signature: signing by revealing hash preimages, why each key may be used only once, and the paradigm it set for the whole family.

Published 22 November 2026 · 5 min read · PQ Frontier

Lamport One-Time Signatures: The Origin of Hash-Based Signatures
AI-generated site artwork
Video explainer · Hash-based signatures

The hash-based signature family begins with a short 1979 paper by Leslie Lamport. The scheme he proposed is almost primitive in its simplicity: no factoring, no discrete logarithms — just a good hash function, and you can build a digital signature whose security argument is transparent. Half a century later, from XMSS and LMS to SLH-DSA in FIPS 205, the lowest-level building block of every hash-based signature is still Lamport’s “reveal the preimage” trick. Understand it, and you understand the family’s DNA.

The construction: 256 pairs of secrets and their hashes

Take a hash function with 256-bit output, such as SHA-256. To generate a key, the signer picks 256 pairs of random secrets — for bit position i, two secrets, one standing for bit 0 and one for bit 1. These 512 random values form the private key; hashing each of them yields the 512 values of the public key. With SHA-256 the private and public keys are each about 16 KB — an enormous size in 1979, but the structure contains no mathematical machinery at all: security rests entirely on the one-wayness of the hash function.

To sign, first hash the message to a 256-bit digest, then process it bit by bit: where digest bit i is 0, reveal the secret from pair i that stands for 0; where it is 1, reveal the one that stands for 1. The signature is the 256 revealed preimages, about 8 KB. A verifier hashes each revealed preimage and compares it against the corresponding entry in the public key, checking that the pattern of choices matches the message digest. If everything lines up, the signature is valid.

Why it is secure: one-wayness is the whole assumption

The security argument is reassuringly plain. To forge a signature on a new message, an attacker must, at at least one bit position, produce a preimage of some hash value in the public key — and all the attacker has ever seen are the preimages revealed in past signatures. Inverting a hash to find a preimage is exactly the attack hash functions are designed to resist. In other words, the security of Lamport signatures reduces tightly to the preimage resistance of the underlying hash function, with no extra assumption added. This remains the hash-based family’s most precious quality: when RSA and elliptic curves fall to quantum computers and the algebraic structure of lattices is still being tested by time, the one-wayness of hash functions is among the most thoroughly studied and most confidently trusted primitives in cryptography.

That confidence largely survives quantum attack: Grover’s algorithm reduces preimage search to its square root, turning 256 bits of classical security into roughly 128 bits — a discount, not a break. Lengthening the hash output restores the margin.

Two easily overlooked details deserve mention. First, why sign the digest rather than the message itself: the digest compresses a message of any length into a fixed bit string aligned with the key structure, giving the bit-by-bit reveal a definite correspondence, and hashing before signing also binds the signed object with collision resistance. Second, the quality of the private key depends entirely on randomness: if the 512 secret values are not truly random — if they come from a weak source or a predictable seed — an attacker can guess the unrevealed preimages directly, bypassing the hash, and the reduction has nothing to stand on. Hash-based signatures minimize the mathematical assumptions only by pushing the engineering assumptions (randomness, state) to the front — a character trait that runs through the entire family. The size bill is worth noting too: at roughly 16 KB each for public and private keys and about 8 KB per signature, the scheme is merely “large” by today’s standards, but in a system maintaining thousands upon thousands of public keys it is an unbearable distribution cost — exactly the problem Merkle trees would come to solve.

Why only once

“One-time” is not usage advice; it is a hard constraint. Suppose the same key signs two messages with different digests. At any bit position where the two digests differ, the signer has now revealed both secrets of that pair, one in each signature. Combining the two signatures, the attacker can assemble an exponentially growing set of digest patterns as more signatures are issued: sign enough messages and a valid-looking signature on an arbitrary message can be stitched together. With a single use, only one side of each pair is ever exposed and the reduction holds; with a second use, the argument collapses on the spot.

One directional detail is worth noting: verification, which rehashes the revealed values, can check that “the revealed preimages match the public key”, but it cannot constrain the signer — the signer, of course, holds every preimage and could, if willing, reveal preimages for bit combinations beyond the digest actually signed, in effect signing other content. This is not a flaw but a reminder: the unforgeability of a one-time signature is a guarantee against outsiders who do not hold the private key; the key holder’s own behavior lies outside what the cryptography governs and must be constrained by process and audit. Stating the boundary of the guarantee precisely is part of the basic craft this minimal scheme bequeathed to engineering practice.

That is why a Lamport key on its own is nearly unusable — nobody can run a system that rotates keys after every signature. Its value lies not in direct deployment but in the paradigm it set: commit, then reveal bit by bit; gather huge numbers of one-time keys under a single public key with a tree; assemble few-time components into stateless schemes. Four decades of progress in hash-based signatures are, in essence, a series of answers to the question of how to escape the one-time constraint.

Closing

Lamport signatures are the family’s origin point: minimal construction, purest assumption, hardest constraint. The problem they bequeathed is very concrete — how to make one-time keys reusable, scalable and manageable. Merkle trees answer “scalable”, Winternitz chains answer “compact”, XMSS and LMS answer “manageable”, and SLH-DSA answers “what if we drop state altogether” at a very different price. To read this family’s history is to watch those four answers arrive in turn.

Tags: Lamportone-time signatureshash-based signaturesOTS