|CKSUM(1)||General Commands Manual||CKSUM(1)|
cksum — display
file checksums and block counts
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:
-aoptions 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.
-coption may not be used in conjunction with more than a single
-cflag, only print the failed cases.
-tmultiple times results in the number of rounds being multiplied by 10 for each additional flag.
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.
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.
cksum utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
All the flags are extensions to that specification.
cksum utility appeared in
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-current|