SipHash explained in plain terms means understanding the small keyed hash that stopped attackers from flooding the world’s hash tables, a design from 2012 that turned a denial-of-service trick into a solved problem. The central question is how a hash with only two rounds per block could protect the software the whole internet runs on, and the answer is that SipHash was never trying to be a cryptographic hash at all, it was trying to be fast enough for a hash table and strong enough that no attacker could predict its output, and that narrow job is the whole point of the design.
SipHash is a keyed hash function, or pseudorandom function, designed by Jean-Philippe Aumasson and Daniel J. Bernstein and published in 2012. It turns a message of any length into a short 64-bit fingerprint using a secret 128-bit key, and it is built from a tiny round function of additions, rotations and exclusive-ors, which means the design is small enough to run in a few lines of code, and that smallness is what made it easy to adopt everywhere.
This article makes the case for SipHash, explains what it is, how it works, and where its ideas still earn their keep.
Key takeaways
- SipHash is a keyed hash function from 2012.
- It was designed by Aumasson and Bernstein.
- It produces a 64-bit fingerprint with a 128-bit key.
- It stopped hash-flooding denial-of-service attacks.
- It is used in Python, Rust, Ruby and the Linux kernel.
What SipHash is
SipHash is a hash that turns a key and a message into a short fingerprint, and that fingerprint is what decides where a key lands in a hash table. A program feeds in a string, SipHash mixes it with the secret key, and out comes a 64-bit number, which means two different strings should land in different buckets, and that promise is what keeps a hash table fast.
Its signature feature is the key. Most hashes are public, so anyone can compute them, but SipHash needs a secret key that only the program knows, which means an attacker cannot predict where a string will land, and because the attacker cannot predict the buckets, the flooding trick that once slowed the web to a crawl no longer works.
The design was a reaction to the hash-flooding attacks of 2011. Researchers showed that attackers could craft strings that all collided in a hash table, turning a fast lookup into a slow crawl, so languages and servers needed a hash that attackers could not game, and SipHash answered with a design that was keyed, fast and simple, because a defence nobody adopts is no defence at all.
It became one of the best-known small hashes in the world, and it is named in every history of hash-table security. SipHash was adopted by Python, Ruby, Rust, Perl and the Linux kernel within a few years, it became the default hash in several languages, and it is still the standard answer to flooding, which means the design went from a paper to the infrastructure of the internet in record time.
Its most famous property is the round count in its name. SipHash-2-4 runs two rounds per message block and four rounds at the end, which means the standard version is written as SipHash-2-4, and that small number is the reason it is fast enough for a hash table while still being strong enough to resist prediction.
Our guide to hashing explains the fingerprint idea that SipHash is built on, and our guide to MD4 explains an older unkeyed hash that attackers could predict.
How SipHash works
Everything starts with the key, a 128-bit secret that the program generates once at startup. SipHash splits the key into two 64-bit words and mixes them into a four-word state, which means the state depends on the key from the first step, and because the key is random, the same program produces a different hash layout every time it runs.
Each block begins with the message, which is absorbed eight bytes at a time. The block is xored into the last word of the state, and the round function is then applied twice, which means the message is mixed into the state quickly, and because only two rounds run per block, the design stays fast enough for a hash table.
The round function is what makes the design work as a whole. It adds, rotates and xors the four state words in a fixed pattern known as SipRound, which means a single changed bit in the message fans out across the whole state, and because the pattern repeats, the spreading happens again and again.
The rotation spreads the effect further. Each round rotates the state words by different amounts, which means bits move to new positions on every round, and because the rotations are fixed, the design is easy to implement while still mixing thoroughly.
The finalisation is what turns the state into a fingerprint. After the last block, SipHash runs four more rounds with no new message, then xors the state words together, which means the output depends on the whole message and the whole key, and because the finalisation runs twice as many rounds as the message steps, the ending is stronger than the middle.
The output comes as a single 64-bit word, read out of the final state. SipHash produces one fingerprint per message, which means the result fits in a single machine word, and that size is exactly what a hash table needs to pick a bucket.

