Chapter6 2020
Chapter6 2020
• Contents:
6.1 Introduction to Hash Functions
6.2 Hash Function SHA-3
6.3 Applications of Hash Function
6.4 MAC and its Applications
Some figures are from W. Stalling’s book “Cryptography and network security”, 7th edition. ©2017 Pearson Education, Inc
m = m1 || m2 || ∙∙∙ || mi || ∙∙∙
o Then h(m) = m1 m2 mi
o where ⊕ denotes bit-wise XOR operation.
• Practical hash functions are much more complicated.
1. Easy to compute:
o Given message m, hash function h(m) is easy to compute.
1. The R portion of the state memory is the first r bits of output Z0.
2. If more output bits are desired, S is replaced by f(S)
3. The R portion of the state memory is the next r bits of output Z1.
4. …etc.
5. The process is repeated until the desired number of output bits
are produced.
6. If the output length is not a multiple of r bits, it will be truncated.
o SHA-3 setting:
▪ r = 1088 and c = 512
▪ Function f permutation width: 1600
▪ security strength: 256 bits
• Let Pi, i=1, 2, …, N, represent the message blocks and K be the key.
• Then CBC-MAC is computed as the last black of ciphertext generated with a
symmetrical key cipher in CBC mode:
1. C1 = EK(P1 IV)
2. Ci = EK(Pi Ci-1), i =2, 3, …, N.
3. MAC = CN .
1. C1 = h((K b) || m)
2. MAC = h((K a) || C1)
where K is the key, and a and b are two specified constants.
• Computation of GMAC:
1. First it uses a special hash-like math function and generates a fixed-size output.
2. Then it encrypts the output with a block cipher.
3. The result is the MAC.
Note: The special hash-like math function, which requires much less computation than a
hash function like SHA-1, is beyond our scope.
o A collision means there two pairs (x, h(x)) and (x’, h(x’)) such that
h(x)=h(x’). (cf., two students share the same birthday)
o The attacker can find one collision with Probability > 0.5 if n=280.
(cf. The probability that there are two students who share the same
birthday in a class of 280 students is > 0.5.)