Hash-based signatures

On this page 8

Hash-based signatures are digital signature schemes whose security depends only on the properties of a cryptographic hash function, such as preimage resistance and second-preimage resistance. In quantum security, they are valued as the most conservative post-quantum option, because no known quantum algorithm breaks a well-designed hash function; Grover’s algorithm only gives a quadratic speedup, which larger output sizes absorb.

The family includes stateful schemes such as XMSS and LMS, standardized for firmware and code signing, and the stateless scheme SLH-DSA (derived from SPHINCS+), published by NIST in FIPS 205. Together they offer a fallback that does not rely on lattice or other structured mathematical assumptions, which makes them central to many quantum-safe migration plans in quantum computing.

How hash-based signatures are built from one-time keys

Every hash-based signature scheme starts from a one-time signature (OTS), a key pair that may sign exactly one message. The classic Lamport scheme publishes hashes of random secret values and reveals a subset of those secrets according to the bits of the message digest. Modern schemes use the Winternitz OTS (WOTS or WOTS+), which signs several bits at once by iterating a hash chain and trades signature size against computation.

Because a one-time key becomes insecure after a second use, many OTS public keys are combined in a Merkle tree. Each leaf is the hash of one OTS public key, and the tree root becomes the long-term public key. A signature then contains the OTS signature plus an authentication path, the sibling hashes a verifier needs to recompute the root.

The table below summarizes the building blocks and the role each one plays in the final scheme.

ComponentRoleSecurity note
Lamport OTSSigns one message bit by bitVery large signatures
Winternitz OTSSigns groups of bits with hash chainsParameter w trades size for speed
Merkle treeAggregates many OTS keys under one rootHeight fixes the signature capacity
HypertreeStacks trees so upper trees sign lower rootsEnables very large capacities
FORS or HORSTFew-time signature for message digestsTolerates limited key reuse
Core components of hash-based signature schemes

Stateful and stateless hash-based schemes

The decisive design split is whether the signer must keep state, meaning a record of which one-time keys have already been used. Stateful schemes such as XMSS (RFC 8391) and LMS with its multi-tree variant HSS (RFC 8554) produce compact signatures, but they fail catastrophically if a leaf index is ever reused, for example after a backup restore or a virtual machine clone.

Stateless schemes remove that risk by selecting the signing leaf pseudorandomly from a very large hypertree and by using a few-time signature at the bottom layer, so an accidental collision of indexes does not leak the key. The price is much larger signatures and slower signing. NIST SP 800-208 covers the stateful schemes, while FIPS 205 standardizes SLH-DSA.

The following comparison shows how the main standardized variants differ in practice.

SchemeState requiredTypical signature sizeMain standard
XMSS / XMSS^MTYesAbout 2.5 to 10 KBRFC 8391, SP 800-208
LMS / HSSYesAbout 1.5 to 9 KBRFC 8554, SP 800-208
SLH-DSA small (s)NoAbout 7.8 to 30 KBFIPS 205
SLH-DSA fast (f)NoAbout 17 to 50 KBFIPS 205
Standardized hash-based signature schemes

Public keys stay remarkably small in every variant, typically 32 to 64 bytes, because they are only a tree root plus a seed. This is the reverse of the lattice-based profile, where keys are larger and signatures shorter.

Why hash-based signatures resist quantum attacks

Shor’s algorithm breaks RSA and elliptic-curve signatures because they rest on factoring and discrete logarithms, problems with hidden algebraic structure. Hash functions have no comparable structure, so the best known quantum attack is generic search. Grover’s algorithm reduces a preimage search from 2^n to roughly 2^(n/2) operations, and collision search gains even less in realistic cost models.

Designers therefore choose hash outputs of 256 bits or more for the highest security categories, which keeps the quantum work factor far beyond reach. The resulting security proofs reduce forgery to well-studied hash properties, which is why cryptographers describe hash-based signatures as having the smallest set of assumptions among post-quantum candidates.

How they compare with other post-quantum signatures

Hash-based signatures sit alongside ML-DSA and FN-DSA, the lattice-based NIST signature standards. The comparison below explains why organizations often deploy more than one family.

PropertyHash-based (SLH-DSA)Lattice-based (ML-DSA)Lattice-based (FN-DSA)
Security assumptionHash function properties onlyModule lattice problemsNTRU lattice problems
Public key size32 to 64 bytesAbout 1.3 to 2.6 KBAbout 0.9 to 1.8 KB
Signature sizeAbout 7.8 to 50 KBAbout 2.4 to 4.6 KBAbout 0.7 to 1.3 KB
Signing speedSlowFastFast but complex
Implementation riskLow arithmetic complexityModerateFloating-point sampling is delicate
Post-quantum signature families compared

The practical conclusion is that hash-based schemes are rarely the default for high-volume protocols such as TLS, but they are the preferred hedge where long validity and minimal assumptions matter more than bandwidth.

Where hash-based signatures fit in quantum-safe migration

Hash-based signatures are best suited to firmware, boot loaders and software updates, where signatures are verified often but created rarely and where devices may remain in service for decades. CNSA 2.0 explicitly lists LMS and XMSS for software and firmware signing and sets early adoption deadlines for that use case.

The decision table below maps common situations to a suitable choice.

SituationRecommended choiceReason
Secure boot in hardwareLMS or XMSSSmall signatures, controlled signer state
Distributed signing serversSLH-DSANo risk of state reuse across nodes
Long-term root certificatesSLH-DSAMinimal assumptions for decades of validity
High-volume TLS handshakesLattice scheme insteadHash-based signatures are too large
Choosing a hash-based scheme

Limitations and common mistakes

The most serious operational failure is state reuse in stateful schemes, which can allow an attacker to forge signatures after observing two signatures from the same leaf. Other weaknesses are practical rather than mathematical.

  • Finite capacity: a stateful key can sign only 2^h messages, so tree height must match the expected lifetime.
  • Large signatures: SLH-DSA signatures can exceed certificate and packet size limits in constrained protocols.
  • Slow signing: stateless signing may take tens to hundreds of milliseconds on ordinary hardware.
  • Backup hazards: restoring an old key file silently rewinds the state counter.
  • Side channels: hash implementations still need protection against fault and timing attacks.

Stripped to the essentials

A digital signature proves who signed a file. Today most signatures rely on math puzzles that a large quantum computer could solve. Hash-based signatures avoid those puzzles. They rely only on hash functions, which turn any data into a short fingerprint that cannot be reversed.

Think of a book of single-use seals. Each seal works once. A master stamp on the cover proves that every seal came from the same book. The catch is simple. Never use the same seal twice, and accept that the seals are bulky. In return, you get protection that quantum computers are not expected to break.

Where it is applied

A manufacturer of industrial control units expects its devices to stay in the field for 20 to 25 years, long enough that a cryptographically relevant quantum computer may appear during their service life. The engineering team replaces the RSA key used for secure boot with an LMS key whose tree height of 20 allows about one million firmware signatures.

The private key lives in a hardware security module that increments the leaf counter before releasing each signature, so a restore cannot reuse an index. Each firmware image gains roughly 2.5 KB of signature data, which the boot ROM verifies in a few milliseconds. The result is a firmware chain of trust that remains valid after the arrival of quantum attacks, with no dependence on lattice assumptions that are still being studied.