Hash and Mac Algorithms
Contents
Hash Functions
M
Hash function
H(M)
Hash Functions
M
b bits
b bits
b bits
b bits
→ L blocks × b bits
H(M)
Hash function
Hash Functions
→ L blocks × b bits
→ M + padding
M
b bits
b bits
b bits
b bits
H(M)
M
Padding
Hash function
Hash Functions
Hash Functions
…
IV or CV0 | Initial value for 1st compression |
CVi | Output of the ith compression |
CVL | The final hash value, H(M) |
n | Length of hash code |
Yi | ith input block from message M |
b | Length of input block |
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
1. append padding
2. append length
3. Initialize hash buffer
4. Process message
5. Output
1024 × (N-1) + 896 bits
Secure Hash Algorithm
1. append padding
2. append length
3. Initialize hash buffer
4. Process message
5. Output
Secure Hash Algorithm
1. append padding
2. append length
3. Initialize hash buffer
4. Process message
5. Output
a | = | 6A09 E667 F3BC C908 | e | = | 510E 527F ADE6 82D1 |
b | = | BB67 AE85 84CA A73B | f | = | 9B05 688C 2B3E 6C1F |
c | = | 3C6E F372 FE94 F82B | g | = | 1F83 D9AB FB41 BD6B |
d | = | A54F F53A 5F1D 36F1 | h | = | 5BE0 CDI9 137E 2179 |
Secure Hash Algorithm
1. append padding
2. append length
3. Initialize MD buffer
4. Process message
5. Output
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
H0 = IV
Hi = SUM64(Hi-1, abcdefghi)
MD = HN
1. append padding
2. append length
3. Initialize MD buffer
4. Process message
5. Output
Secure Hash Algorithm
a | = T1+T2 | e | = d + T1 |
b | = a | f | = e |
c | = b | g | = f |
d | = c | h | = g |
Secure Hash Algorithm
Secure Hash Algorithm
b = a f = e
c = b g = f
d = c h = g
T2
T1
Secure Hash Algorithm
Secure Hash Algorithm
Secure Hash Algorithm
HMAC
HMAC
HMAC
HMAC
HMAC
( MD5, SHA-1, RIPEMD-160)
HMAC
HMAC
HMAC
HMAC
HMAC
HMAC
HMAC
HMAC
HMAC