一、题目
本次实验主要是加深大家对MD5碰撞及其原理的理解,使用SEED实验环境中的工具及编程语言,完成以下任务:
a)使用md5collgen生成两个MD5值相同的文件,并利用bless十六进制编辑器查看输出的两个文件,描述你观察到的情况;
b)参考Lab3_task2.c的代码,生成两个MD5值相同但输出不同的两个可执行文件。
c)参考Lab3_task3.c的代码,生成两个MD5值相同但代码行为不相同的可执行文件。
d)回答问题:通过上面的实验,请解释为什么可以做到不同行为的两个可执行文件具有相同的MD5值?
二、过程
a)
1)使用md5collgen生成两个MD5值相同的文件:
2)比较生成的两个文件,可以看出生成的两个文件内容不同,哈希值一样。
3)利用bless编辑器查看两文件,经观察可得两文件的前缀相同,文件内容有不同。通过分析md5collgen的原理可以明白形成这一现象原因。从prifix.txt中取前缀,若前缀不是64的倍数,则用零填充。md5collgen为两个输出文件生成128字节的内容,这两个输出文件就是在这128字节中存在部分差异。