L3 Cryptographic Primitives Hash
L3 Cryptographic Primitives Hash
Fixed Length
Message M Hash Function Hash Code h
• Pseudorandom
◦ Being pseudorandom means that the hash value returned by a hash function changes unpredictably when
the input data are changed.
◦ Even if the input data were changed only a little bit, the resulting hash value will differ unpredictably.
◦ It should not be possible to predict the hash value based on the input data
• Collision Resistant
◦ A hash function is called collision resistant if it is very hard to find two or more distinct pieces of input data
for which it yields the identical hash value.
• Hash Value Output : Hexadecimal Number
• Trying It Out Hash Value:
◦ http://www.blockchain-basics.com/HashFunctions.html
• Round2
◦ GG(a,b,c,d,Mj,s,ti) denotes a = b + ((a + G(b,c,d ) + Mj + ti) <<< s)
◦ GG (a, b, c, d, M1, 5, 0xf61e2562) ..... Upto 16steps
• Round3
◦ HH(a,b,c,d,Mj,s,ti) denotes a = b + ((a + H(b,c,d) + Mj + ti) <<< s)
◦ HH (a, b, c, d, M5, 4, 0xfffa3942) ….16steps
• Round4
◦ II(a,b,c,d,Mj,s,ti) denotes a = b + ((a + I(b,c,d ) + Mj + ti) <<< s)
◦ II (a, b, c, d, M0, 6, 0xf4292244) .....16 steps
• Boer & Bosselaers(1993): found a pseudo collision (same message, two different IV’s)
For t=0 to 79
TEMP = (a <<< 5) + ft(b,c,d) + e + Wt + Kt
e=d
d=c
c=b <<< 30
b=a
a = TEMP
• “Each step now has unique additive constant” True for SHA where it reuses the constants for each group of
20 rounds
• “Faster avalanche effect” True for SHA. Addition of fifth variable to make Boer-Bosselaers attack against
MD5 impossible against SHA.
• “The left circular shift… to yield faster avalanche effect.” SHA uses a constant shift amount in each round.
This amount is relatively prime to the word size, as in MD4
• SHA is MD4 with the addition of an expand transformation, an extra round, and better avalanche effect;
MD5 is MD4 with improved bit hashing, an extra round, and better avalanche effect