Skip to content

Preserve and Verify Incident Evidence with SHA-256

Admin
November 20, 2026
5 min read
Advanced
๐Ÿ’ป Target OS: Windows 11 / Windows Server 2025 (PowerShell 7+)

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
Guide tools
0/0 Steps (0%)

Procedure

01

Register the artifact before analysis

Start here

Assign 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.

02

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.

Terminal window
$Original = 'D:\CaseEvidence\CASE-123\endpoint.evtx'
Get-Item -LiteralPath $Original -ErrorAction Stop | Select-Object Length
Get-FileHash -LiteralPath $Original -Algorithm SHA256 -ErrorAction Stop
03

Create 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.

04

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.

Terminal window
$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).Hash
if ($Actual -ne $Expected) {
throw 'Working copy digest differs from the case record.'
}
'Working copy SHA-256 verified.'
05

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.

06

Verify custody during handoff

Verify

Record 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

FindingNext action
Digest matches and provenance is completeUse the verified copy for analysis.
Digest matches but source is uncertainResolve acquisition provenance before relying on the content.
Digest mismatchPreserve both records and investigate before using the copy.

References

Comments