Lab 4: Hash Functions and Digital Certificates
5
• If you are using Windows, you can download these .exe files here.
• If you are using Linux, you can download the similar: hello and erase.
Run these programs and observe what happens. Note these programs must be run from the
console. Let’s generate MD5 hash values for these programs and report your observations
3. Download two PDF files: shattered-1.pdf and shattered-2.pdf. Open these files to check the
difference. Then generate SHA-1 hash for them, and observe the result.
Draw the conclusion based on your observations, explain the reasons for the existence of collision
in MD5 and SHA-1.
1. Consider two HEX messages
− Tìm sự khác nhau giữa 2 đoạn message:
o Cả 2 đoạn mã đều mã đều có chung độ dài là 256 byte.
o Để xác định số byte khác nhau giữa hai tin nhắn, chúng ta cần so sánh từng
byte của hai tin nhắn và đếm số lượng khác nhau.
o Để đếm số byte khác nhau, chúng ta so sánh từng byte tương ứng trong hai
tin nhắn và tăng một biến đếm mỗi khi tìm thấy sự khác biệt.
o So sánh hai tin nhắn, chúng ta tìm thấy có 17 byte khác nhau giữa hai tin
nhắn.
− Tạo giá trị băm MD5 cho 2 đoạn message và quan sát.
o Giá trị băm cho Message 1: edde4181249fea68547c2fd0edd2e22f
o Giá trị băm cho Message 2: e234dbc6aa0932d9dd5facd53ba0372a
Quan sát: So sánh hai giá trị băm trên, chúng ta thấy rằng chúng khác nhau. Điều này cho
thấy rằng hai message ban đầu cũng khác nhau.
2. Consider two executable programs named hello and erase:
− Chạy 2 chương trình và quan sát những gì xảy ra:
hello.exe