All Projects → veorq → Siphash

veorq / Siphash

Licence: cc0-1.0
High-speed secure pseudorandom function for short messages

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Siphash

Securitydriven.inferno
✅ .NET crypto done right. Professionally audited.
Stars: ✭ 501 (+51.36%)
Mutual labels:  mac, cryptography
Macapps
分享个人收集的Mac的App,持续更新中...
Stars: ✭ 311 (-6.04%)
Mutual labels:  mac
Frameworks
Sample code and build environments for MPC frameworks
Stars: ✭ 288 (-12.99%)
Mutual labels:  cryptography
Mouse Finder
🖱👀 An NSDockTile experiment
Stars: ✭ 303 (-8.46%)
Mutual labels:  mac
Macdriver
Native Mac APIs for Go
Stars: ✭ 3,582 (+982.18%)
Mutual labels:  mac
Ctf Challenges By Me
Pwnable|Web Security|Cryptography CTF-style challenges
Stars: ✭ 305 (-7.85%)
Mutual labels:  cryptography
Kremlin
KreMLin is a tool for extracting low-level F* programs to readable C code
Stars: ✭ 285 (-13.9%)
Mutual labels:  cryptography
Notable
The Markdown-based note-taking app that doesn't suck.
Stars: ✭ 18,866 (+5599.7%)
Mutual labels:  mac
Munkiadmin
macOS app for managing Munki repositories
Stars: ✭ 310 (-6.34%)
Mutual labels:  mac
Mac Dev Playbook
Mac setup and configuration via Ansible.
Stars: ✭ 4,202 (+1169.49%)
Mutual labels:  mac
Lightning Onion
Onion Routed Micropayments for the Lightning Network
Stars: ✭ 297 (-10.27%)
Mutual labels:  cryptography
Im Select
Switch your input method through terminal 📟
Stars: ✭ 288 (-12.99%)
Mutual labels:  mac
Sapient
Secure API Toolkit
Stars: ✭ 308 (-6.95%)
Mutual labels:  cryptography
Awesome Cryptography
A curated list of cryptography resources and links.
Stars: ✭ 3,475 (+949.85%)
Mutual labels:  cryptography
Glorious Demo
The easiest way to demonstrate your code in action.
Stars: ✭ 3,290 (+893.96%)
Mutual labels:  mac
Privatebin
A minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.
Stars: ✭ 3,622 (+994.26%)
Mutual labels:  cryptography
K8s For Docker Desktop
为Docker Desktop for Mac/Windows开启Kubernetes和Istio。
Stars: ✭ 3,863 (+1067.07%)
Mutual labels:  mac
Webfs
A Filesystem Built On Top of the Web.
Stars: ✭ 307 (-7.25%)
Mutual labels:  cryptography
Drand
🎲 A Distributed Randomness Beacon Daemon - Go implementation
Stars: ✭ 328 (-0.91%)
Mutual labels:  cryptography
Mpv Easy Player
MPV-EASY Player - A movie player based on mpv
Stars: ✭ 324 (-2.11%)
Mutual labels:  mac

SipHash

License: CC0-1.0

SipHash is a family of pseudorandom functions (PRFs) optimized for speed on short messages. This is the reference C code of SipHash: portable, simple, optimized for clarify and debugging.

SipHash was designed in 2012 by Jean-Philippe Aumasson and Daniel J. Bernstein as a defense against hash-flooding DoS attacks.

SipHash is:

  • Simpler and faster on short messages than previous cryptographic algorithms, such as MACs based on universal hashing.

  • Competitive in performance with insecure non-cryptographic algorithms, such as fhhash.

  • Cryptographically secure, with no sign of weakness despite multiple cryptanalysis projects by leading cryptographers.

  • Battle-tested, with successful integration in OSs (Linux kernel, OpenBSD, FreeBSD), languages (Perl, Python, Ruby, etc.), libraries (OpenSSL libcrypto, Sodium, etc.) and applications (Wireguard, Redis, etc.).

As a secure pseudorandom function (a.k.a. keyed hash function), SipHash can also be used as a secure message authentication code (MAC). But SipHash is not a hash in the sense of general-purpose key-less hash function such as BLAKE3 or SHA-3. SipHash should therefore always be used with a secret key in order to be secure.

Variants

The default SipHash is SipHash-2-4: it takes a 128-bit key, does 2 compression rounds, 4 finalization rounds, and returns a 64-bit tag.

Variants can use a different number of rounds. For example, we proposed SipHash-4-8 as a conservative version.

The following versions are not described in the paper but were designed and analyzed to fulfill applications' needs:

  • SipHash-128 returns a 128-bit tag instead of 64-bit. Versions with specified number of rounds are SipHash-2-4-128, SipHash4-8-128, and so on.

  • HalfSipHash works with 32-bit words instead of 64-bit, takes a 64-bit key, and returns 32-bit or 64-bit tags. For example, HalfSipHash-2-4-32 has 2 compression rounds, 4 finalization rounds, and returns a 32-bit tag.

Security

(Half)SipHash-c-d with c ≥ 2 and d ≥ 4 is expected to provide the maximum PRF security for any function with the same key and output size.

The standard PRF security goal allow the attacker access to the output of SipHash on messages chosen adaptively by the attacker.

Security is limited by the key size (128 bits). Attackers searching 2s keys have chance 2s−128 of finding the SipHash key. Security is also limited by the output size. In particular, when SipHash is used as a MAC, an attacker who blindly tries 2s tags will succeed with probability 2s-t, if t is that tag's bit size.

Research

  • Research paper "SipHash: a fast short-input PRF" (accepted at INDOCRYPT 2012)
  • Slides of the presentation of SipHash at INDOCRYPT 2012 (Bernstein)
  • Slides of the presentation of SipHash at the DIAC workshop (Aumasson)

Usage

Running

  make

will build tests for

  • SipHash-2-4-64
  • SipHash-2-4-128
  • HalfSipHash-2-4-32
  • HalfSipHash-2-4-64
  ./test

verifies 64 test vectors, and

  ./debug

does the same and prints intermediate values.

The code can be adapted to implement SipHash-c-d, the version of SipHash with c compression rounds and d finalization rounds, by defining cROUNDS or dROUNDS when compiling. This can be done with -D command line arguments to many compilers such as below.

gcc -Wall --std=c99 -DcROUNDS=2 -DdROUNDS=4 siphash.c halfsiphash.c test.c -o test

The makefile also takes c and d rounds values as parameters.

make cROUNDS=2 dROUNDS=4

Obviously, if the number of rounds is modified then the test vectors won't verify.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].