- Sha1sum
sha1sum is a
computer program which calculates and verifies SHA-1 hashes. It is commonly used to verify the integrity of files. It (or a variant) is installed by default in mostUnix-like operating systems , includingMac OS X . Variants include shasum (which permits SHA1 through SHA512 hash functions to be selected manually) and sha224sum, sha256sum, sha384sum and sha512sum, which use a specific larger hash function than SHA-1. Versions forMicrosoft Windows also exist.Some cryptographical weaknesses have been found in
SHA1 .Fact|date=September 2008 However, sha1sum is still usable for general-purpose filechecksum ming, and is widely considered more secure thanMD5 or a CRC.Fact|date=September 2008Usage
To calculate the SHA1 hash of a file, simply give the filename as an argument to
sha1sum
.$ sha1sum somefile da39a3ee5e6b4b0d3255bfef95601890afd80709 somefile
The output of
sha1sum
can be saved into a text file and used to verify the integrity of a file. If the output above is stored in the filesomefile.sha1
, the following command will compare the SHA1 hash ofsomefile
with the hash stored insomefile.sha1
.$ sha1sum -c somefile.sha1 somefile: OK
The
sha1sum
command can also be used in an interactive mode to calculate the SHA1 hash of any arbitrary string of characters. After typing thesha1sum
command without any arguments, type the string of characters in the terminal. End the string with anEnd-of-file character. The SHA1 hash will be displayed on the terminal next to the input string. For example:$ sha1sum somestring CTRL+D CTRL+D
will result in the following output.
$ sha1sum somestringda63fb69aeb03c776bd23e91e2c1cb3df30135d3 -
See also
*
GNU Core Utilities
*md5sum
*cksum External links
* [http://www.linuxmanpages.com/man1/sha1sum.1.php The program's man page]
* [ftp://ftp.gnupg.org/gcrypt/binary/sha1sum.exe An implementation for Microsoft Windows]
* [http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/binary/sha1sum.exe Mirror for Windows version]
* [http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/binary/sha1sum.c Mirror for Windows version C sourcecode]
*The sha1sum program is part of theGNU Core Utilities package
* [http://www.slavasoft.com/fsum/ SlavaSoft FSUM - Fast File Integrity Checker]
* [http://jsummer.sourceforge.net/ JSummer] - a platform independent open source message digest tool for Unix/Linux and Windows with a GUI supporting sha1sum and other algorithms.
Wikimedia Foundation. 2010.