How To: perform MD5 or SHA1 check of any file /for total newbies/ Linux and win...

Elisa
  12 years ago
  14

How To perform MD5 or SHA1 check?


    I often read in http://forums.linuxmint.com many answers to helper's questions -> did you perform a md5 checksum to be sure you downloaded true and not corrupted media, file etc.?
- Huh? Whoa...? What ? What is that...? :o  :shock:
:roll:

    That's why I suppose this could be "a must", the basic reading for all newcomers, newbies, noobs or even for all who listen the first time about checksum, md5 or sha1 :D


    I am sure - everyone, a silly noob or a geek (gurus do that, don't they? :D ) must do the check, as Fred has told such cool meaning (Fred's post in the forum):

enlightened    Never ever try to use an iso that you can't get the correct md5 sum to verify. If you do, you have no idea what you are exposing your computer and data to. If you are lucky, it just won't work right. If you aren't lucky.... well.... use your imagination.

    What is md5, sha1 and other hashings? Read here for more details.
Quickly - a quotation of Boo:

"If you go to the Mint Downloads page you will notice a row "MD5" under the release name. eg Cassandra.

so for the edition of mint you have go down to the MD5 row.
this MD5 value will look like a big mess of numbers and letters.
this is a unique value for the iso file used to check if the iso you downloaded is the same as the one on the site.
some cd/dvd burning software will calculate this value for an iso you want to burn. otherwise you need an md5sum application, it is part of all linux systems. if you are using windows google for a windows md5sum application and install it."


    If you are on window$ system and downloading from win environment, I will introduce you 2 applications/programs for window$ which can check md5, sha1 and some other hashes.

    App "WinMd5Sum" Portable - is really a portable, not installing into system.
After downloading the target file "winMd5SumPortable_1.0.1.55_Rev_3_English.paf.exe" which hash md5 is "7237b0ef4872489c583250499ed9b25e" (don't forget to check it :wink: ), just run it. It will look like it's installing, but don't be afraid, it's just an executable archive and it's just extracting main executable program + some additional files, like help files, source files (if would like to compile it by yourself :) ).

yes    Once to see is 10 times better than twice to speak about it :D Let's see the pictures.


    All win$ programs were tested in wine of the cool LinuxMINT 9 KDE + screens were made and edited in a very cool app -> Shutter  :idea:

Just click on your downloaded file, it starts to extract...
WinMd5Sum - start of extraction

Then just choose the location where the portable content will be extracted.
Winmd5Sum - extraction do destination folder

Winmd5Sum - destination folders tree

    And that's all the magic. Program extracted, it can be copied even in your flash/usb disk and just run. Remember, it's .exe - win$ program...
    Ok, so click on extracted winMd5Sum.exe (extracted into "winMd5SumPortable" folder/directory)

Winmd5Sum - ran program window

    Just click at the right "3 dots button" when you will browse and select the file. Immediately, after selecting file, the md5 hash is calculated and visible in the "Md5 Sum" window. The last empty window is useful to paste (Ctrl + V) hash to be compared with the file calculated :wink:

    Let's see the example with this downloaded file - winMd5SumPortable_1.0.1.55_Rev_3_English.paf.exe Click on "Compare" to see the result.

winmd5sum comparison


kiss
 

    The last win program is CyoHash which must be installed but as far as I am told, the content of installed files in the folder can be also copied to other place and that .exe - CyoHash.exe just to run. I didn't tested it, only in wine on LinuxMINT 9 KDE yes

    The main difference between WinMd5Sum and CyoHash is - CyoHash supports more hashes: md5, sha1, sha1-base32 and crc32.

Classic install setup...
CyoHash - let's start

...followed selection of destination folder...
CyoHash - select destination folder

Setup's done. Just click on the installed exe - "CyoHash.exe"
CyoHash - ran program window
CyoHash - select hash algorithm

    After selecting a file, we have to choose hash algorithm and then you have to click on OK button to commit the calculation.
    After this step, another result window appears with a choice "Validate" in the left bottom corner.

CyoHash - calculating hash

Check the option, paste your string to be compare both hashes...
CyoHash - comaprison of hashes

    As an example was chosen TorChat - a cool app and Decentral Anonymous Instant Messenger which you can download for Linux as well as Window$. Yep, the referred hash on that page (as well as other hashes are visible just after your click on desired file download) is just SHA1, not md5 that's why you can find CyoHash helpful too.

    That's all as for Window$ apps review. If you know any other on-your-opinion interesting win hash app, let us know.
 

~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~


    The above written how-to supposes that the LinuxMINT distros are downloaded from Window$ enviro and for Win$ users.
    The md5 hashes are mentioned on each LinuxMINT exact edition -> .iso file, which is in fact the content of the boot-able CD/DVD media, which must be burned - choosing from a burner app/sw menu: Open image or Burn image followed pointing to downloaded .iso file, not as a New project and adding the .iso file to that etc. :roll: Just remember - to select the slow burning speed. I always choose 4x.

    Of course, there are also CLI applications in Windows, not only GUI.
But let's say true - most of us know very well how much are win$iees lame to use any CLI magic and they're mostly - and the only like click here, click there aka GUI users, aren't they? :roll: :D

    Linux newbies have much more resources which way or app to choose when calculating almost whatever hash algorithm :)

    Let's start for Linux noobs with IMO the best GUI app -> GtkHash yes

