Updated Hash Function
Updated Hash Function
There are several ways to authenticate messages in cryptography. Three main ways are
Message encryption.
Hash functions.
Hash Functions
Hash functions in cryptography are used to create authentic and confidential messages.
Hash Functions in cryptography generate a code to check the message's authenticity. In
layman's language, we say that any document is hashed (passes through a hash function) to
develop a hash value(code) using a hash function in cryptography.
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.
We again use a hash function when the message is received to generate a hash code.
A few essential properties of hash functions are crucial for the security of hash functions in
cryptography.
These are as follows:
Just as we need goals in life to excel and succeed, similarly, we need to set some security
goals to ensure the security of hash functions in cryptography.
Some significant goals are as follows:
Integrity
This is achieved when no person other than the sender and receiver can access the
data or information transferred.
Secrecy
This is achieved when system files are accessible to a set of people and not common
to view for all.
Availability
This is achieved when the accessibility of data or information is for a set of people
and not just one person or two.
Preimage resistance
Hash functions provide preimage resistance. This concept says that the original function
H(M)=h cannot resolve H(N)=h.
H(M)=h
h=! H(M)
Where M is the message input,
h is hash code,
H is a hash function.
This means it is practically impossible to obtain a message from a hash code as it is one-way.
Hash functions provide second preimage resistance. This concept says that the original
function H(M) can never be equal to H(N), where n and m are different messages.
H(M)!=H(N)
This means it is practically impossible to obtain a different input message when we decode a
hash value. The second preimage resistance works on the one-way principle of hash
functions.
This ensures the security of hash functions in cryptography in the following ways:
An attacker cannot create a fake hash code for messages received in the absence of
security.
An attacker cannot generate an alternative message for the same hash codes.
Collision Resistance
Hash functions provide collision resistance. This concept says that the original function H(M)
is not equal to H(N)
It is similar to the second pre-image resistance. The difference is that in collision resistance,
you cannot have two messages that indicate the same output of hash values. Whereas in the
second preimage resistance, a hash value cannot indicate a different input message.
H(M)!=H(N)
This means that it is practically impossible to create a hash value that indicates two distinct
message inputs.
This ensures the security of hash functions in cryptography, not creating confusion and providing one
message input that is authenticated.
Comparison between the Security Criterias
The following table compares the three security requirements for hash functions: collision resistance,
second preimage resistance, and preimage resistance.
Length of Bits Minimum 80 bits Not less than 90 bits 160 bits