sha1sum
Page Module:Message box/ambox.css has no content.
Page Module:Message box/ambox.css has no content.Page Template:Multiple issues/styles.css has no content.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
Page Module:Message box/ambox.css has no content.
|
Page Template:Mono/styles.css has no content.sha1sum is a computer program that calculates and verifies SHA-1 hashes. It is commonly used to verify the integrity of files. It (or a variant) is installed by default on most Linux distributions. Typically distributed alongside sha1sum are Page Template:Mono/styles.css has no content.sha224sum, Page Template:Mono/styles.css has no content.sha256sum, Page Template:Mono/styles.css has no content.sha384sum and Page Template:Mono/styles.css has no content.sha512sum, which use a specific SHA-2 hash function and Page Template:Mono/styles.css has no content.b2sum,[1] which uses the BLAKE2 cryptographic hash function.
The SHA-1 variants are proven vulnerable to collision attacks, and users should instead use, for example, a SHA-2 variant such as Page Template:Mono/styles.css has no content.sha256sum or the BLAKE2 variant Page Template:Mono/styles.css has no content.b2sum to prevent tampering by an adversary.[2][3]
It is included in GNU Core Utilities,[4] Busybox (excluding Page Template:Mono/styles.css has no content.b2sum),[5] and Toybox (excluding Page Template:Mono/styles.css has no content.b2sum).[6] Ports to a wide variety of systems are available, including Microsoft Windows.
Examples
To create a file with a SHA-1 hash in it, if one is not provided:
$ sha1sum filename [filename2] ... > SHA1SUM
If distributing one file, the Page Template:Mono/styles.css has no content..sha1 file extension may be appended to the filename e.g.:
$ sha1sum --binary my-zip.tar.gz > my-zip.tar.gz.sha1
The output contains one line per file of the form "{hash} SPACE (ASTERISK|SPACE) [{directory} SLASH] {filename}". (Note well, if the hash digest creation is performed in text mode instead of binary mode, then there will be two space characters instead of a single space character and an asterisk.) For example:
$ sha1sum -b my-zip.tar.gz
d5db29cd03a2ed055086cef9c31c252b4587d6d0 *my-zip.tar.gz
$ sha1sum -b subdir/filename2
55086cef9c87d6d031cd5db29cd03a2ed0252b45 *subdir/filename2
To verify that a file was downloaded correctly or that it has not been tampered with:
$ sha1sum -c SHA1SUM
filename: OK
filename2: OK
$ sha1sum -c my-zip.tar.gz.sha1
my-zip.tar.gz: OK
Hash file trees
Page Template:Mono/styles.css has no content.sha1sum can only create checksums of one or multiple files inside a directory, but not of a directory tree, i.e. of subdirectories, sub-subdirectories, etc. and the files they contain. This is possible by using Page Template:Mono/styles.css has no content.sha1sum in combination with the find command with the -exec option, or by piping the output from Page Template:Mono/styles.css has no content.find into xargs. Page Template:Mono/styles.css has no content.sha1deep can create checksums of a directory tree.
To use Page Template:Mono/styles.css has no content.sha1sum with Page Template:Mono/styles.css has no content.find:
$ find s_* -type f -exec sha1sum '{}' \;
65c23f142ff6bcfdddeccebc0e5e63c41c9c1721 s_1/file_s11
d3d59905cf5fc930cd4bf5b709d5ffdbaa9443b2 s_2/file_s21
5590e00ea904568199b86aee4b770fb1b5645ab8 s_a/file_02
Likewise, piping the output from Page Template:Mono/styles.css has no content.find into Page Template:Mono/styles.css has no content.xargs yields the same output:
$ find s_* -type f | xargs sha1sum
65c23f142ff6bcfdddeccebc0e5e63c41c9c1721 s_1/file_s11
d3d59905cf5fc930cd4bf5b709d5ffdbaa9443b2 s_2/file_s21
5590e00ea904568199b86aee4b770fb1b5645ab8 s_a/file_02
Related programs
- Page Template:Mono/styles.css has no content.shasum is a Perl program to calculate any of SHA-1, 224, 256, 384, 512 hashes.[7] It is part of the ActivePerl distribution.
- Page Template:Mono/styles.css has no content.sha3sum is a similarly named program that calculates SHA-3, HAKE, RawSHAKE, and Keccak functions.[8]
- The Page Template:Mono/styles.css has no content.<hash>sum naming convention is also used by the BLAKE team with
b2sumandb3sum, by the programtthsum, and many others. - On FreeBSD and OpenBSD, the utilities are called Page Template:Mono/styles.css has no content.md5, Page Template:Mono/styles.css has no content.sha1, Page Template:Mono/styles.css has no content.sha256, and Page Template:Mono/styles.css has no content.sha512. These versions offer slightly different options and features. Additionally, FreeBSD offers the Skein family of message digests.[9]
See also
- Page Template:Mono/styles.css has no content.cksum
- Page Template:Mono/styles.css has no content.md5sum
- Page Template:Mono/styles.css has no content.md5deep
- GNU Core Utilities
References
Page Template:Reflist/styles.css has no content.
- ^ Page Module:Citation/CS1/styles.css has no content."b2sum source code in GNU coreutils". GNU coreutils mirror at GitHub. Retrieved 29 Jan 2022.
- ^ Page Module:Citation/CS1/styles.css has no content.Bruce Schneier. "Cryptanalysis of SHA-1". Schneier on Security.
- ^ Page Module:Citation/CS1/styles.css has no content."Announcing the first SHA1 collision".
- ^ Page Module:Citation/CS1/styles.css has no content."Sha1sum invocation (GNU Coreutils 9.0)".
- ^ Page Module:Citation/CS1/styles.css has no content."Mirror/Busybox". GitHub. 26 October 2021.
- ^ Page Module:Citation/CS1/styles.css has no content."Landley/Toybox". GitHub. 26 October 2021.
- ^ Template:Man
- ^ Template:Man
- ^ Template:Man