PRACTICAL NO:8
                                     HMAC-SHA1
Aim
To write a Python program to calculate the HMAC-SHA1 (Hash-based Message Authentication Code using SHA-1) signature for a given message and secret key.
Introduction
HMAC stands for Hash-based Message Authentication Code. It is a mechanism used to verify the integrity and authenticity of a message. HMAC uses a cryptographic hash function together with a secret key. Both the sender and receiver must know the same secret key.
HMAC-SHA1 uses the SHA-1 hash algorithm as its underlying hash function. The result of HMAC-SHA1 is a 160-bit (20-byte) message authentication code, normally displayed as 40 hexadecimal characters.
Need for HMAC
A normal hash function can detect accidental changes to data, but by itself it does not prove who generated the hash. An attacker who changes a message could also calculate a new ordinary hash. HMAC solves this problem by combining the message with a secret key that is known only to the communicating parties.
HMAC-SHA1
In HMAC-SHA1, SHA-1 is used as the hash function. The secret key is
processed according to the HMAC construction and combined with the
message using two fixed padding values called ipad and opad.
8.1 
CODE:
OUTPUT:
8.2
CODE:
OUTPUT:
