Cryptographic Hash Functions
Cryptographic Hash Functions
Cryptographic Hash Functions
2. Iterate it
M1 M2 ML-1 ML
IV=d0
h
d1
h
d2
h
dL-1
h
dL
d=H(M)
What are they good for?
Modern, collision resistant hash functions were designed to create
small, fixed size message digests so that a digest could act as a
proxy for a possibly very large variable length message in a digital
signature algorithm, such as RSA or DSA. These hash functions
have since been widely used for many other ancillary applications,
including hash-based message authentication codes, pseudo
random number generators, and key derivation functions.
M =(M1,,ML) RMX r
(r, M1r,,,MLr)
HASH HASH
TCR
X
SIGN SIGN
Application 2:
Message authentication
Sender, Receiver, share a secret key
Compute an authentication tag
tag = MAC(key, M)
Sender sends (M, tag)
Receiver verifies that tag matches M
Attacker cannot forge tags without key
Authentication with HMAC
[Bellare-Canetti-Krawczyk 1996]
h
Then for any prefix P d1,4 h
Find linking block L s.t. H(P|L) in the tree
Takes ~ 22n/3 time
Read off the tree the suffix S to get to d
Show an extension of P s.t. H(P|L|S) = d
The culprit: small intermediate state
With a compression function, we:
Work hard on current message block
Throw away this work, keep only n-bit state
Alternative: keep a large state
Work hard on current message block/word
Update some part of the big state
More flexible approach
Also more opportunities to mess things up
The hash function Grindahl
[Knudsen-Rechberger-Thomsen 2007]
Proof-driven design
Designed to enable analysis
Proofs that Peyrin-style attacks do not work
State of 30 4-byte words = 120 bytes
Two super-mixing rounds per word of input
Each applied to only 16 bytes of the state
With some extra linear diffusion
Super-mixing is AES-like
But uses stronger MDS codes
Fugue-256
Initial State (30 words)
Process M1
New State
Iterate Mi
State
Final Processing
D State = 0? D State = 0
Internal collision
D State 0
Final Processing External collision
D=0
Processing one input word
Initial State (30 words)
* a bit oversimplified
Analyzing internal collisions*
D25-10 3 columns
D28-40
D28-40 4SMIX
nonzero byte diffs
now D28-10 3 columns
still D1-40
before SMIX: D1-40 SMIX
before input word: D10 D
after input word: DState=0
* a bit oversimplified
Analyzing internal collisions*
before input: D1=?, D25-300 D
D25-10 3 columns
D28-40
D28-40 SMIX
now D28-10 3 columns
still D1-40
before SMIX: D1-40 SMIX
before input word: D10 D
after input word: DState=0
* a bit oversimplified
Many nonzero byte
differences before
the SMIX operations
The analysis
from previous
slides was
upto here
Analyzing internal collisions
What does this mean? Consider this attack:
Attacker feeds in random M1,M2, and M1,M2,
Until StateL StateL = some good D
Then it searches for suffixed (ML+1,,ML+4),
(ML+1,,ML+4) that will induce internal collision