


Retrieving the hash from the same site you're downloading the files from doesn't guarantee anything. If you plan to use a hash to verify a file, you must obtain the hash from a separate trusted source. Using a cryptographic hash to verify integrity SHA256 is commonly used today, and is safe against both. MD5 and SHA1 are both broken in regard to collisions, but are safe against preimage attacks (due to the birthday paradox collisions are much easier to generate). Collision resistance means that it isn't feasible to create two files that have the same hash, and preimage resistance means that it isn't feasible to create a file with the same hash as a specific target file. What is a cryptographic hash?Ĭryptographic hashes provide additional properties over simple checksums (all cryptographic hashes can be used as checksums, but not all checksums are cryptographic hashes).Ĭryptographic hashes (that aren't broken or weak) provide collision and preimage resistance. Examples of checksums are CRCs, Adler-32, XOR (parity byte(s)). In general a checksum provides no guarantee that intentional modifications weren't made, and in many cases it is trivial to change the file while still having the same checksum. What is a checksum?Ī checksum simply verifies with a high degree of confidence that there was no corruption causing a copied file to differ from the original (for varying definitions of "high"). Some older and less secure algorithms include SHA-1 and md5.You mention checksums, PGP, and SHA in your question title, but these are all different things. Currently, the SHA-256 and SHA-512 are the most popular algorithm to use. There are different algorithms that can be used to determine a checksum. This gives the downloader a way to confirm they downloaded the intended file (not a malicious modified version instead). Often when a webpage includes a link to download a file, the checksum will also be listed. This allows a quick way to ensure a file has not be modified. If the file is modified, the resulting checksum will be different. A file is processed through a known algorithm which results in the checksum, a.k.a “hash”, which is a string of letters and numbers unique to that file, e.g. The checksum is like a fingerprint for the file.
