02 / File fingerprints · General technology reading
A fingerprint for a file
A cryptographic hash turns a sequence of bytes into a fixed-length result. That result is often called a digest: a compact value that helps compare content without displaying the content itself.
Content, rather than the label
A hash calculation follows a defined algorithm. The same input produces the same digest. Renaming a file does not ordinarily change its contents or their digest. Editing the file changes the input to the calculation.
In a hypothetical download check, a publisher supplies a digest and a reader calculates one from the downloaded file. Comparing the complete values helps identify whether the downloaded bytes match the expected content. Both calculations must use the same algorithm and the same input boundaries.
A match has limits
A fixed-length digest has a finite set of possible values, while files can have many more possible contents. Different inputs can therefore share a digest; this is a collision. Cryptographic designs aim to make finding such collisions difficult, rather than making them mathematically impossible.
A digest also does not identify who supplied a file. If an attacker can replace both a download and the expected digest beside it, the two may still agree. Establishing a trustworthy source requires additional mechanisms. Integrity comparison alone is not proof of authorship.
Ask what was checked
A verification record names the algorithm, identifies the file and explains where the expected value came from. A successful comparison is not a broader judgment about safety. A correctly transferred program can still behave in an unwanted way.
A digest cannot reconstruct the original file for later recovery. Compression needs a reconstruction method, while a backup needs an actual recoverable copy. File fingerprints answer a different question.
Further reading: IBM: cryptography and hash functions. An external educational reference.