
One File Matched, One Didn't: Hash Comparison as a Forensic Tripwire
The previous lab in this module was about looking a hash up against the outside world, checking a suspicious file against VirusTotal's malware database. This one flipped the direction entirely: comparing a file's current hash against a hash you already trust, recorded earlier, to answer a narrower but equally important question. Not "is this malicious," but "is this still the exact same file it was before."
The previous lab in this module was about looking a hash up against the outside world, checking a suspicious file against VirusTotal's malware database. This one flipped the direction entirely: comparing a file's current hash against a hash you already trust, recorded earlier, to answer a narrower but equally important question. Not "is this malicious," but "is this still the exact same file it was before." Working through it with two different evidence images, one that matched and one that didn't, made the practical value of that distinction concrete rather than theoretical.
The Forensic Problem Being Solved
The scenario was specific: an investigator has copies of files suspected to have been modified, and needs to verify whether their integrity has actually been preserved, by comparing their current hash values against pre-existing hash values recorded before any possible tampering occurred. That pre-existing record is exactly what a chain of custody in forensics is supposed to provide: a trustworthy baseline, captured at a known point in time, that anything collected later can be checked against.
In this lab, that baseline existed as a simple text file,
Hashes.txt , sitting alongside the evidence images, containing the known-good MD5 hash values for several files as they existed at some earlier, trusted point.Using MD5 Calculator Directly From the File System
After installing MD5 Calculator, the workflow was notably more streamlined than the previous lab's approach. Rather than opening a standalone application and manually browsing to a file, MD5 Calculator integrates directly into the Windows right-click context menu. Selecting an evidence file and choosing MD5 Calculator from that menu immediately computed and displayed the file's MD5 digest, no separate file-picker dialog required.
That workflow detail matters more than it might seem. A tool an investigator reaches for constantly benefits from minimizing friction, fewer steps between "I need this file's hash" and "I have this file's hash" means fewer opportunities for error and a faster, more consistent process across potentially dozens or hundreds of files in a real investigation.
Comparing Against a Known-Good Value
The tool's actual comparison feature is what made this exercise different from simply calculating a hash in isolation. MD5 Calculator includes a Compare To field: paste in a previously known hash value, and the tool computes the current file's hash and checks it against that pasted value directly, reporting a match or mismatch immediately rather than leaving you to eyeball two long hexadecimal strings and compare them by hand.
That last point is worth sitting with. MD5 hashes are 32-character hexadecimal strings. Manually comparing two of those character by character is exactly the kind of tedious, error-prone task a human is bad at and a computer is trivially good at, a single transposed character deep in the middle of the string is nearly impossible to catch by eye but would represent a completely different file if actually mismatched. Automating that comparison isn't a convenience feature, it's what makes the check actually reliable.
Testing Two Files: One Confirms, One Flags
The lab had me run this comparison against two separate evidence files, deliberately chosen to produce two different outcomes.
Kitty.jpg : I copied its recorded hash from Hashes.txt , computed its current MD5 hash with the calculator, pasted the known value into Compare To, and got a match. The file's integrity was confirmed, it was provably identical, bit for bit, to the version whose hash had been recorded earlier.Model.png : Same process, same source for the known-good hash, but this time the comparison returned a mismatch. The current file's hash didn't match the value recorded in Hashes.txt .That mismatch isn't a tool malfunction or an error to troubleshoot, it's the actual finding. It means the file currently sitting in that evidence folder is not byte-for-byte identical to whatever existed when that original hash was recorded. Something changed, and a hash mismatch alone can't tell you what changed, or why, only that something did. The lab material flagged this directly: a file failing hash comparison needs further investigation, and specifically pointed toward a later module on anti-forensics techniques, since a file's integrity failing a hash check can indicate something as deliberate as using the file as a payload for an attack, or hiding data inside it through steganography or similar techniques.
Why This Specific Comparison Matters in Practice
A few things stood out about why hash comparison against a known baseline is such a standard forensic technique, beyond just being a neat use of hash functions.
A hash mismatch is a flag, not a diagnosis. Finding that
Model.png 's hash didn't match doesn't tell you the file is malicious, or exactly what happened to it. It tells you precisely one thing: this file is not the same file it was when the baseline was recorded. That's valuable information, it tells you exactly where to focus further investigation, but it's the start of an inquiry, not the end of one.The baseline's trustworthiness is the whole foundation this technique rests on. This comparison is only as good as the integrity of
Hashes.txt itself. If an attacker could also modify the recorded baseline hashes, they could make a tampered file appear to match. In a real forensic workflow, that baseline record needs its own chain of custody and protection, it can't just be an ordinary file sitting next to the evidence with no additional safeguards.Automated comparison removes a genuinely unreliable step: manual string comparison. Two 32-character hex strings that differ by a single character are effectively indistinguishable to the naked eye at a glance. Having the tool do that comparison directly, rather than asking an investigator to eyeball two long strings side by side, is what actually makes the check dependable rather than just theoretically sound.
This is a narrower, more specific question than the VirusTotal lookup from the previous lab. Checking a hash against VirusTotal asks "has anyone else, anywhere, already identified this file as malicious." Comparing against a recorded baseline asks something much more specific and self-contained: "is this exact file, right now, identical to what it was supposed to be at some earlier point." Both use the same underlying mechanism, hash comparison, but they're answering genuinely different investigative questions, and a real forensic workflow uses both for different purposes.
This lab was a short, direct demonstration of something that's easy to understand as a concept and still worth actually watching happen: one file confirmed, one flagged. The match on
Kitty.jpg wasn't the interesting part, it was the expected, unremarkable outcome of a file that genuinely hadn't been touched. The mismatch on Model.png was the actual payoff, a concrete, unambiguous signal that something about that file had changed since the baseline was recorded, with no further detail about what or why, just a clear, automated flag pointing exactly where an investigator's attention needs to go next.That's the real value of hash-based integrity checking in forensics: it doesn't solve the investigation, it tells you precisely where the investigation needs to start.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article