Fast cryptographically secure pseudorandom function designed for hash tables and data structures requiring collision resistance.
| Property | Value |
|---|---|
| Category | Hash Functions |
| Sub-category | MAC/PRF |
| Security status | 🎓 Educational Only |
| Complexity | Not specified |
| Inventor | Jean-Philippe Aumasson, Daniel J. Bernstein |
| Year | 2012 |
| Origin | 🌐 International |
| Source | algorithms/hash/siphash.js |
| Parameter | Supported values |
|---|---|
| Output sizes | 8 bytes (64 bits) |
Status: 🎓 Educational Only
| Issue | Description | Mitigation |
|---|---|---|
| Key Management | Security depends on secret key - key reuse or weak keys reduce security | Use strong random 128-bit keys, rotate keys periodically |
7 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 — vectors.h entry 0 - empty message
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
(empty) |
expected |
310e0edd47db6f72 |
Vector 2 — vectors.h entry 1 - one byte
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
00 |
expected |
fd67dc93c539f874 |
Vector 3 — vectors.h entry 7 - one byte under the 8-byte block
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
00010203040506 |
expected |
37d1018bf50002ab |
Vector 4 — vectors.h entry 8 - exactly one block
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
0001020304050607 |
expected |
6224939a79f5f593 |
Vector 5 — vectors.h entry 9 - one byte over a block
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
000102030405060708 |
expected |
b0e4a90bdf82009e |
Vector 6 — vectors.h entry 16 - two whole blocks
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
000102030405060708090a0b0c0d0e0f |
expected |
db9bc2577fcc2a3f |
Vector 7 — vectors.h entry 63 - 63 bytes
| Field | Value |
|---|---|
key |
000102030405060708090a0b0c0d0e0f |
input |
000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e |
expected |
724506eb4c328a95 |