Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How a download user checks md5 after file download?

We may notice many download sites provide md5 string. For example, when I download ABC.zip, along with an md5 string like: “2743a6a9fe6f873df1c7ed8ac91df5d7 *ABC.zip”. I know the idea behind it, it’s Digest algorithm to prevent file forge.

My question is how a user calculates md5 string for the ABC.zip, and compare it with value site provides? Any existing tool to generate md5 string?

like image 863
卢声远 Shengyuan Lu Avatar asked Jan 30 '11 02:01

卢声远 Shengyuan Lu


People also ask

What is the MD5 hash of the downloaded file?

An MD5 checksum is a mathematical algorithm is usually a set of 32-character hexadecimal letters and numbers that are computed on a file with a tool. These numbers are generated using special tools that employ “cryptographic hash function producing a 128-bit (16-byte) hash value”.

Does MD5 protect against download errors?

An MD5 hash is a form of validation. If a single bit in the file is different, the provided hash will not match the one generated from the file you downloaded. This alerts you to an error in transmission or foul play (rare).


1 Answers

It depends a bit on your operating system ofcourse. Under most Linux/Unix distributions you have an md5 or md5sum program available.

Example:

# md5sum eclipse-SDK-3.6RC3-linux-gtk.tar.gz
8eca528d2c0b33dae10ba8750b2e4b94  eclipse-SDK-3.6RC3-linux-gtk.tar.gz

It also has a check mode which does exactly what you're looking for:

# md5sum -c test.md5
eclipse-SDK-3.6RC3-linux-gtk.tar.gz: OK

(test.md5 has the output of the previous command)

like image 148
Wolph Avatar answered Sep 18 '22 13:09

Wolph