Duplicating and preserving digital evidence
Notes on methods, tools and best practices for duplicating (imaging) and preserving digital evidence, including definitions, procedures, commands, integrity checking and common exam questions.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Digital evidence is fragile: improper handling can destroy or alter it. An engineer uses correct duplication and preservation techniques to make an exact, verifiable copy (image) of storage so the original can be preserved for later analysis and court while the copy is used for examination.
Key ideas
Start with plain definitions (I define each term before using it):
- Digital evidence — any information stored or transmitted in digital form that may be used in court. Assumption: admissibility depends on reliability, integrity and chain of custody.
- Forensic image (or bitstream copy) — an exact copy of all bits on a storage device (including slack space, unallocated space and file slack), not only files. Exact statement: A forensic image is a bit-for-bit replica of a storage medium captured with tools/configurations that prevent modification of the original media.
- Logical acquisition — copying files and file system structures visible through the OS or file system API; does not capture deleted/unallocated space. Assumption: Appropriate when only user files are needed and device cannot be fully imaged.
- Physical acquisition — copying the entire raw device surface (bit-for-bit). Exact statement: Physical acquisition captures every sector on the device and thus can recover deleted files and file fragments.
- Write-blocker — a hardware or software device that allows read-only access to a storage device to prevent any writes to the original media. Exact requirement: All forensic physical acquisitions should use a write-blocker unless the device must be powered and cannot safely be write-blocked (then document and justify).
- Hash function — a deterministic function that maps data of arbitrary size to a fixed-length output (hash). Common cryptographic hash functions: MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit). Assumption: For integrity checking we need collision-resistant hashes; note MD5 and SHA-1 have known weaknesses (see verify).
- Hash value / digest — the output of a hash function for a given data set; used to verify integrity. Exact property used: If original data is unchanged, repeated hashing yields the same digest. If any bit changes, digest should change (with overwhelming probability for good hashes).
- Chain of custody — a documented, unbroken record of who had the evidence, when, why, and how it was stored and transferred. Exact components: item description, who collected it, date/time, location, reason, signatures on transfer, and storage details.
- Write-protection — the practice of preventing any writes to original evidence (use of write-blocker, write-protect switches, or imaging before any analysis).
Assumptions and policies typically required (state these when you answer an exam or perform work):
- Assume every storage device is potentially live: volatile memory (RAM) may contain evidence lost on power-off. If live acquisition is needed, document risk and reason. For SSDs/NVMe media, be aware that TRIM and background garbage collection can alter blocks on power-on even through a write-blocker; document this risk and minimize power cycles.
- Always follow accepted procedures and use validated tools. Document tool name, version and command-line options.
What to draw in diagrams (exam answers often ask for diagrams):
- Imaging workflow diagram: draw a left-to-right flow: Suspect system (label: original device) -> write-blocker -> forensics workstation (label: image stored) -> calculate hash on original and image (show hash values) -> record chain-of-custody entries. Label each arrow with action (connect, image, verify) and show a padlock icon for sealed storage.
- Chain-of-custody form layout: draw a table with columns: item ID, description, collected by, date/time collected, location, transfer to, date/time, purpose, signatures, storage location.
Exact procedural steps for a basic physical imaging (unambiguous, step-by-step):
- Photograph the scene and device (if relevant). Label photos with time/date and person taking them.
- If device is live and volatile data is required, perform a live acquisition first (document commands, tools, and reasons). Otherwise power down safely.
- Attach a Hardware write-blocker between the suspect drive and the acquisition system.
- Use a validated imaging tool (for example,
dd,dc3dd,FTK Imager,Guymager, EWF-capable tools) and create a bitstream image in an evidence file format (E01, raw, AFF, etc.). - Calculate and record cryptographic hashes (e.g., SHA-256; you may also record MD5 as a secondary). For raw bitstream images, compute a hash of the source and of the image file; they must match. For evidence container formats (E01/AFF), verify the tool-reported acquisition hash and per-segment checksums; do not expect the container file's hash to equal the source hash.
- Seal and store the original device; update the chain of custody.
Tool commands / syntax to remember (examples, exact syntax):
- Linux raw imaging minimal (do not use on unknown devices without validation):
dd if=/dev/sdX of=/evidence/device_image.raw bs=4M conv=sync,noerror—ifinput file/device,ofoutput file,bsblock size,conv=sync,noerrorcontinue on read errors and pad short reads. - Improved logging and hash with dc3dd:
dc3dd if=/dev/sdX of=/evidence/device_image.raw hash=sha256 log=/evidence/dc3dd.log— dc3dd computes hash while imaging. - FTK Imager GUI: create Disk Image -> select Logical/Physical -> Add Evidence Item -> Image Destination: E01 or Raw -> choose hashing options. For E01 images, verify afterward using
ewfverify(libewf) or FTK Imager's Verify Image function; for raw images, retain and later re-check SHA-256 withsha256sum.
Note: Always record tool name and version and understand that dd does not create timestamps or metadata in the image unless wrapped in evidence format; prefer tools that produce case metadata (E01, AFF) for court. E01/AFF typically store the source acquisition hash and per-segment checksums to support later verification.
Best practice: Courts generally do not mandate a specific hash algorithm; use a collision-resistant hash such as SHA-256 (or stronger) as the primary hash, and avoid MD5/SHA-1 as the sole integrity check. In India, the Evidence Act (Section 65B) does not prescribe a particular hash; follow your agency/lab SOP and document the algorithm, tool, version, and outputs.
Formulas
t = S / R — where t is time to transfer (s), S is size of data (bytes), R is transfer rate (bytes/s). Use SI units: seconds, bytes (or convert to bits consistently).
- t: seconds (s)
- S: bytes (B) or convert GB to bytes (1 GB = 10^9 B for decimal or 2^30 B for binary; state which you use)
- R: bytes per second (B/s)
S_GiB = S_B / (2^30) — convert bytes to gibibytes (GiB). 1 GiB = 2^30 bytes. For decimal gigabytes (GB), use S_GB = S_B / 10^9.
Probability_collision_random ≈ 1/2^n — rough probability two random n-bit hashes collide (very small for large n). For the birthday bound (~50% chance of any collision among k items): k ≈ 1.1774 * 2^(n/2).
- n: hash length in bits (e.g., 128 for MD5), k: number of items. Use this only as an approximation; cryptographic weaknesses can make collisions easier.
Worked examples
Example 1 — Imaging time calculation Problem: Image a 500 GiB drive over a SATA connection able to sustain 100 MB/s (use binary GiB and decimal MB/s as given). Calculate time in hours. Steps:
- Convert 500 GiB to bytes: S = 500 × 2^30 = 500 × 1,073,741,824 = 536,870,912,000 B.
- Transfer rate: R = 100 MB/s = 100 × 10^6 B/s = 100,000,000 B/s.
- Time t = S / R = 536,870,912,000 / 100,000,000 = 5,368.70912 s.
- Convert to hours: 5,368.70912 / 3600 = 1.4913 hours ≈ 1 hour 29 minutes. Answer: Approximately 1 hour 29 minutes.
Example 2 — Hash verification (model exam answer)
Problem: You image a USB drive to a raw image file. The hash of the original device computed before imaging is SHA-256 = A1...F3 and the hash of the resulting image file is A1...F3. Write the steps to show integrity for a report.
Model answer steps:
- Record device ID, serial number, and imaging tool/version.
- Compute hash of the original device with the chosen tool:
sha256sum /dev/sdX-> record digest. - Create image using validated method. Compute hash of image file:
sha256sum device_image.raw-> record digest. - Compare digests. If they match exactly, state: "The SHA-256 digest of the original device and the image are identical, showing the image is a bit-for-bit match of the original at time of acquisition." Include timestamps and tool output in appendices.
Example 3 — Logical vs Physical acquisition (theory long-answer) Question: Explain with an example when you would do logical acquisition instead of physical, and list what you will lose. Model answer:
- Use logical acquisition when device cannot be removed (e.g., mobile device under warranty constraints), or when only specific files are needed quickly. Procedure: use file-level copy or forensic logical export.
- Losses: deleted files, file slack, unallocated space, metadata like previously overwritten sectors. Provide an example: copying
C:\Users\Alice\Documentsfrom a live Windows system will not capture deleted documents in$MFTslack or in unallocated sectors; show that physical imaging would allow file-carving to recover deleted documents. - Conclude: justify trade-off and document limitations in report.
Common mistakes
- Using
ddwithoutconv=noerror,syncwhen imaging damaged media (leads to truncated images and missing data). - Confusing logical copy with forensic image; saying “I made a copy” without specifying bitstream vs file copy.
- Not documenting tool versions, command parameters, and chain-of-custody steps.
- Using weak or deprecated hash only (for example, citing only MD5) without also using a stronger hash (SHA-256) or explaining MD5 weaknesses.
For your exam
Types of questions you will get:
- Definitions: define forensic image, logical vs physical acquisition, write-blocker, chain of custody.
- Short notes: steps to create a forensic image; write-blockers; evidence handling.
- Procedure descriptions: list step-by-step imaging process including hash verification and chain-of-custody documentation.
- Commands/syntax: write the command to image with
ddand explain options, or describe how to create an E01 image in FTK Imager. - Diagrams: draw imaging workflow and chain-of-custody table.
- Long answer: argue whether MD5 is acceptable and how to mitigate hash weaknesses.
What a full-marks answer includes:
- Precise definitions (bold terminology if asked), clear assumptions, and justification of choices.
- Step-by-step procedure with tools and commands, including write-blocker use and hash calculation.
- Proper diagram(s) labeled exactly as requested.
- Explicit chain-of-custody entries and statements about sealing and storage.
- Notes on limitations and alternative approaches (e.g., live acquisition when necessary).
Quick check
- What is a forensic image?
- Why use a write-blocker?
- Give the formula to compute imaging time from size and transfer rate.
Answers: 1. An exact bit-for-bit copy of a storage medium captured to preserve original data. 2. To prevent any writes to the original device so the evidence is not altered. 3. t = S / R
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?