encyclopegia.org

SipHash

SipHash is an add–rotate–xor (ARX) based family of pseudorandom functions created by Jean-Philippe Aumasson and Daniel J.[src] Bernstein in 2012, in response to a spate of "hash flooding" denial-of-service attacks (HashDoS) in late 2011.[src] SipHash is designed as a secure pseudorandom function and can also be used as a secure message authentication code (MAC).[src] SipHash, however, is not a general purpose key-less hash function such as Secure Hash Algorithms (SHA) and therefore must always be used with a secret key in order to be secure.[src] That is, SHA is designed so that it is difficult for an attacker to find two messages X and Y such that SHA(X) = SHA(Y), even though anyone may compute SHA(X).[src] SipHash instead guarantees that, having seen X i and SipHash(X i , k), an attacker who does not know the key k cannot find (any information about) k or SipHash(Y, k) for any message Y ∉ {X i } which they have not seen before.[src]

SipHash is an add–rotate–xor (ARX) based family of pseudorandom functions created by Jean-Philippe Aumasson and Daniel J.[src] Bernstein in 2012, in response to a spate of "hash flooding" denial-of-service attacks (HashDoS) in late 2011.[src] SipHash is designed as a secure pseudorandom function and can also be used as a secure message authentication code (MAC).[src] SipHash, however, is not a general purpose key-less hash function such as Secure Hash Algorithms (SHA) and therefore must always be used with a secret key in order to be secure.[src] That is, SHA is designed so that it is difficult for an attacker to find two messages X and Y such that SHA(X) = SHA(Y), even though anyone may compute SHA(X).[src] SipHash instead guarantees that, having seen X i and SipHash(X i , k), an attacker who does not know the key k cannot find (any information about) k or SipHash(Y, k) for any message Y ∉ {X i } which they have not seen before.[src] ==Overview== SipHash computes a 64-bit message authentication code from a variable-length message and 128-bit secret key.[src] It was designed to be efficient even for short inputs, with performance comparable to non-cryptographic hash functions, such as CityHash; this can be used to prevent denial-of-service attacks against hash tables ("hash flooding"), or to authenticate network packets.[src] A variant was later added which produces a 128-bit result.[src] An unkeyed hash function such as SHA is collision-resistant only if the entire output is used.[src] If used to generate a small output, such as an index into a hash table of practical size, then no algorithm can prevent collisions; an attacker need only make as many attempts as there are possible outputs.[src] For example, suppose a network server is designed to be able to handle up to a million requests at once.[src] It keeps track of incoming requests in a hash table with two million entries, using a hash function to map identifying information from each request to one of the two million possible table entries.[src] An attacker who knows the hash function need only feed it arbitrary inputs; one out of two million will have a specific hash value.[src] If the attacker now sends a few hundred requests all chosen to have the same hash value to the server, that will produce a large number of hash collisions, slowing (or possibly stopping) the server with an effect similar to a packet flood of many million requests.[src] By using a key unknown to the attacker, a keyed hash function like SipHash prevents this sort of attack.[src] While it is possible to add a key to an unkeyed hash function (HMAC is a popular technique), SipHash is much more efficient.[src] Functions in SipHash family are specified as SipHash-c-d, where c is the number of rounds per message block and d is the number of finalization rounds.[src] The recommended parameters are SipHash-2-4 for best performance, and SipHash-4-8 for conservative security.[src] A few languages use SipHash-1-3 for performance at the risk of yet-unknown DoS attacks.[src] The reference implementation was released as public domain-like software under the CC0.[src] ==Usage== SipHash is used in hash table implementations of various software: Programming languages JavaScript Node.js V8 (JavaScript engine) (available as a compile-time option) OCaml Perl 5 (available as a compile time option) Python (starting in version 3.4, SipHash 1-3 since 3.11 ) Raku Ruby (SipHash 1-3) Swift Rust Operating systems Linux systemd OpenBSD FreeBSD OpenDNS WireGuard The following programs use SipHash in other ways: Bitcoin for short transaction IDs Bloomberg BDE as a C++ object hasher InterPlanetary File System (IPFS) for its seven Bloom filter hashes Implementations C (reference implementation) C++ (Wassenberg & Alakuijala 2017, part of their "highwayhash" work) C# Common Lisp Crypto++ Go Haskell JavaScript PicoLisp Rust Swift Verilog VHDL ==See also== Bloom filter (application for fast hashes) Cryptographic hash function Hash function Message authentication code List of hash functions ==References== ==External links== – describes when SipHash is not fast enough[src]

28 sentences · 28 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"SipHash." encyclopegia.org, 2026, https://encyclopegia.org/wiki/siphash. Accessed 25 November 2026.

Chicago

"SipHash." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/siphash.

APA

encyclopegia.org. (2026). SipHash. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/siphash

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1332741595 · 0.5 · snapshot enwiki-001332741595

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.