5. (Hash, Collision Resistance, Problem 4.9 of D. Stinson, 20 pts) Suppose h1 : {0,1}2m → {0,1}m is a collision resistant hash function. Define h2 : {0, 1}4m → {0,1}m as follows:
(a) Write x ∈ {0,1}4m as x = x1||x2, where x1, x2 ∈ {0, 1}2m.
(b) Define h2(x) = h1(h1(x1)||h1(x2)).
Prove that h2 is collision resistant.
Hint: Prove by contradiction that h2 is collision resistant: assume that there exists x1, x2 ∈ {0,1}4m, such that x1 ≠ x2, but h2(x1) = h2(x2). Also use the fact that h1 is collision resistant, i.e., there does not exist x1, x2 ∈ {0,1}2m such that x1 ≠ x2 but h1(x1) = h1(x2); in other words, h1(x1) = h1(x2) implies x1 = x2.