fchksum(1) - Linux man page

Name

chksum - Checksum calculator

Synopsys

chksum <options> <file(s)>
chksum -c <options> <file(s)>

Description

The chksum program builds checksums for files (build mode) and compares file checksums against a checksum list (check mode).

Two steps are used to build a checksum:

• Binary message digest
A binary message digest is created using one of the following algorithms: MD5 , RIPEMD-160 , SHA-1 (default), SHA-224 , SHA-256 , SHA-384 or SHA-512 .
• Text representation
A text representation of the message data is created using one of the following encodings: ASCII-Hex, ASCII-85 (default) or reverse ASCII-85 .

Options

-h

shows a help text.

Long option: --help
-v

shows version information.

Long option: --version
-m digest
chooses a message digest algorithm, one from: MD5 , RIPEMD-160 , SHA-1 , SHA-224 , SHA-256 , SHA-384 or SHA-512 .

SHA-1 is the default message digest algorithm.

Long option: --message-digest=digest

-e encoding
selects an encoding mechanism to convert binary data to text, one from: HEX (to choose ASCII-Hex encoding), ASCII-85 (to choose ASCII-85 encoding) or REVERSE-ASCII-85 (to choose reverse ASCII-85 encoding).

The abbreviations A85 and R-ASCII-85 or RA85 can be used instead of ASCII-85 and REVERSE-ASCII-85 .

ASCII-85 is the default encoding.

Long option: --encoding=encoding

-l

indicates that the files specified on the command line are lists of file names instead of files to build checksums directly (in build mode only).

Long option: --list
-n

turns off header line printing in build mode. If this option is not used the first output line is a control line indicating the message digest type and the binary-to-text encoding used.

Long option: --no-header
-c

switches to check mode. The files specified on the command line (or standard input if no file name is specified) contain checksum lists produced formerly by chksum in build mode.

Long option: --check
-q

suppresses informational messages about succeeded tests in check mode.

Long option: --quiet
-s

suppresses messages about succeeded tests and failed tests in check mode. The exit status indicates whether or not there were failed tests.

Long option: --status
-o

indicates that the check lists were produced by md5sum, not chksum.

Long option: --md5sum

Return Value

The program sets the exit status as follows:

• 0 indicates success

• 1 A checksum mismatch was found.

• 2 Wrong options or syntax error.

• 3 Attempt to handle a directory.

• 4 Attempt to handle an illegal/unknown file type.

• 5 The stat() function failed for a file.

• 6 Failed to open file for reading.

• 7 Problems to create a checksum.

• 8 The message digest is not supported here.

Diagnostics

ERROR - Unknown digest type ...!
The digest type must be '' MD5 '', '' RIPEMD-160 '', '' SHA-1 '', '' SHA-224 '', '' SHA-256 '', '' SHA-384 '' or '' SHA-512 ''.
ERROR - long option ... needs an argument!
An argument (digest type or encoding mechanism is needed by the long option.
ERROR - Unknown encoding ...!
The encoding mechanism must be '' HEX '', '' ASCII-85 '' or ''R-ASCII-85''.
ERROR - Unknown long option ...!
A wrong long option was used.
ERROR - Long option ... too long!
A long option including the argument must not exceed 1024 characters.
ERROR - Unknown option ...!
This option can not be used by the chksum program.
ERROR - Can not handle directories!
One of the file names points to a directory, not a regular file.
• Warning - Creating checksum for a device!
One of the file names points to a device, not a regular file. Checksumming may be useful for some devices (i.e. /dev/hda) but not for others (i.e. /dev/null or /dev/random).
ERROR - Illegal file type!
The file name points to a file of illegal type (not a regular file).
ERROR - Failed to obtain information about file!
The stat64() or stat() function failed to obtain information about a file. Most likely the file does not exist.
ERROR - Failed to open file for reading!
The file can not be opened for reading (probably a permissions problem).
• Syntax error!
A check list line does not contain checksum and file name as expected.
• Syntax error - Not a key=value pair!
A control line in a check list is not a key=value pair as expected.
• Syntax error - Value text is missing!
A control line in a check list only contains ''key='' but no value!
• Syntax error - Unknown instruction ...!
A control line in a check list contains a wrong key.
• Syntax error - Missing encoding!
A control line for digest/encoding in a check list contains only a digest, not an encoding.
WARNING ... of ... computed checksums did NOT match!
There were checksum mismatches!
• Pipe skipped.
One of the file names points to a pipe.
ERROR - Failed to create checksum!
There was a problem, no checksum can be created for that file.
ERROR - Message digest type ... not implemented!
While building the chksum program an OpenSSL library version was used without support for the specified message digest algorithm.
ERROR - ... files skipped (message digest not implemented)!
While building the chksum program an OpenSSL library version was used without support for the specified message digest algorithm.

See Also

http://dktools.sourceforge.net/fchksum.html

Author

Dirk Krause

Copyright And License

Copyright © - 2009, Dirk Krause All rights resrved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above
  copyright notice, this list of conditions and the
  following disclaimer.

* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the following
  disclaimer in the documentation and/or other materials
  provided with the distribution.

* Neither the name of the Dirk Krause nor the names of
  contributors may be used to endorse or promote products
  derived from this software without specific prior written
  permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .

This program uses the OpenSSL library, see http://www.openssl.org.

This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).

History

2009-02-08: First version finished, tested on Solaris and Linux.