0% found this document useful (0 votes)
16 views25 pages

19-Security of Hash Functions-14!02!2025

The document discusses hash functions, focusing on their properties, requirements, and applications in cryptography. Key concepts include the one-way property, collision resistance, and various methods for message authentication using hash codes. Popular hash algorithms mentioned are MD5, SHA, and HMAC, highlighting their importance in ensuring data integrity and security.

Uploaded by

adityadsingh0234
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)
16 views25 pages

19-Security of Hash Functions-14!02!2025

The document discusses hash functions, focusing on their properties, requirements, and applications in cryptography. Key concepts include the one-way property, collision resistance, and various methods for message authentication using hash codes. Popular hash algorithms mentioned are MD5, SHA, and HMAC, highlighting their importance in ensuring data integrity and security.

Uploaded by

adityadsingh0234
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/ 25

Module-4

Requirements for Hash Functions, Security of


Hash Functions, Message Digest (MD5), Secure
Hash Function (SHA),Birthday Attack, HMAC
Hash Functions
A hash function H accepts a variable-length block of
data M as input and produces a fixed-size hash value
h = H(M).
Example

A hash function provides a property that has function applied on variable


amount of data(M) and then it produces the fixed amount of output data.

If any bit or bits changes in the data ,then whole hash function output
data will also change.

Cryptographic hash function is a one-way function ,Which is practically


infeasible to invert.

The most popular hashing algorithm is MD5 and SHA


Example
Properties of a Hash function
 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.
 Avalanche effect: If there is a small change in
the input, the output changes dramatically. This
makes sure that the hash value can not be
guessed based on the input values.
A good hash function should be collision
resistant – never get the same hash value for
different inputs.
Properties of a Hash function

Strong and Weak collision Resistance are not the same: Weak collision resistance is
bound to a particular input whereas strong collision resistance applies to any two
arbitrary input.
Cryptographic hash functions
• Hash functions used for security
applications are known as cryptographic
hash functions.
• They have two important properties:
• It is computationally infeasible to find
either:
– One way property: Computationally
infeasible to find data mapping to specific
hash.
– Collision free property: Computationally
infeasible to find two data to same hash.
Characteristics of a Hash function
Requirements of Hash function:
Requirements of Hash function:
• The first three properties are requirements for the practical application of a hash
function.

•The fourth property,preimage resistant, is the one-way property:it is easy to


generate a code given a message,but virtually impossible to generate a message
given a code.
•This property is important if the authentication technique involves the use of a
secret value. However,if the hash function is not one way, an attacker can easily
discover the secret value.

•The fifth property, second preimage resistant,guarantees that it is impossible to


find an alternative message with the same hash value as a given message.
•This prevents forgery when an encrypted hash code is used.If this property were
not true,an attacker would be capable of the following sequence:
i)First observe or intercept the message plus its encrypted hashcode.
ii)Generate an unencrypted hash code from message.
iii)Generate an alternative message with the same hash code.
Requirements of Hash function:
• If the sixth property,collision resistant, is also satisfied. Then it is referred to as a
strong hash function.
•A strong hash function protects against an attack in which one party generates a
message for another party to sign.
•For example,Suppose Bob writes an IOU message, sends it to Alice,and she sign it
Bob finds two messages with the same hash,one of which requires Alice to pay a
small amount and one that requires a large payment Alice signs the first message,
and Bob is then able to claim that the second message is authentic
APPLICATIONS OF
CRYPTOGRAPHIC HASH
FUNCTIONS
APPLICATIONS OF CRYPTOGRAPHIC HASH
FUNCTIONS

• Message Authentication
• Digital signature
• One way password file
• Intrusion detection and prevention
(a) Message Authentication
Message Authentication

• It is a mechanism used to verify the integrity of a


message.
• It assures that data received are exactly as sent (i.e.,
there is no modification, insertion, deletion, or replay).
Various Methods for Message
Authentication
(using the Hash code)
Method 1 – Message and Hash code Encrypted
Method 2 – Only hash code is encrypted
Method 3 – Sharing a secret value for message authentication
Method 4 – Adding confidentiality to method 3
Method 1 – Message and Hash code Encrypted
• The message plus concatenated hash code is encrypted using
symmetric encryption.
• Because only A and B share the secret key, the message must
have come from A and has not been altered.
• The hash code provides the structure or redundancy required
to achieve authentication.
• Because encryption is applied to the entire message plus hash
code, confidentiality is also provided.
Method 2 – Only hash code is encrypted
• Only the hash code is encrypted, using symmetric
encryption.
• This reduces the processing burden for those
applications that do not require confidentiality.
Method 3 – Sharing a secret value for message authentication
• It is possible to use a hash function but no encryption for
message authentication.
• The technique assumes that the two communicating parties
share a common secret value S.
• A computes the hash value over the concatenation of M and S
and appends the resulting hash value to M.
• Because B possesses, it can re-compute the hash value to verify.
• Because the secret value itself is not sent, an opponent cannot
modify an intercepted message and cannot generate a false
message.
Method 4 – Adding confidentiality to method 3

Confidentiality can be added to the approach of


method (c) by encrypting the entire message plus
the hash code.
Requirements 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 y ≠ x with H (y) = 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.
Hash function requirements
• MD5
• SHA
• HMAC

You might also like