hash-flooding defense · Python · Rust · keyed

SipHash calculator

SipHash-2-4 — a keyed hash designed to resist hash-flooding DoS attacks. Uses a 128-bit secret key. Used for hash tables in Python, Rust, Redis, and many language runtimes. Pure JavaScript.

0 chars
SipHash-2-4
 

How to use this tool

  1. Enter a 128-bit key into the Key (hex) field — the default 0102030405060708090a0b0c0d0e0f10 works for quick testing.
  2. Type or paste text into the Input text box — the SipHash-2-4 digest appears instantly in the output box below.
  3. Hit Copy to copy the 16-character hex digest to your clipboard.
  4. Change the key to see the digest change completely for the exact same input.
  5. Use Clear any time to reset the input and recompute.

Why this tool is helpful

Verify runtime hashing

Python, Rust, and Redis use SipHash for hash-table keys. Reproduce the same values here to confirm how your language's runtime hashes a string.

Understand hash-flooding defense

See why a secret, per-process key stops attackers from predicting collisions and triggering worst-case hash-table performance.

Generate reference digests

Produce expected SipHash-2-4 outputs for a known key to use in unit tests or cross-check a library implementation.

Experiment with keys

Flip a single key character and watch the digest scramble — a quick feel for the avalanche effect in keyed hashing.

Learn the algorithm

SipHash-2-4 runs 2 compression rounds per 8-byte block plus 4 finalization rounds. This tool makes that pipeline tangible.

Stay private

Everything runs in your browser. Nothing is uploaded, logged, or sent to a server — safe for sensitive payloads and keys.

FAQ

What is SipHash-2-4?

SipHash is a keyed hash function (a pseudo-random function) that maps a message to a 64-bit digest using a 128-bit secret key. The -2-4 variant is the most common and is used for hash tables in Python, Rust, Redis, and others.

What do the "2" and "4" stand for?

They are the round counts: 2 compression rounds per 8-byte message block and 4 finalization rounds at the end. More rounds mean more work but stronger diffusion.

Why does it need a secret key?

The key prevents attackers from precomputing colliding inputs. Hash tables seed themselves with a random key so an adversary can't craft many strings that land in the same bucket — the classic "hash-flooding" denial-of-service attack.

What format should the key be in?

A hex string of up to 32 characters (128 bits), like the default 0102030405060708090a0b0c0d0e0f10. Shorter keys are zero-padded on the right, and non-hex characters will cause an error. Clearing the key falls back to the default.

Why is the digest always 16 hex characters?

SipHash always outputs 64 bits, and each byte renders as two hex digits — so the result is always 16 characters, regardless of input length.

Is SipHash a cryptographic hash like SHA-256?

Not in the same sense. SipHash is a keyed PRF (it can authenticate data like a MAC), but its 64-bit output is far too short for general collision resistance. It's designed for hash tables and short tags, not for unkeyed hashing.

Does any of my data leave my browser?

Never. All computation happens locally in JavaScript. Your input and key are not sent to, stored on, or logged by any server.