Sha1sum
Encyclopedia
sha1sum is a computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 that calculates and verifies SHA-1 hashes
Cryptographic hash function
A cryptographic hash function is a deterministic procedure that takes an arbitrary block of data and returns a fixed-size bit string, the hash value, such that an accidental or intentional change to the data will change the hash value...

. It is commonly used to verify the integrity of files. It (or a variant) is installed by default in most Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems. Variants include shasum (which permits SHA-1 through SHA-512 hash functions to be selected manually) and sha224sum, sha256sum, sha384sum and sha512sum, which use a specific SHA-2
SHA-2
In cryptography, SHA-2 is a set of cryptographic hash functions designed by the National Security Agency and published in 2001 by the NIST as a U.S. Federal Information Processing Standard. SHA stands for Secure Hash Algorithm. SHA-2 includes a significant number of changes from its predecessor,...

 hash function. Versions for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 also exist.

Usage

Several source code management systems, including Git
Git (software)
Git is a distributed revision control system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on...

, Mercurial
Mercurial (software)
Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C. It is supported on Windows and Unix-like systems, such as FreeBSD, Mac OS X and Linux...

, Monotone
Monotone (software)
Monotone is an open source software tool for distributed revision control. Monotone tracks revisions to files, groups sets of revisions into changesets, and tracks history across renames.The focus of the project is on integrity over performance...

, and Fossil
Fossil (software)
Fossil is a distributed version control system, bug tracking system and wiki software server for use in software development created by D. Richard Hipp.- Features :...

, use the sha1sum of various types of content (file content, directory trees, ancestry information, etc.) to uniquely identify them.

Example

To create a file with an sha1 hash in it, if one isn't provided execute:

sha1sum filename [filename] ... > SHA1SUM


if you are distributing one file you can append ".sha1" to the filename e.g.:

sha1sum my-zip.tar.gz > my-zip.tar.gz.sha1


To verify the file was downloaded correctly you can execute:

sha1sum -c SHA1SUM
  1. filename: OK
  2. filename...: OK



and


sha1sum -c my-zip.tar.gz.sha1
  1. my-zip.tar.gz: OK



respectively

See also

  • cksum
    Cksum
    cksum' is a command in Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads each file given in its arguments, or standard input if no arguments are provided, and outputs the file's CRC checksum and byte count.The cksum command can be...

  • md5sum
    Md5sum
    md5sum is a computer program that calculates and verifies 128-bit MD5 hashes, as described in RFC 1321. The MD5 hash functions as a compact digital fingerprint of a file. As with all such hashing algorithms, there is theoretically an unlimited number of files that will have any given MD5 hash...

  • md5deep
    Md5deep
    md5deep is a software package used in the computer security, system administration and computer forensics communities for purposes of running large numbers of files through any of several different cryptographic digests...

  • Comparison of file verification software
    Comparison of file verification software
    The following tables compare file verification software that typically use checksums to confirm the integrity or authenticity of a file.- General :- Program hash function support :- Program features :...

  • GNU Core Utilities
    GNU Core Utilities
    The GNU Core Utilities or coreutils is a package of GNU software containing many of the basic tools, such as cat, ls, and rm, needed for Unix-like operating systems...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK