Cryptographic Hash Functions
Cryptographic Hash Functions
Lecture 17
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
Hash Function
A message digest is as a
``digital fingerprint'' of the
original document
3
Hashing V.S. Encryption
Hello, world. k NhbXBsZSBzZW50ZW5jZS
A sample sentence to E B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
Hello, world. k
NhbXBsZSBzZW50ZW5jZS
A sample sentence to D
B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
Iam#4VKU Iam#4VKU
Password
store
h h
Hash Matching
Exactly?
Password
Yes No
store Deny
Grant
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
Hash Function Usages (I)
Fixed length L
This is a clear text that
can easily read without
52f21cf7c7034a20
using the key. The h
17a21e17e061a863
sentence is longer than
the text above.
Given one message, can’t find another message that has the same message digest. An attack that
finds a second message with the same message digest is a second pre-image attack.
It would be easy to forge new digital signatures from old signatures if the hash function used
weren’t second preimage resistant
Collision Resistant
Can’t find any two different messages with the same message digest
Collision resistance implies second preimage resistance
Collisions, if we could find them, would give signatories a way to repudiate their signatures
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
Two Group of Compression Functions
The compression function is made from scratch
Message Digest
25
MD2, MD4 and MD5
Family of one-way hash functions by Ronald Rivest
All produces 128 bits hash value
MD2: 1989
Optimized for 8 bit computer
Collision found in 1995
MD4: 1990
Full round collision attack found in 1995
MD5: 1992
Specified as Internet standard in RFC 1321
since 1997 it was theoretically not so hard to create a collision
Practical Collision MD5 has been broken since 2004
CA attack published in 2007
MD5 Overview
MD5 Overview
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
Steps in MD5 Algorithm
1. Padding Bits
2. Padding Length
Steps in MD5 Algorithm
3. Initialize MD Buffer
2. Append
length
(64bits)
1. Append padding
bits
(to 448 mod 512)
16 steps
Single step
Advantages of MD5
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
Secure Hash Algorithm
SHA originally designed by NIST & NSA in 1993
revised in 1995 as SHA-1
US standard for use with DSA signature scheme
● standard is FIPS 180-1 1995, also Internet RFC3174
based on design of MD4 with key differences
produces 160-bit hash values
recent 2005 results on security of SHA-1 have raised concerns
on its use in future applications
Revised SHA
NIST issued revision FIPS 180-2 in 2002
adds 3 additional versions of SHA
● SHA-256, SHA-384, SHA-512
designed for compatibility with increased security
provided by the AES cipher
structure & detail is similar to SHA-1
hence analysis should be similar
but security levels are rather higher
SHA Versions
function.
SHA-2 Family vs SHA-256
SHA-2 is an algorithm, a generalized idea of how to hash
data. SHA-2 has several variants, all of which use the
same algorithm but use different constants.
Append a single 1
mutating the hash values h0-h7, which will be the final output.
Step-by-step SHA-256
Step 5 – Create Message Schedule (w)
Step 6 – Compression
What is the number of padding bits if the length of the original message
is 2590 bits?
We can calculate the number of padding bits as follows:
"md5 and sha1 are both clearly broken (in terms of collision-resistance”
Ron Rivest
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
The need of new Hash standard
MD5 should be considered cryptographically broken and
unsuitable for further use, US CERT 2010
In 2004, a collision for the full SHA-0 algorithm was
announced