Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Message Digest and Hash

Functions
Hash Function
• A hash value h is produced by a function H of the form

• h = H(M)
• where M is the variable length message and H (M) is
the fixed length hash value
Hash Function
• A hash function transform an input value of any
arbitrary size to a fixed-size value.

• Input can be of any length but the output produced is


always of a fixed length.

• The output generated is known as hash values or


hashes.
Hash Function
• The general use of hashing is password checking.

• When the user enters the password, the hash of the


password is produced and compared with the hash in
the database.

• If both the hashes are the equal thus the user is


enabled to login else the user required to enter the
password again.
Working of Hash Function
The working of a hash function depends on three main elements.
• Hash function
Functions that create hash codes for senders and receivers to access data files
for transferring are called hash functions.

• Message
Message refers to the data information that is to be transferred.

• Hash code (message digest)


You can consider this as a password that the sender generates and encrypts
within the message to be transferred. The receiver decrypts the code within the
message and generates one separately. If both codes match, message
authentication is received.
Requirements and Security of Hash Function
• Hash function can be used to a block of information of any size.
• H (x) is relatively simply to calculate for any given x, creating both
hardware and software implementation practical.
• For any given value, h, it is computationally impossible to find x such
that H (x) = h. This is defined as one-way property.
• For any given block x, it is computationally impossible to find x’ such
that H (x) = H (x’). This property is defined as weak collision
resistance.
• It is computationally impossible to find some pair (x, y) such that H
(x) = H (y). This property is called a strong collision resistance.
(Two distinct input which hash to same output - Impossible)

You might also like