File verification

A file can become corrupted by a variety of ways: faulty storage media, errors in transmission, write errors during copying or moving, software bugs, and so on.

Due to the nature of hash functions, hash collisions may result in false positives, but the likelihood of collisions is often negligible with random corruption.

It is often desirable to verify that a file hasn't been modified in transmission or storage by untrusted parties, for example, to include malicious code such as viruses or backdoors.

As long as the hash sums cannot be tampered with — for example, if they are communicated over a secure channel — the files can be presumed to be intact.

Alternatively, digital signatures can be employed to assure tamper resistance.