Unit-4-Cryptographic Hash Functions
Unit-4-Cryptographic Hash Functions
UNIT-IV:
Cryptographic Hash Functions
A message digest is as a
``digital fingerprint'' of the
original document
2
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 (Symmetric Key Cryptosystem)
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.
20
Little and Big Endian Mystery
Little and big endian are two ways of storing multibyte data-types ( int, float,
etc).
In little endian machines, last byte of binary representation of the multibyte
data-type is stored first.
In big endian machines, first byte of binary representation of the multibyte
data-type is stored first.
Suppose integer is stored as 4 bytes (For those who are using DOS-based
compilers such as C++ 3.0, integer is 2 bytes) then a variable x with value
0x01234567 will be stored as following.
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
2. Append
length
(64bits)
1. Append padding
bits
(to 448 mod 512)
16 steps
M [q*16+k] = the kth 32-bit word from the qth 512-bit block of the msg
Single step
Working of the MD5 Algorithm:
MD5 algorithm follows the following steps
Append Padding Bits: In the first step, we add padding bits in the original
message in such a way that the total length of the message is 64 bits less than the
exact multiple of 512.
Suppose we are given a message of 1000 bits. Now we have to add padding bits
to the original message. Here we will add 472 padding bits to the original
message. After adding the padding bits the size of the original message/output of
the first step will be 1472 i.e. 64 bits less than an exact multiple of 512 (i.e. 512*3 =
1536).
Length(original message + padding bits) = 512 * i – 64 where i = 1,2,3 . . .
Initialize MD buffer: Here, we use the 4 buffers i.e. J, K, L,
and M. The size of each buffer is 32 bits.
- J = 0x67425301
- K = 0xEDFCBA45
- L = 0x98CBADFE
- M = 0x13DCE476