Crytpographic Hash Functions
Crytpographic Hash Functions
Security
Cryptographic Hash
Functions
Sejal Chopra
Assistant Professor - Dept. of Computer Engineering
Don Bosco Institute of Technology, Mumbai
Contents to be discussed
• Introduction
• Properties of Secure Hash Function
• MD5
• SHA-1
• MAC
• HMAC
• CMAC
Cryptographic Hash Functions-
Introduction
It is a function that takes arbitrary-sized data and maps it to a fixed-size integer
value.
Cryptographic Hash Functions-
Introduction
• A hash function H accepts a variable-length block of data M as input
and produces a fixed-size hash value h = H(M).
• A “good” hash function has the property that the results of applying
the function to a large set of inputs will produce outputs that are
evenly distributed and apparently random.
• In general terms, the principal object of a hash function is data
integrity. A change to any bit or bits in M results, with high probability,
in a change to the hash value.
• The kind of hash function needed for security applications is referred
to as a cryptographic hash function.
• A cryptographic hash function is an algorithm for which it is
computationally infeasible (because no attack is significantly more
efficient than brute force) to find either
a data object that maps to a pre-specified hash result (the one-way
property) or
two data objects that map to the same hash result (the collision-free
property).
• Because of these characteristics, hash functions are often used to
determine whether or not data has changed.
Cryptographic Hash Functions-
Introduction
Typically, the input is padded out to an integer multiple of some fixed length
(e.g., 1024 bits), and the padding includes the value of the length of the
original message in bits.
The length field is a security measure to increase the difficulty for an
attacker to produce an alternative message with the same hash value.
Properties of Secure Hash Function
• Determinism: A hash function is deterministic, meaning a given input
will always produce the same output.
5.Output:
After processing of all 512-bit blocks with the algorithm, the message
digest of n-bit message is in A, B, C and D. The lower order byte of A
represents the first byte of MD5 output. The higher order byte of D
represents the last byte of MD5 output.
SHA-1 algorithm
SHA-1 or Secure Hash Algorithm 1 is a cryptographic algorithm
which takes an input and produces a 160-bit (20-byte) hash value.
This hash value is known as a message digest. This message
digest is usually then rendered as a hexadecimal number which is
40 digits long.
Working of SHA-1 algorithm
Working of SHA-1 algorithm
Working of SHA-1 algorithm
Working of SHA-1 algorithm
Comparison of various SHA
algorithms
Message Authentication Code (MAC)
Message Authentication Code (MAC)
HMAC (Hashed Based MAC)
HMAC
CMAC (Cipher Based MAC)
CMAC
References