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.
| Component | Role | Security note |
|---|---|---|
| Lamport OTS | Signs one message bit by bit | Very large signatures |
| Winternitz OTS | Signs groups of bits with hash chains | Parameter w trades size for speed |
| Merkle tree | Aggregates many OTS keys under one root | Height fixes the signature capacity |
| Hypertree | Stacks trees so upper trees sign lower roots | Enables very large capacities |
| FORS or HORST | Few-time signature for message digests | Tolerates limited key reuse |
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.
| Scheme | State required | Typical signature size | Main standard |
|---|---|---|---|
| XMSS / XMSS^MT | Yes | About 2.5 to 10 KB | RFC 8391, SP 800-208 |
| LMS / HSS | Yes | About 1.5 to 9 KB | RFC 8554, SP 800-208 |
| SLH-DSA small (s) | No | About 7.8 to 30 KB | FIPS 205 |
| SLH-DSA fast (f) | No | About 17 to 50 KB | FIPS 205 |
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.
| Property | Hash-based (SLH-DSA) | Lattice-based (ML-DSA) | Lattice-based (FN-DSA) |
|---|---|---|---|
| Security assumption | Hash function properties only | Module lattice problems | NTRU lattice problems |
| Public key size | 32 to 64 bytes | About 1.3 to 2.6 KB | About 0.9 to 1.8 KB |
| Signature size | About 7.8 to 50 KB | About 2.4 to 4.6 KB | About 0.7 to 1.3 KB |
| Signing speed | Slow | Fast | Fast but complex |
| Implementation risk | Low arithmetic complexity | Moderate | Floating-point sampling is delicate |
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.
| Situation | Recommended choice | Reason |
|---|---|---|
| Secure boot in hardware | LMS or XMSS | Small signatures, controlled signer state |
| Distributed signing servers | SLH-DSA | No risk of state reuse across nodes |
| Long-term root certificates | SLH-DSA | Minimal assumptions for decades of validity |
| High-volume TLS handshakes | Lattice scheme instead | Hash-based signatures are too large |
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.