Hash Functions¶
links: AC1 TOC - Random Oracle & Applications - Modern Cryptography MOC - Index
Hash functions are simply functions that take inputs of some length and compress them into short, fixed-length outputs.
Hash functions can be viewed as lying between the worlds of private- and public-key cryptography, because they have important applications in both settings.
Cryptographic Hash Functions
- a hash function with a fixed output length
- has to be deterministic
- Collision resistant (which implies pre-image- and second-image resistance)
- hash must therefore be a one-way function
Collision Resistance¶
- a function
is collision resistant if it is infeasible for any probabilistic polynomial-time algorithm to find a collision in . - The domain of a hash function is normally larger than their range
in this case collisions must exist, but such collisions should be hard to find.
Keyed hash functions¶
- Keyed hash functions:
takes as input a key and a string and outputs a string the key is generally not kept secret! - Cryptographic hash functions used in practice are generally unkeyed and have a fixed output length
Weaker Notions of Security¶
Second-preimage resistance¶
We have
Preimage resistance¶
Overview of Security Notions¶
Collision resistance implies second-preimage resistance, but does not guarantee preimage resistance
A second-preimage attack implies a collision attack.
Compress Functions¶
Merkle-Damgård Transform¶
- maps inputs of arbitrary length to outputs of length
Davies-Meyer¶
- Davies-Meyer is a compress function from a block cipher
is a strong pseudorandom permutation
Attacks on Hash Functions¶
- in symmetric-key using a
-bit secret key is vulnerable to a brute-force attack in which an attacker enumerates all possible keys - for a hash function
to be collision resistant against attackers running in time it is required that has output at least bits long
Birthday attacks¶
- if
people are in a room, what is the probability that some two of them share a birthday? matching birthdays correspond to collisions - if
has an output length of , yields a collision with probability roughly
Rho Method¶
- algorithm for finding collisions
- unlike the birthday attack, requires only a small amount of memory
- Method: start with a random value
, calculate , then compute , then , ... - Aim: find a cycle/ collision in the evaluation
Universal Hash Function¶
Universal hashes can be extremely cheap to evaluate - much cheaper than block ciphers, pseudorandom functions, and especially collision-resistant hashes. (...) Universal hashing gives us strong guarantees with extremely cheap options
- selecting a hash function at random from a family of hash functions with a certain mathematical property
- Example of universal hash families: GHASH (used in GMAC) or Poly1305
Source: Link
links: AC1 TOC - Random Oracle & Applications - Modern Cryptography MOC - Index