0% found this document useful (0 votes)
2 views

Hashing Function

The document provides an overview of hash functions, highlighting their importance in data integrity, authentication, and confidentiality. It details the features and applications of hash functions, along with an explanation of common algorithms like MD5 and SHA, including their processes and differences. The document emphasizes the security concerns associated with MD5 and SHA-1, while presenting SHA-256 and SHA-3 as more secure alternatives.

Uploaded by

adityapandji1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Hashing Function

The document provides an overview of hash functions, highlighting their importance in data integrity, authentication, and confidentiality. It details the features and applications of hash functions, along with an explanation of common algorithms like MD5 and SHA, including their processes and differences. The document emphasizes the security concerns associated with MD5 and SHA-1, while presenting SHA-256 and SHA-3 as more secure alternatives.

Uploaded by

adityapandji1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Hashing Function

Hash Function : Introduction, Features of Hash Functions, MD5 and SHA


algorithm
Introduction
• A hash function is a cryptographic algorithm that takes an input (or
"message") and returns a fixed-size string of bytes.
• This output, known as a hash value or digest which is a unique
representation of the input data.
• In information security, hash functions play an important role in
ensuring data integrity, authentication, and confidentiality.
Features
• For a given input, the hash function will always produce the same
output.
• Regardless of the size of the input, the output (hash value) is always
of a fixed length.
• Given a hash value, it is highly impossible to determine the original
input
• Even a small change in the input should produce a drastically different
hash output.
• It should not be feasible to find two different inputs that produce the
same hash output (known as collision resolution).
Some of the application of Hash
Functions :
• Data Integrity
• Digital Signatures
• Password Storage
• Message Authentication
• Digital Certificates
Common Hash Algorithms:
• MD5 (Message Digest Algorithm : Earlier used but now considered
insecure due to vulnerabilities to collision attacks.
• SHA-1 (Secure Hash Algorithm 1): This also widely used earlier , but
has been deprecated due to weaknesses that allow collision attacks.
• SHA-256 (part of the SHA-2 family): Currently considered secure and
widely used for cryptographic applications like SSL/TLS certificates,
blockchain, etc.
• SHA-3: The latest version of the Secure Hash Algorithm family,
designed to give more security than SHA-2.
MD5 Algorithm
In MD5 Algorithm message has to be represented in multiples of 512
bits always.
The steps which arefollowed in MD5 algorithm are as follows :
1. Append padding bits
2. Append 64 bit representation.
3. Initialize MD bufferes
4. Process each block
1. Append padding bits :
• Find multiples of 512 as 512,1024,1536,2048…, out of which find the
closet number, after removing 64 bits. Because in second step, 64 bits
are always added to the message bits, and the block size has to be
always maintained as 512 bits.
Eg : Consider message has 1000 bits. So the nearest value is 1536
considering 64 bits.
So 1536-64=1472.
Therefore to get 1472, one has to add 472 to original 1000 bits of
message. So it is like
1000(original msg)+472(called as Padding bits) =1472 bits
2. Append 64 length bits to earlier
value :
• 64(always as length bits) are added to the message.
• It can be seen as
1000+472+64 =1526 (is a multiple of 512.
Divide these bits into blocksof 512 each. So in this case it will have 3
blocks of 512 bits.
3. Initialize MD buffer
• Here 4 Buffers are created with size of each buffer as 32 bits
(ie 32x4=128 bits)
• This is why after processing all the steps we get 128 bits in the
output.
• The buffers are identified as A,B,C and D. These are initialized
by predefined hexadecimal values. Eg A=0x67425301 ,
similarly for B,C,D there will be predefined fixed hexadecimal
values.
4.Process each block : Each block of 512 bits is processed with
total 64 operations being 4 rounds of 16 operations in one round.

• A,B,C,D are 4 buffers


• F is a special linear function with
predefined equations.
• The functions are F,G, H and I for 4
rounds respectively. Mi is 32 bit block
of message.
• Ki is 32 bits predefined constant,
which is different for each round.
• <<< s is left circular shift and
resultant
• After processing, final values are in 4
Final Output values buffers A,B,C and D of 128 bits.
SHA Algorithm
• It is a modified version of MD5.
• There are different algorithms in SHA family as SHA-1.SHA2, SHA-3.
• SHA-1 produces a 160-bit hash value (20 bytes).
• SHA-2 has different variants like SHA-224, SHA-256, SHA-384, and
SHA-512, with output lengths of 224, 256, 384, and 512 bits,
respectively.
• SHA-3 also has customizable output lengths (224, 256, 384, or 512
bits).
• Output is a message digest depends upon the variant Eg for SHA-1 it is
160 bits.
Working is very similar to MD5 :
1. Add padding bits.
2. Append 64 bits length to make multiple of 512 bits
3. Divide the input into 512 bits block.
4. Initialise buffer. Here the number of buffers are 5 as
A,B,C,D,E for SHA-1. It may get increased in other versions
of algorithm as in case of SHA-2 , it uses 8 buffers.
5. Process each block which contains similar processes as
MD5 to get output.
Difference between MD5 and SHA
MD5 SHA
Uses 128 bits message digest Uses 160 bits message
digest(considering SHA-1)
Requires 64 steps In rounds Requires 80 steps in rounds
Less secure More secure than MD5
Attacks reported to some extent No attack reported till now.
264 bit operations are required to break 280 bit operations are required to break
Faster as only 64 iterations required. Slower as compared to MD5 because 80
iterations required.
Thank you

You might also like