GtkHas - base application look

GtkHash supports really many hash algorithms
This app is easy, no need whatever to explain :D
GtkHash - supported hash algorithms

    Another way how to calculate md5 hash in KDE or Dolphin is selecting md5 (only) function from the right button click on a file.
Dolphin - md5 checksum show

    It's possible this way perform md5sum also in Gnome (thanks Dawgdoc) and I suppose there are some native ways in other desktops too, how to calculate at least md5, so if anyone want to share, you're welcome.

    Finally, the quickest way how to calculate almost any hash algorithm is terminal or CLI magic :D
Just describing some examples and sources because skilled geeks and gurus know... :wink:
However, this how-to is just for the total beginners aka newbies-noobs :mrgreen:


    All of you have coreutils (check your Synaptic Package Manager) in the repositories. When you look up them e.g. in Synaptic, you will see that coreutils include many interesting and helpful commands:

basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold groups head hostid id install join link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir sha1sum seq shred sleep sort split stat stty sum sync tac tail tee test touch tr true tsort tty uname unexpand uniq unlink users vdir wc who whoami yes

The quickest and easiest way how to use md5sum or sha1sum in terminal:

md5sum file

Result in terminal is hash string. The hash string can be stored also in a text file:

md5sum file > txtfile.md5

where you have to specify file => concrete file and txtfile.md5 => file output (name) which will be created immediately.

Just play with CLI, you will see that even CLI can be fun too :D


For additional studying, some meaningful resources:

http://en.wikipedia.org/wiki/Md5sum
http://en.wikipedia.org/wiki/Sha1sum
http://linux.byexamples.com/archives/19 ... sum-how-to
http://www.howtoforge.com/useful_linux_commands

kiss
______________________________________________________________
There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

- Jeremy S. Anderson

cheeky yes

Comments
RonC 9 years ago

Maybe this would be helpful -- just using Linux Mint, Dolphin, and terminal:

Open the directory in Dolphin, the one containing the downloaded file plus the accompanying text file containing the checksum. The download usually shows both files, right next to each other.

Right-click anywhere in the white space of the directory, select from 'Actions' from the Context Menu, then 'Open Terminal Here'.

Example, after downloading Bodhi Linux, then download its .md5 file, letting it go right next to the OS's iso, into the same download directory,

Copy this into the terminal command line:
md5sum -c bodhi-3.0.0-legacy-rc2.iso.md5 (subsititute the md5 filename you actually have)

Then hit [Enter] and this appears on the screen:
bodhi-3.0.0-legacy-rc2.iso: OK

Done!
The 'OK' means the checksums matched.

The md5 file's filename tells which file is to be checked, so I wouldn't change it ... likewise, keep the extension -- whatever it may be -- the same when you put it into the command.

I think ... the same would work with 'sha1sum'. Both of these commands have man pages, in the Mint system files.


pcpunk 9 years ago

That sucked!


bambamsam 11 years ago

thanks a BUNCH!! am a TOTAL n00b and could not for the life of me get the MD5 checked via Run. found your tutorial, used WinMd5Sum Portable and VIOLA! all done and feeling confident about burning my ISO now. YOU ROCK!!!


Elisa 12 years ago

BTW, how a newcomer becomes a strong Linux user, Bern3485? ;)
First, using window$, s/he must download an .iso and s/he has probably window$. That's why there is a description and preface to some win but freeware apps ;)


Elisa 12 years ago

Hello Bern, what u exactly mean? There are mentioned some window$ programs due win users can make checks too. So what do you exactly mean or what you don't like ? ;-)


bern3485 12 years ago

Thanx for the utter confusion you have caused in this 73 year old newbie. Why is there so much useless chatter about downloading through window$? If you have a Linux Distro loaded surely you would get additional material from the various Repositories via your linux system as that is the place where compatible stuff is. Using Window$ to download additional material is a bit stupid as it is cumbersome and self defeats the purpose of getting away from costly propriatary crap.


Elisa 12 years ago

Thanx (takk, tack, obrigado, arigato... :D) to all you've liked this simple how-to :)


wanda 12 years ago

Very good tutorial great forms .. many thanks.


zaenal1234 12 years ago

very nice tutorial ..... & also beautiful forms of writing.


romanybob 13 years ago

After all that, all you have to do is open Terminal and type md5sum file. lol. Another example of gui madness ;)


Elisa 13 years ago

@Remoulder: Oh, thanks! :) ...nice to listen that from you ;-))


remoulder 13 years ago

Nice tutorial.