Download presentation
Presentation is loading. Please wait.
1
HMAC Algorithm Network Security
2
Objectives of the Topic
HMAC Algorithm Objectives of the Topic After completing this topic, a student will be able to describe working of HMAC algorithm.
3
Figures and material in this topic have been adapted from
HMAC Algorithm Figures and material in this topic have been adapted from “Network Security Essentials : Applications and Standards”, 2014, by William Stallings.
4
HMAC Algorithm Notation: H = embedded hash function (e.g., SHA-1)
IV = initial value input to hash function M = message input to HMAC (including the padding specified in the embedded hash function)
5
HMAC Algorithm Yi = ith block of M, 0 ≤ i ≤(L - 1)
L = number of blocks in M b = number of bits in a block n = length of hash code produced by embedded hash function
6
HMAC Algorithm K = secret key; recommended length is ≥ n; if key length is greater than b, the key is input to the hash function to produce an n-bit key K+ = K padded with zeros on the left so that the result is b bits in length
7
HMAC Algorithm ipad = 00110110 (36 in hexadecimal) repeated b/8 times
opad = (5C in hexadecimal) repeated b/8 times
8
HMAC Algorithm 1. Append zeros to the left end of K to create a b-bit string K+ (e.g., if K is of length 160 bits and b = 512, K will be appended with 44 zero bytes). 2. Bitwise exclusive-OR K+ with ipad to produce the b-bit block Si.
9
HMAC Algorithm 3. Append M to Si.
4. Apply H to the stream generated in step 3. 5. XOR K+ with opad to produce the b-bit block So. 6. Append the hash result from step 4 to So.
10
HMAC Algorithm 7. Apply H to the stream generated in step 6 and output the result.
11
HMAC Algorithm
12
HMAC Algorithm Note that the XOR with ipad results in flipping one-half of the bits of K. Similarly, the XOR with opad results in flipping one-half of the bits of K, using a different set of bits.
13
HMAC Algorithm In effect, by passing Si and So through the hash algorithm, we have pseudorandomly generated two keys from K.
14
HMAC Algorithm HMAC should execute in approximately the same time as the embedded hash function for long messages.
15
HMAC Algorithm HMAC adds three executions of the basic hash function (for Si, So, and the block produced from the inner hash).
16
HMAC Algorithm Security of HMAC:
The appeal of HMAC is that its designers have been able to prove an exact relationship between the strength of the embedded hash function and the strength of HMAC. End
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.