Preserve and Verify Incident Evidence with SHA-256
Before you begin
- Applies to:Integrity and custody checks for evidence that has already been collected.
- Where to start:Open PowerShell 7 or later on a dedicated analysis workstation.
- What you need:Have one collected artifact, access to the authorized case repository, and the approved acquisition and retention procedures.
Guide tools
Procedure
Register the artifact before analysis
Start hereAssign a case and artifact ID. Record source system, original path or acquisition scope, UTC time, collector, tool version, and any errors or incomplete parts. Record whether the source was a live export, snapshot, or another acquisition type.
Hash the preserved artifact
After the acquisition tool has finished writing and the file is closed, replace the sample path and calculate the digest. Record SHA-256, byte length, and custody location in the protected case record. Use a stable path controlled by the case team.
$Original = 'D:\CaseEvidence\CASE-123\endpoint.evtx'Get-Item -LiteralPath $Original -ErrorAction Stop | Select-Object LengthGet-FileHash -LiteralPath $Original -Algorithm SHA256 -ErrorAction StopCreate and identify a working copy
Use the approved evidence repository procedure to produce a byte-for-byte copy in a restricted workspace. Record the copy path, operator, and timestamp. Leave the stored original intact and open only the working copy in analysis tools.
Verify the copy against the protected baseline
Paste the recorded digest into the placeholder and substitute the working-copy path. This check fails if the digest is invalid, the file cannot be read, or its bytes differ. Success confirms equality with the hashed baseline at verification time.
$Expected = 'PASTE_64_CHARACTER_SHA256_FROM_CASE_RECORD'$Copy = 'D:\CaseWork\CASE-123\endpoint.evtx'if ($Expected -notmatch '\A[0-9a-fA-F]{64}\z') { throw 'Expected a 64-character SHA-256 digest from the custody record.'}$Actual = (Get-FileHash -LiteralPath $Copy -Algorithm SHA256 -ErrorAction Stop).Hashif ($Actual -ne $Expected) { throw 'Working copy digest differs from the case record.'}'Working copy SHA-256 verified.'Record and investigate a mismatch
Preserve the mismatched copy and the operatorโs notes in a restricted location. Check artifact IDs, size, transfer errors, and whether an analysis tool saved over the file. Create a fresh copy from the preserved original through the approved process. Record the discrepancy and avoid replacing evidence in place.
Verify custody during handoff
VerifyRecord sender, recipient, UTC time, artifact ID, access purpose, and method of delivery. Have the recipient verify against the protected digest independently. Treat parsed, redacted, or converted outputs as derivative artifacts with their own digest and parent reference.
Interpret the Results
| Finding | Next action |
|---|---|
| Digest matches and provenance is complete | Use the verified copy for analysis. |
| Digest matches but source is uncertain | Resolve acquisition provenance before relying on the content. |
| Digest mismatch | Preserve both records and investigate before using the copy. |
References
Your feedback keeps these production procedures accurate and battle-tested.