Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 783 Bytes

README.md

File metadata and controls

21 lines (11 loc) · 783 Bytes

HMAC-Algorithm

Implementation of HMAC (Hashed Message Authentication Code) Algorithm without importing the in-built Python Library, 'hmac'.

To use a different Hash Algorithm, change the third parameter of the hmacGenerator function from hashlib.sha256 to the preferred choice in the line 136 of the code.

signature = base64encode(hmacGenerator(key, message, hashlib.sha256).digest())

For example - hashlib.sha512, hashlib.sha1 etc.

Output with SHA-256 as the Hash Algorithm :-

SHA256

Output with SHA-512 as the Hash Algorithm :-

SHA512