Comparing SipHash with other fast hashes
SipHash is one of several fast hashes used in software, and each was built with a different emphasis. MD5 is the old unkeyed hash with a 128-bit digest and no protection against prediction, SHA-256 is the standard cryptographic hash with a 256-bit digest and far more rounds, and SipHash is the one built to be keyed, fast and unpredictable, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | SipHash | MD5 | SHA-256 |
|---|---|---|---|
| Keyed | Yes | No | No |
| Output size | 64 bits | 128 bits | 256 bits |
| Rounds per block | 2 | 64 | 64 |
| Year | 2012 | 1992 | 2001 |
| Best for | Hash tables | Checksums | Standard use |
The practical result is that SipHash is the right choice for hash tables, MD5 suits checksums, and SHA-256 fits standard use instead.
Where SipHash is used
Python uses it to protect dictionaries. The language switched its string hashing to SipHash after the flooding attacks, because a dictionary is a hash table and a hash table is only fast when its buckets are unpredictable, which means every Python program since then has run on SipHash without ever noticing.
Rust uses it as the default hasher. The language’s standard hash map ships with SipHash as its default, because Rust values safety and a keyed hash is the safe choice, and that default is the reason so many Rust programs are protected without any extra work.
Ruby uses it for symbols and strings. The language adopted SipHash for its core hash tables, because web applications in Ruby were among the first targets of flooding attacks, which means the change closed a hole that attackers had already learned to use.
The Linux kernel uses it for network tables. The kernel hashes network addresses and other data with SipHash, because an attacker who can predict a hash table can slow a server, and that protection is the reason the kernel’s tables stay fast under attack.
Teaching uses it as the keyed-hash example. Cryptography courses introduce SipHash when they explain that a hash does not need to be unkeyed, because it is the clearest case of a hash built for speed and unpredictability, and a student who understands SipHash understands why a key changes everything.
Strengths and limits
The greatest strength of SipHash is its adoption. A hash that ships as the default in several major languages protects billions of programs, and that reach is real, measured in the flooding attacks that stopped working and confirmed by the languages that have never switched back.
It is also a strength that the design is tiny. A hash built from a four-word state and a round of additions, rotations and xors is easy to implement, easy to audit and easy to run quickly, and that simplicity is worth more than cleverness in a field where a defence nobody can implement is no defence at all.
The limits are real, though, and the biggest is that it is not a general hash. SipHash produces only 64 bits, which is far too short for signatures or certificates, which means it must never be used where a collision would matter, and its value is entirely in hash tables and similar jobs.
SipHash checklist
- Use SipHash for hash tables, never for signatures.
- Remember it needs a secret 128-bit key.
- Generate a fresh key every time the program starts.
- Compare it with unkeyed hashes to see the flooding risk.
- Note it is SipHash-2-4 by default, two rounds per block.
- Never reuse a key across programs or machines.
- Use a proper random source for every key.
- Check your language already uses a keyed hash by default.
- Choose SHA-256 for any job that needs a real digest.
Frequently asked questions
What is SipHash in simple terms?
It is a small keyed hash from 2012 that turns a message into a 64-bit fingerprint using a secret key, built to be fast enough for a hash table and unpredictable enough to stop flooding attacks.
Who designed SipHash?
Jean-Philippe Aumasson and Daniel J. Bernstein, who published it in 2012 as a direct answer to the hash-flooding denial-of-service attacks shown in 2011.
How is SipHash different from SHA-256?
Both are hashes, but SipHash is keyed, produces only 64 bits, and runs two rounds per block for speed, while SHA-256 is unkeyed, produces 256 bits, and runs sixty-four rounds per block for strength.
Is SipHash still secure?
Yes, for its intended job, no practical attack against SipHash-2-4 has been published, though its 64-bit output makes it unsuitable for anything that needs collision resistance.
Where is SipHash used?
In Python dictionaries, Rust hash maps, Ruby string tables, and the Linux kernel, wherever a hash table needs protection against prediction.
When should I use SipHash?
When you build a hash table, when you need a fast unpredictable fingerprint, or when you want the defence that stopped hash flooding.
The bottom line
SipHash explained in one line is this: the hash that saved the hash table, a 2012 keyed design with two rounds per block that made flooding attacks stop working across the whole internet.
It is proof that a small, focused design can protect the world, and the reason it still matters is that every language written since has been judged partly by the lesson SipHash taught.
This article is general information about how SipHash works, not advice about choosing encryption for a particular device or system.







