NAME

chksum - Computes the file checksum of a file or files.

chksum [options] file1 {file2 file3 ...}


DESCRIPTION

chksum provides most of the capabilities of the Unix sum and cksum programs. It also implements the MD5 checksum based on the GNU MD5 code implementation all in one package.


Usage

chksum command can be used to compare a suspect file copied or communicated over noisy transmission lines, internet or unpacked from an archive against an exact copy of a trusted file. The comparison made by the command may not be cryptographically secure ; however, it is unlikely that an accidentally damaged file will produce the same checksum as the original file.

chksum was initially written to offer to OpenVMS Users an exact equivalent tool than what already exists (or available as freeware) under Unix system. However, chksum can be compiled on Unix system and provides the same functionality across platform since the available cksum and sum programs seems to give different results and their options have different meaning.


Options

 -b     Computes the BSD checksum, computation with BUFSIZ blocks
 -r     Computes the BSD checksum, computation with 1Kb blocks
 -s     512-byte blocks SYSV compatible
 -o     1Kb blocks SYSV compatible
 -c     Cyclic Redundancy Check (CRC) checksum and number of bytes
        (according to IEEE Std 1003.2-1992 and X/Open CAE)
 -m     Compute MD5 checksum of files according to the definition
        of MD5 in RFC 1321 from April 1992.

Default is -b unless overwritten by the environment variable CHKSUM_OPTION. This variable should be set to one of ``b'',``r'',``s'',``o'',``c'' or ``m''.


Equivalences

 VMS/Unix       Digital Unix    Linux
 ------------------------------------------------
 $ chksum -r    % sum -r        % sum -r
 $ chksum -o    % sum -o        % sum --sysv
 $ chksum -c    see below       % cksum

There are differences between the natice Digital Unix cksum program and the GNU cksum program. chksum is compatible with the GNU version of cksum.


Limitations

The default option is non-portable (depends on your OS BUFSIZ). It has been preserved for backward compatibility purposes only. To change the default option, define the environment variable CHKSUM_OPTION as described in the Options section.

Currently, only the last version of a file can be checksum-ed under VMS OS.


ReturnValue

chksum returns a EXIT_SUCCESS status if no error was found, each +10 correspond to one file open/close error and +1 for each read-error.


VMSNotes

Return value

This return value will produce a VMS cli message which relevance is doubtful AND misleading. We maintained the initial scheme for cross-platform portability reasons i.e. regardless of where you are running chksum, the value returned to the shell can be tested within a script.

Caveat

How did I test this program and what are the caveat ? Well, first, I have tested on both Digital Unix and Linux for consistent results.

Then, I went to the Seti homepage at http://setiathome.ssl.berkeley.edu/ and looked at the different checksum given in http://setiathome.ssl.berkeley.edu/unix.html for alpha_openvms_bck.exe downloaded on a Digital Unix machine. I could reproduce the checksums given there using -m, -r and -c options.

The preceding test failed when the same package was downloaded under an OpenVMS node. U<Don't panic> ! This is normal as explained below.

This missmatch comes from the VMS RMS file attributes and specifically, the missmatch between the 2 OS produced 'Record Format'.

 OSF1 downloaded file : Stream_LF, maximum 0 bytes, longest 0 bytes
 VMS downloaded file  : Fixed length 512 byte records

For a fair comparison, you MUST convert your file to Stream_LF format before using chksum. This can be done by using (OpenVMS 6.2 and above) the following command :

 $ set file/attribute=RFM:STMLF file.ext


Version&Author

This help describes version 1.2* .

The CRC code has been taken from cksum written by Q. Frank Xia, and Copyright (C) 92, 1995-1999 Free Software Foundation, Inc.

The MD5 checksum has been implemented based on the routines provided in the GNU version of MD5.C, written by Written by Ulrich Drepper and Copyright (C) 1995, 1996 Free Software Foundation, Inc.

This software was otherwise written by Jerome LAURET Copyright (c) 1999-2001 under the terms of the GNU GPL.

If you encounter any problem with this utility (other than IO error), please, send me an Email along with a description of what you did and the file you tried to check. Also, please, send comments/suggestions/flame/blame/curses to me. They are all welcomed and will help other people in future by making this software better.

Email : jlauret@mail.chem.sunysb.edu