VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
Hash Function
1. Hash Function
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
2. Hash Functions
Goal: To provide a unique “fingerprint” of the message.
properties:
1. Fast to compute y from m.
2. One-way: given y = h(m), can’t find any m’ satisfying h(m’) = y
easily.
3. Strongly collision-free: Can’t find any m1 != m2 such that
h(m1)=h(m2)
Message m
(long)
Message digest, y
(Shorter fixed length)Cryptographic hash
Function, h
3. Easy Hash Algorithm
Break m into n-bit blocks, append zeros to get a multiple
of n.
There are L of them, where L =|m|/n
Fast But not very secure.
=
=
ln21
22221
11211
2
1
...
mmm
mmm
mmm
m
m
m
m
ll
n
n
l
[ ]nccc ...21
⇓⇓⇓⇓
⊕⊕⊕⊕
ymm ii ↵=′
5. SHA-1: Iterative compression
Iterate over all of the L blocks, output a value that is a
function of the last output and the latest block:
m1
m2
X0 X1
X2
h’ h’
m3
X3
h’
mL
XL
h’
3
(X0 is constant)
6. SHA-1: Iterative compression
Repeat L times until we have compressed the whole message
into a single 160-bit vector.
m1
m2
X0 X1
X2
h’ h’
m3
X3
h’
mL
XL
h’
=h(m)
7. SHA-1: Iterative compression
Repeat L times until we have compressed the whole message
into a single 160-bit vector.
m1
m2
X0 X1
X2
h’ h’
m3
X3
h’
mL
XL
h’
=h(m)