SequenceHash prevents ambiguous multihash encodings across any hash function
SequenceHash and SequenceMAC provide secure, hash-agnostic multihashing with unambiguous encoding and length-extension protection for any underlying hash function.
Crypto & theory Trail of Bits 2 Oct 2026 Method Prototype evidence
Published as “SequenceHash: multihashing for the rest of us”
Why it matters
SequenceHash offers a practical, hash-agnostic way to avoid common multihashing pitfalls, potentially simplifying protocol design and implementation.
Summary
The blog introduces SequenceHash and its keyed variant SequenceMAC, hash-agnostic constructions that encode each input with a fixed-length 128-bit length suffix and apply a double-hash to prevent length-extension attacks. They claim the designs guarantee that no other sequence of inputs can produce the same underlying hash input, and that customization strings provide domain separation. Implementations in Rust, Go, and Python with extensive test vectors are released, but no formal security proof or performance evaluation is presented.
What they found 1
- SequenceMAC incorporates key length to prevent HMAC-style long-key pseudocollisions
“The keyed variant of SequenceHash, SequenceMAC, incorporates key lengths into a header block that is part of the hash.”
Caveats 6
- SequenceHash and SequenceMAC rely on the security of the underlying hash for their own security.
- The authors have not defined a SequenceXOF variant and admit no answer yet for extensible output functions.
- Security depends on the chosen underlying hash; insecure hashes like MD4 remain insecure.
- No formal security proof or extensive performance benchmarking is provided.
- SequenceXOF is not specified, limiting use with extensible-output functions.
- Correct input encoding across different systems (e.g., JSON field ordering) remains the developer’s responsibility.
What’s new here 4
- Hash-agnostic multihashing that works with SHA-2, BLAKE, RIPEMD, etc.
- Fixed 128-bit length-suffix encoding enabling streaming APIs.
- Double-hash construction for built-in length-extension resistance.
- Optional customization strings for domain separation and a keyed mode (SequenceMAC) that embeds key length to avoid HMAC key pseudocollisions.