[SEEDLAB] Cryptography Writeup (MD5 Collision) #2
Task 1: Generating Two Different Files with the Same MD5 Hash
Q1. If the length of your prefix file is not multiple of 64, what is going to happen?
A1. Multiple zero-paddings are being added.
Q2. Create a prefix file with exactly 64 bytes, and run the collision tool again, and see
what happens.
A2. No paddings are being added unlike Q1.
Q2. Are the data generated by md5collgen completely different for the two output
files? Please identify
A2. I made a Python code that automatically compares the different parts. As a result,
the data generated by md5collgen is not completely different but rather partially
different.
Task 2: Understanding MD5’s Property
A1. The files of MD5 hash are still identical even after appending the context.
Before appending:
Now appending “task2_test” to out1.bin and out2.bin:
md5sum result after appending:
Solution:
Firstly, I’ll edit the code so that xyz will contain 200 items:
Compiling the source:
Inspecting in Hex Viewer. I found it that prefix starts from 0x1040 (==4160), which is true because
4160 can be divided by 64. (4160 mod 64 == 0)
Getting prefix from 4224, which is 4160+64:
Running md5collgen from the prefix:
Getting suffix from 4353:
Successfully created p1 & p2 which has same hash each other but actual content differs: