Hashing and forensic copies
Image versus file copy
A forensic image represents acquired storage data, potentially including allocated and unallocated regions depending on method and source. A logical collection obtains selected files or records and may omit filesystem structures, slack space or deleted content. An image is not a screenshot. Acquisition formats may contain compression and container metadata, so compare hashes over the same documented byte representation. This chapter uses a tiny invented byte sequence as a stand-in, not a real disk or filesystem.
What a digest proves
SHA-256 produces a 256-bit digest of input bytes, commonly displayed as 64 hexadecimal characters. Matching digests computed over the same representation strongly support byte equality, assuming trustworthy acquisition and recording. They do not prove the origin, authorization, truth of the content, or completeness of the collection. A mismatch requires investigation: wrong representation, truncated data, accidental modification or other changes are possible. Preserve both records and do not replace the original digest to make a check pass.
Run a known-answer example
This standalone Python example uses only invented bytes:
from hashlib import sha256original = b"abc"print(sha256(original).hexdigest())print(sha256(original).digest() == sha256(b"abd").digest())Expected first line: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad; second line: False. A newline, encoding or byte change can change the digest. Hash raw bytes, not a hex display of them.
A reproducible integrity record
Record evidence ID, source description, acquisition method and representation, byte length, hash algorithm and digest, time, tool version and operator identifier. Keep a protected baseline record separate from working copies. Check copies before analysis and record failures without overwriting earlier entries. Metadata such as a copied file modification time is a separate observation; a content hash alone does not cover external filesystem metadata. SWGDE acquisition guidance discusses verification against source or acquisition-stream hashes.
Practice: compare three copies
In the lab, compare the classroom original, matching copy and changed copy to the supplied baseline. Record byte lengths and digest comparisons, not just a pass/fail screenshot. Explain why a matching copy does not establish a reliable custody history. If a mismatch occurs, isolate the derivative from normal analysis, keep the original and report the discrepancy. Do not image a physical device or access private data.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Hashing and forensic copies — knowledge check
Evaluate acquisition, integrity, custody and uncertainty.
What does a matching SHA-256 support?
What is a logical collection?
What should happen after a mismatch?
How many hex characters represent SHA-256?
Which comparison is meaningful?