Checksum
In computer technology and telecommunication, a checksum is a form of redundancy check, a very simple measure for protecting the integrity of data through error detection. It is used mainly in data storage and networking protocols. It works by adding up the basic components of a message, typically the bytes, and storing the resulting value. Later, anyone who has the authentic checksum can verify that the message was not corrupted by doing the same operation on the data, and checking the sum.The simplest form of checksum, which simply adds up the bytes in the data, cannot detect a number of types of errors. In particular, such a checksum is not changed by:
- reordering of the bytes in the message
- inserting or deleting zero-valued bytes
- multiple errors that cancel
These types of redundancy check are useful in detecting accidental modification such as corruption to stored data or errors in a communication channel. However, they provide no security against a malicious agent as their simple mathematical structure makes them trivial to circumvent. To provide this level of integrity, the use of cryptographic message digest algorithms such as SHA-1 or MD5 is necessary.
On UNIX there is a tool called "cksum" that generates both a 32 bit CRC and a byte count for any given input file.