7

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?

卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130

4 Answers4

6

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)

Wolph
  • 78,177
  • 11
  • 137
  • 148
  • @卢声远 Shengyuan Lu: Wikipedia has some links to Windows versions: http://en.wikipedia.org/wiki/Md5sum#External_links There isn't really a standard program for Windows, but you can install the Linux ports or something graphical like `flashsfv`: http://www.trvx.com/flashsfv/ – Wolph Jan 30 '11 at 02:43
  • An old question, but for anybody landing here... on Windows I use Ch shell standard edition, which include md5, sha1, wget, curl, etc. – Joe Internet Jun 19 '11 at 21:35
3

On Linux systems, the program is usually named md5sum.

On BSD systems, the program is usually named md5.

On Windows systems, aim users to http://en.wikipedia.org/wiki/Md5sum

Note that the md5sum and md5 utilities have a command-line option that can verify all the MD5 hashes listed in an MD5SUM file automatically:

sarnold@haig:~/bin$ md5sum * > /tmp/MD5SUM
sarnold@haig:~/bin$ md5sum -c /tmp/MD5SUM
aa-change: OK
aa-change.c: OK
briss: OK
mkvtom2ts: OK
muxer: OK
muxer_orig: OK
sarnold
  • 102,305
  • 22
  • 181
  • 238
0

For windows, if you install Cygwin, md5sum becomes available.

MikeRoger
  • 766
  • 1
  • 19
  • 25
0

Depends. Programming languages usually have a library to do this.

OS X has a command line utility 'md5'. Linux has something similar. For windows, no idea, but you can probably find something easily.

Harmen
  • 669
  • 3
  • 8