You are on page 1of 18

MESSAGE

AUTHENTICATION &
HASH FUNCTION
By:
NISHU RASTOGI
AUTHENTICATION
REQUIREMENT
During communication following attacks may be identified:
 Disclosure
 Traffic Analysis
 Masquerade
 Content Modification
 Sequence Modification
 Timing Modification (replay attack)
 Source Repudiation
 Destination Repudiation
NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 2
AUTHENTICATION FUNCTIONS

• Message Encryption- The cipher text of entire message serves as


authenticator.
• MAC (Message Authentication Code)- A public function of the
message and a secret key that produces a fixed length code, and serves
as authenticator. MAC= F(Message, Key).
• Hash Function- A public key function that maps mesaage of any
length into fixed length hash value, which acts as authenticator.
HASH=F(Mesaage)

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 3


MESSAGE ENCRYPTION

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 4


MESSAGE AUTHENTICATION
CODE
Technique assumes that two communicating parties, say A and B, share a common secret
key K.
When A has a message to send to B, it calculates the MAC as a function of the message
and the key:
MAC = C(K, M),
where M = input message
C = MAC function
K = shared secret key
MAC = message authentication code
The MAC is appended to the message at the source at a time when the message is assumed
or known to be correct. The receiver authenticates that message by re-computing the MAC.
NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 5
MAC FEATURES

The receiver is assured that the message has been not altered.
The receiver is assured that the message is from authenticated sender.
The receiver is assured that integrity is maintained.
MAC function is similar to encryption, but MAC algorithm is not
required to be reversible.

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 6


MAC USAGE

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 7


HASH FUNCTION

A hash value h is generated by a function H of the form


h = H(M)
where M is a variable-length message and
H(M) is the fixed-length hash value.
The hash value is appended to the message at the source at a time when
the message is assumed or known to be correct.
The receiver authenticates that message by re-computing the hash value.

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 8


FEATURES/REQUIREMENTS
FOR HASH
 H can be applied to a block of data of any size.
 H produces a fixed-length output.
 H(x) is relatively easy to compute for any given x, making both
hardware and software implementations practical. For any given value h,
it is computationally infeasible to find x such that H(x) = h. (one-way
property)
 For any given block x, it is computationally infeasible to find y x such
that H(y) = H(x). (weak collision resistance)
 It is computationally infeasible to find any pair (x, y) such that H(x) =
H(y).
NISHU (strong
RASTOGI, collision
ASSISTANT resistance)
PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 9
HASH USAGE

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 10


HASH VS. MAC

1- To calculate hash only message 1- To calculate MAC message and


is required. a secret key is required.

2- Hash code must be encrypted 2- There is no need to encrypt


using either symmetric or MAC code because it has already
asymmetric key cryptosystem to been calculated using a secret key.
ensure several security services. MAC function is similar to
encryption function.

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 11


SECURE HASH ALGORITHM
(SHA-1)
• The Secure Hash Algorithm (SHA) was developed by the National
Institute of Standards and Technology (NIST) and published as a
federal information processing standard (FIPS 180) in 1993.

• A revised version was issued as FIPS 180-1 in 1995 and is generally


referred to as SHA-1.

• Its purpose is authentication not encryption.

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 12


SHA-1
(HASH CODE OF 160 BITS)
Step 1: Append Padding Bits
The message is padded such that its length is congruent to 448 modulo 512.
Message is “padded” with a 1 and as many 0’s as necessary to bring the message length to 64 bits
fewer than an even multiple of 512. (Message size is 678 bits)
(such that after appending padding bits Length_of_Message mod 512=448)

Step 2: Append Length


A block of 64 bits is appended to the end of the padded message. These bits hold the binary format
of 64 bits indicating the length of the original message.
Step 3: Initialize Buffers
SHA1 requires 160 bits or 5 buffers of words (32 bits):
A= 0X67452301
B = 0XEFCDAB89
C = 0X98BADCFE
D = 0X10325476
E = 0XC3D2E1F0
NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 13
SHA-1 CONTD..
Step 4: Prepare Processing Constants
SHA1 requires 80 processing constant words defined as:
K(t) = 0x5A827999 ( 0 <= t <= 19)
K(t) = 0x6ED9EBA1 (20 <= t <= 39)
K(t) = 0x8F1BBCDC (40 <= t <= 59)
K(t) = 0xCA62C1D6 (60 <= t <= 79)
Step 5: Prepare Processing Functions
SHA1 requires 80 processing functions defined as:
f(t;B,C,D) = (B AND C) OR ((NOT B) AND D) (0 <= t <= 19)
f(t;B,C,D) = B XOR C XOR D (20 <= t <= 39)
f(t;B,C,D) = (B AND C) OR (B AND D) OR (C AND D) (40 <=t<=59)
f(t;B,C,D) = B XOR C XOR D (60 <= t <= 79)
NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 14
SHA-1

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 15


SHA-1 SINGLE ROUND

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 16


WORD GENERATION

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 17


THANKS….

NISHU RASTOGI, ASSISTANT PROFESSOR, INVERTIS UNIVERSITY, BAREILLY 10/08/2023 18

You might also like