Skip to main content

md5sum example

5 Practical “md5sum” Command Usage Examples in Linux

This tutorial explains Linux “md5sum” command, options and its usage with examples.
“md5sum” command is used to compute and check MD5 message digest. This post describes “md5sum” command used in Linux along with usage examples and/or output. Usage:
md5sum [OPTION]… [FILE]…
The MD5 message-digest algorithm is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value.Two non identical files will never have the same md5sum value.However, it has since been shown that MD5 is not collision resistant;[3] as such, MD5 is not suitable for applications like SSL certificates or digital signatures that rely on this property.
Here’s the listing of example usage of “md5sum” command:
1. To calculate md5sum(md5sum file_path):
sanfoundry-> md5sum out.txt 
fa328c3f84352dc7ff5e32bba2ac833c  out.txt
Note
md5sum command is not usable for the directories.
2. To compute and verify checksum of files(md5sum -c file_path):
sanfoundry-> md5sum *.txt 
d41d8cd98f00b204e9800998ecf8427e  1.txt
743268534af6fb128bf4dd7f4914b1c8  2.txt
d41d8cd98f00b204e9800998ecf8427e  link.txt
fa328c3f84352dc7ff5e32bba2ac833c  out.txt
sanfoundry-> md5sum *.txt > x.md5
sanfoundry-> md5sum -c x.md5 
1.txt: OK
2.txt: OK
link.txt: OK
out.txt: OK
“-c” option checks the status of the files and if there is any change it gives error.
sanfoundry-> vi 1.txt 
sanfoundry-> md5sum -c x.md5 
1.txt: FAILED
2.txt: OK
link.txt: OK
out.txt: OK
md5sum: WARNING: 2 computed checksums did NOT match
If link.txt is the link file of 1.txt then it also get changed and md5sum also FAILED to cross verify it.
sanfoundry-> vi 1.txt 
sanfoundry-> md5sum -c x.md5 
1.txt: FAILED
2.txt: OK
link.txt: FAILED
out.txt: OK
md5sum: WARNING: 2 computed checksums did NOT match
3. To read in binary mode(md5sum -b file_path):
sanfoundry-> md5sum 1.txt 
764efa883dda1e11db47671c4a3bbd9e  1.txt
sanfoundry-> md5sum -b 1.txt 
764efa883dda1e11db47671c4a3bbd9e *1.txt
sanfoundry-> md5sum --binary 1.txt 
764efa883dda1e11db47671c4a3bbd9e *1.txt
“-b” option is equivalent to “–binary” option.
Treat all input files as binary. This normally does not make any difference on UN*X systems but some systems have a different internal and external representation of texts (especially the end-of-line characters).
4. To read in text mode(md5sum -t file_path):
Treat all input files as text files. This is the reverse option to –binary.
sanfoundry-> md5sum -t 1.txt 
764efa883dda1e11db47671c4a3bbd9e  1.txt
5. To print version information on standard output then exit(md5sum -v):
sanfoundry-> md5sum --version
md5sum (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
 

Comments

Popular posts from this blog

Wordpress hacking - How to install / run wpscan on windows xp / windows 7 / windows 10

HOW TO RUN WPSCAN ON WINDOWS Byrockstardevil Requirements: rubyinstaller Development Kit for rubyinstaller curl DLL for windows : libcurl.dll 1 - install rubyinstaller you must have Ruby 2.2.3 version . download links here : http://rubyinstaller.org/downloads/ for more info : https://github.com/oneclick/rubyinstaller/wiki 2 - install Development Kit for rubyinstaller download link : http://rubyinstaller.org/downloads/ how to install : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit if you face that problem  "unknown encoding name -  (ArgumentError)" just type "chcp 1252" in cmd and hit enter 3 - install libcurl.dll A - Download libcurl.dll from : http://www.confusedbycode.com/curl/ B - copy libcurl.dll copy  libcurl.dll into ruby bin folder or wpscan folder and make sure to add it to your PATH. I also added .DLL to PATHEXT ex : C:\Ruby21-x64\bin\ you can visit : http://www.computerhope.com/issues/ch000549.htm to know to set the p...

Upcoming Book- Kali Linux Revealed: Mastering the Penetration Testing Distribution

More exciting news! In the past year, Kali Linux Official Team has been working internally on an Official Kali Linux book – Kali Linux Revealed: Mastering the Penetration Testing Distribution . This is the first official Kali book from Offsec Press , and is scheduled for release on June 5th, 2017 . Kali Linux Revealed will be available in both hard copy and online formats. Keeping the Kali Linux spirit, the online version of the book will be free of charge, allowing anyone who wishes to hone their skills and improve their knowledge of Kali to do so at no cost. This book, together with our official Kali documentation site will encompass the body of knowledge for the Kali Linux Certified Professional   (KLCP) .

EOF of Kali Linux 1.0

Kali Sana (ver. 2.0) has been out there couple of months ago and the response was great. Kali Moto (ver. 1.0) has been given 2 months of grace period to date the version to 2.0. To upgrade, edit the souces.list file and put the following entries. cat >> EOF < /etc/apt/sources.list deb http://http.kali.org/kali sana main non-free contrib deb http://security.kali.org/kali-security/ sana/updates main contrib non-free EOF Then, run the following command to do upgrade Kali Moto to Kali Sana. apt-get update apt-get dist-upgrade # get a coffee, or 10. reboot