Use SHA-256 to establish a new evidence integrity baseline. Keep an MD5 digest when it lets you compare against a legacy acquisition record or reference set. Compare MD5 with MD5 and SHA-256 with SHA-256, with the same byte scope on both sides.
MD5 vs. SHA-256 in an Evidence Record
Scroll horizontally if needed to see the full table.
A collision occurs when two different inputs produce the same digest under one algorithm. The SWGDE position on legacy hashes describes the narrower uses for MD5 and encourages adoption of newer standards. NIST FIPS 180-4 specifies SHA-256. See the cryptographic hash glossary entry for how a digest summarizes a byte stream.
When a tool shows unlabeled values, use the manifest or tool settings to identify the algorithm. Digest length is a clue. Several algorithms and truncation schemes can produce the same number of characters.
Read the Algorithm and Byte Scope Before Comparing
Start with the input description on each line. A hash of a disk image, a hash of one file inside it, and a hash of the exported archive that holds that file answer three different questions.
Use a pair with the same algorithm and scope. A mismatch in that pair means the inputs differ, assuming both hashes were computed correctly. If the only older record is MD5, calculate MD5 on the corresponding bytes for that comparison and record its limits.
Two Algorithms on the Same Three Bytes
The example below hashes the ASCII bytes for abc without any spaces or line breaks. It was checked with Python 3.14.0. Use Python 3.9 or later and save the code as a script.
from hashlib import md5, sha256
sample = b"abc"
print("MD5", md5(sample, usedforsecurity=False).hexdigest())
print("SHA-256", sha256(sample).hexdigest())
print("SHA-256 for abd", sha256(b"abd").hexdigest())The MD5 starts with 90015098 and the SHA-256 starts with ba7816bf. Both digest values describe the same three bytes. Those prefixes are provided for orientation. Compare full digests when verifying evidence.
The final line hashes abd. The input is still three bytes long. Replacing the final c with d changes the SHA-256 prefix to a52d159f. Since both results use SHA-256, the different digests tell you that the input bytes differ.
Carry an MD5-Only Record Forward
- Preserve the original MD5 manifest and the details that identify its input.
- Compare the current item with that manifest using MD5 on the same byte scope. Investigate any mismatch before giving the item a verification status.
- Compute SHA-256 directly from the item bytes and record the date and tool. Keep the historical MD5 comparison and new SHA-256 baseline as two distinct results.
Keep the reference digest in a trusted case record. A digest match with an unverified reference shows only that the two values agree.
A SHA-256 calculated today establishes a baseline for the bytes available today. It cannot supply a SHA-256 verification for earlier custody. If neither the original bytes nor a contemporaneous SHA-256 record is available, state that limit.
For the transfer procedure and where to record the two SHA-256 readings, see verifying a SHA-256 hash after copying evidence.
What a Match Can Support
Imagine you receive a copy of a lab export and compare it with the original manifest. If the scoped SHA-256 digest agrees, that supports the claim that the checked bytes agree with the baseline. Your conclusion depends on knowing where the baseline came from.
The same digest can be copied into two text files without anyone checking either evidence file. Calculate the digest on the file you actually received. Keep the manifest with the case so someone else can repeat the comparison.
A different filename can still refer to the same bytes. A change to a file’s contents, such as saving it with a different encoding, can give the same-looking text a different digest. Compare the exact bytes covered by the record.
When an Older Manifest Contains Both Digests
Suppose the manifest lists MD5 and SHA-256 for the same file. Calculate each on the exact received file and compare it with its matching recorded algorithm. If one comparison fails, investigate the input scope, transcription, and source record before signing off.
If you need to explain the result in a report, list the algorithm, exact filename, byte scope, reference record, and outcome. “SHA-256 matched the sender’s manifest for the 7,102-byte export” tells the next examiner more than “hash verified.”