Vous êtes sur la page 1sur 3

Checksum - Wikipedia, the free encyclopedia

https://en.wikipedia.org/wiki/Checksum

Checksum
From Wikipedia, the free encyclopedia

A checksum or hash sum is a small-size datum from a block of digital data for the
purpose of detecting errors which may have been introduced during its transmission
or storage. It is usually applied to an installation file after it is received from the
download server. By themselves checksums are often used to verify data integrity,
but should not be relied upon to also verify data authenticity.
The actual procedure which yields the checksum, given a data input is called a
checksum function or checksum algorithm. Depending on its design goals, a
good checksum algorithm will usually output a significantly different value, even
for small changes made to the input. This is especially true of cryptographic hash
functions, which may be used to detect many data corruption errors and verify
overall data integrity; if the computed checksum for the current data input matches
the stored value of a previously computed checksum, there is a very high
probability the data has not been accidentally altered or corrupted.
Checksum functions are related to hash functions, fingerprints, randomization
functions, and cryptographic hash functions. However, each of those concepts has
different applications and therefore different design goals. Checksums are used as
cryptographic primitives in larger authentication algorithms. For cryptographic
systems with these two specific design goals, see HMAC.

Effect of a typical checksum function (the Unix cksum


utility)

Check digits and parity bits are special cases of checksums, appropriate for small
blocks of data (such as Social Security numbers, bank account numbers, computer words, single bytes, etc.). Some error-correcting codes
are based on special checksums which not only detect common errors but also allow the original data to be recovered in certain cases.

Contents
1 Checksum algorithms
1.1 Parity byte or parity word
1.2 Modular sum
1.3 Position-dependent checksums
1.4 General considerations
2 See also
3 References
4 External links

Checksum algorithms
Parity byte or parity word
The simplest checksum algorithm is the so-called longitudinal parity check, which breaks the data into "words" with a fixed number n of
bits, and then computes the exclusive or of all those words. The result is appended to the message as an extra word.To check the integrity of
a message, the receiver computes the exclusive or (XOR) of all its words, including the checksum; if the result is not a word with n zeros,
the receiver knows a transmission error occurred.
With this checksum, any transmission error which flips a single bit of the message, or an odd number of bits, will be detected as an incorrect
checksum. However, an error which affects two bits will not be detected if those bits lie at the same position in two distinct words. Also
swapping of two or more words will not be detected. If the affected bits are independently chosen at random, the probability of a two-bit
error being undetected is 1/n.

Modular sum
A variant of the previous algorithm is to add all the "words" as unsigned binary numbers, discarding any overflow bits, and append the two's
complement of the total as the checksum. To validate a message, the receiver adds all the words in the same manner, including the
checksum; if the result is not a word full of zeros, an error must have occurred. This variant too detects any single-bit error, but the

1 of 3

19-06-2015 17:23

Checksum - Wikipedia, the free encyclopedia

https://en.wikipedia.org/wiki/Checksum

promodular sum is used in SAE J1708.[1]

Position-dependent checksums
The simple checksums described above fail to detect some common errors which affect many bits at once, such as changing the order of
data words, or inserting or deleting words with all bits set to zero. The checksum algorithms most used in practice, such as Fletcher's
checksum, Adler-32, and cyclic redundancy checks (CRCs), address these weaknesses by considering not only the value of each word but
also its position in the sequence. This feature generally increases the cost of computing the checksum.

General considerations
A single-bit transmission error then corresponds to a displacement from a valid corner (the correct message and checksum) to one of the m
adjacent corners. An error which affects k bits moves the message to a corner which is k steps removed from its correct corner. The goal of a
good checksum algorithm is to spread the valid corners as far from each other as possible, so as to increase the likelihood "typical"
transmission errors will end up in an invalid corner.

See also
General topic
Algorithm
Bit rot
Check digit
Damm algorithm
File verification
Fletcher's checksum
Frame check sequence
cksum
md5sum
sha1sum
Parchive
sum
SYSV checksum
BSD checksum
Error correction
Hamming code
IPv4 header checksum
Hash functions
List of hash functions
Luhn algorithm
Parity bit
Rolling checksum
Verhoeff algorithm
ZFS a file system which performs automatic file integrity checking using checksums

References
1. "SAE J1708" (http://web.archive.org/web/20131211152639/http://www.kvaser.com/zh/about-can/related-protocols-and-standards/50.html).
Kvaser.com. Archived from the original (http://www.kvaser.com/zh/about-can/related-protocols-and-standards/50.html) on 11 December 2013.

External links
Additive Checksums (C) (http://www.netrino.com/Embedded-Systems/How-To/AdditiveChecksums) theory from Barr Group
checksum (http://corz.org/windows/software/checksum), a fast file, folder and drive hashing
application for Windows, which computes MD5, SHA-1 and BLAKE2 hashes.

2 of 3

The Wikibook Algorithm


Implementation has a page
on the topic of:

19-06-2015 17:23

Checksum - Wikipedia, the free encyclopedia

https://en.wikipedia.org/wiki/Checksum

CHK Checksum Utility (http://compressme.net/) - an advanced checksum tool


Checksums
File Checksum Utility (https://www.blq-software.com/FileChecksumUtility/index-EN.html) Calculate MD5, SHA1, SHA256 and SHA512 Hashes
MD5 and SHA-1 tool (http://support.microsoft.com/kb/841290) from Microsoft.com
Jacksum (http://www.jonelo.de/java/jacksum/index.html), is a Java-based application that supports a large number of algorithms for
computing and verifying checksums, CRCs and message digests
RHash (http://rhash.anz.ru/), a C-based application which supports recursion and many other unique features
jdigest (http://code.google.com/p/jdigest/), a Java-based tool from Google which works MD5 and SHA sums for Windows via rightclicking
Hash Generator and Validation Tool (Hash) (http://www.richherrick.com/software/hash/index.html), a command-prompt utility which
will generate/validate several types of hash values for multiple files and directory trees.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Checksum&oldid=667488307"
Categories: Checksum algorithms
This page was last modified on 18 June 2015, at 13:32.
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you
agree to the Terms of Use and Privacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit
organization.

3 of 3

19-06-2015 17:23

Vous aimerez peut-être aussi