๐Ÿ” SHA-1 Hash Function Demonstration

SHA-1 takes any input and produces a fixed 160-bit (40 hex characters) hash value. Try different inputs to see how even small changes produce completely different hashes.
Plaintext (string):
SHA-1 Hash output (hex):

๐Ÿ”’ HMAC Construction (Simplified Educational Version)

HMAC combines a hash function with a secret key to provide both data integrity and authentication. This simulation uses a simplified "dummy" hash function for educational purposes.

๐Ÿ“ Step 1: Setup Parameters

Message (binary):
Binary message to be authenticated
Block size (l):
Hash function block size (must be โ‰ฅ 8)
Initialization Vector (IV):
Random initialization vector of length l
Secret Key (k):
Secret key of length l

๐Ÿงฎ Step 2: Test the Dummy Hash Function

Our simplified hash function XORs adjacent bit pairs: H(b1b2b3b4) = (b1โŠ•b2)(b3โŠ•b4)
Test Input (2l bits):
Input must be exactly 2l bits (16 bits for l=8)
Hash Output (l bits):
Result of applying the hash function

๐Ÿ“š Step 3: HMAC Calculation Guide

HMAC follows this process:
1. ipad = 01011100, opad = 00110110
2. Inner hash: H(IV || (k โŠ• ipad) || padded_message || length)
3. Outer hash: H(IV || (k โŠ• opad) || inner_hash_result)
๐Ÿงช Calculation Helper:

๐ŸŽฏ Step 4: Enter Final HMAC Result

Final HMAC Tag:
Enter the final HMAC authentication tag

๐Ÿ“Š Summary of Results

Parameter Value
Message -
Block Size (l) -
Secret Key -
Initialization Vector -
Final HMAC Tag -

๐Ÿ“ฑ Mobile Device Detected

This cryptography simulation is optimized for desktop computers and tablets in landscape mode for the best learning experience.

For optimal viewing:

  • Use a desktop or laptop computer
  • Rotate your tablet to landscape mode
  • Use a larger screen device if possible