Problem
Show that appending the message length to the end of the message before applying basic CBC-MAC does not result in a secure MAC for arbitrary-length messages.
Solution
Query
m1​=B0​∣∣B1​, t1​=MACk​(m1​∣∣⟨∣m1​∣⟩)
m1∗​=B0∗​∣∣B1∗​, t1∗​=MACk​(m1∗​∣∣⟨∣m1∗​∣⟩)
∣m1∗​∣=∣m1​∣
m2​=m1​∣∣⟨∣m1​∣⟩∣∣B2​∣∣B3​, t2​=MAC(m2​∣∣⟨∣m2​∣⟩)
To be specific, the process of computing t2​ for message m2​ is listed below:
c0​=Fk​(B0​)
c1​=Fk​(c0​⊕B1​)
t1​=Fk​(c1​⊕⟨∣m1​∣⟩)
c3​=Fk​(t1​⊕B2​)
c4​=Fk​(c3​⊕B3​)
t=Fk​(c4​⊕⟨∣m2​∣⟩)
Hence, if we change m1​ to m1∗​,
Therefore