# Checksum A **checksum** is a small-sized [block](https://en.wikipedia.org/wiki/Block_(data_storage) "Block (data storage)") of data derived from another block of [digital data](https://en.wikipedia.org/wiki/Digital_data "Digital data") for the purpose of [detecting errors](https://en.wikipedia.org/wiki/Error_detection "Error detection") that may have been introduced during its [transmission](https://en.wikipedia.org/wiki/Telecommunication "Telecommunication") or [storage](https://en.wikipedia.org/wiki/Computer_storage "Computer storage"). By themselves, checksums are often used to verify data integrity but are not relied upon to verify data [authenticity](https://en.wikipedia.org/wiki/Authentication "Authentication"). The [procedure](https://en.wikipedia.org/wiki/Algorithm "Algorithm") which generates this checksum is called a **checksum function** or **[checksum algorithm](https://en.wikipedia.org/wiki/Checksum_algorithm "Checksum algorithm")**. Depending on its design goals, a good checksum algorithm usually outputs a significantly different value, even for small changes made to the input. This is especially true of [cryptographic hash functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function "Cryptographic hash function"), which may be used to detect many data corruption errors and verify overall [data integrity](https://en.wikipedia.org/wiki/Data_integrity "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. ![](https://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Checksum.svg/2880px-Checksum.svg.png) ### Intuition Think of a checksum as taking in a file (could be 1 MB or 5 GB, any size really) and outputting a hash (via some algorithm such as SHA-256). Due to the nature of hash functions (and certainly cryptographic hash functions) small changes in the input will result in *large changes in the output* (as a note, this is because hash functions are *highly nonlinear*, i.e. they are *non-differentiable*). This is useful if you want to show that a file has not been tampered with. If you send the file and the checksum to another person, they can run the hash algorithm on the file and see if the resulting checksum matches that which you sent them. If it does not then they know some sort of tampering has occurred. --- Date: 20210623 Links to: [Computer Science MOC](Computer%20Science%20MOC.md) References: * [What is a checksum?](https://www.youtube.com/watch?v=gzLgT1SVW0Q)