CKSUM(1) | General Commands Manual | CKSUM(1) |
cksum
— display
file checksums and block counts
cksum |
[-bcpqrtx ]
[-a algorithms]
[-C checklist]
[-h hashfile]
[-s string]
[file ...] |
The cksum
utility writes to the standard
output a single line for each input file. The format of this line varies
with the algorithm being used as follows:
The options are as follows:
-a
algorithms-a
options may be specified on the command line. Case is ignored when
matching algorithms. The output format may be specified on a per-algorithm
basis by using a single-character suffix, e.g. “sha256b”. If
the algorithm has a ‘b’ suffix, the checksum will be output
in base64 format. If the algorithm has an ‘x’ suffix, the
checksum will be output in hex format. If an algorithm with the same
output format is repeated, only the first instance is used. Note that
output format suffixes are not supported for the cksum algorithm.-b
-C
checklist-c
-c
option may not be used in conjunction with more
than a single -a
option.-h
hashfile-p
-q
-c
flag, only print the failed cases.-r
-s
string-t
-t
multiple
times results in the number of rounds being multiplied by 10 for each
additional flag.-x
The default CRC used is based on the polynomial used for CRC error checking in the networking standard ISO/IEC 8802-3:1996. The other available algorithms are described in their respective man pages in section 3 of the manual.
The cksum
utility exits 0 on
success, and >0 if an error occurs.
The default calculation is identical to that given in pseudo-code in the following ACM article:
Dilip V. Sarwate, Computation of Cyclic Redundancy Checks Via Table Lookup, Communications of the ACM, August 1988.
The cksum
utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
specification.
All the flags are extensions to that specification.
The cksum
utility appeared in
4.4BSD.
Do not use the cksum or md5 algorithms to verify file integrity. An attacker can trivially produce modified payload that has the same checksum as the original version. Use a cryptographic checksum instead.
September 3, 2016 | OpenBSD-6.8 |