Section 13.5

Chain of custody

Definition

Chain of custody is the documented, unbroken record of who or what held a piece of evidence and what was done to it, from its acquisition to the conclusion it supports. Each entry names the evidence by an identity that can be rechecked, such as a cryptographic digest, and records the holder, the time, the action (acquire, copy, transfer, transform, store) and the rule that permitted it. The term comes from legal practice; in science and computing it shows that data were not swapped or altered outside recorded, permitted steps.

The idea

A timing instrument records delays and exports them to a file. An analyst removes some rows, a script computes a mean, and a plotting script draws a figure for a report. A reviewer looks at one bar in the figure and asks two questions: does it come from the data the instrument actually recorded, and was every change on the way allowed? Without records, four very different histories look the same in the final figure: a faulty trial removed for a documented reason, an inconvenient value dropped, a file copied from a different experiment, and a hand-edited cell.

The idea comes from police evidence handling. Evidence goes into a sealed bag, and every person who takes the bag signs a log with the time and the reason, so that a court can see that the object presented in court is the object found at the scene. The picture carries over in one respect: every handover and every change is logged by the party who makes it, at the time it happens. It differs in another. Digital evidence can be copied perfectly, so custody of data tracks identities and transformations, not possession of a unique object. Because copies cost nothing, the original can stay unchanged while each processing step writes a new, separately identified output.

How it works

Two terms name the points that need the most care. An acquisition boundary is the point where an observation first becomes stored data: the instrument or program that captured it writes it out. A transformation is any step that changes the data, such as removing rows, converting units or computing a summary. A transformation is authorized when a rule written before the data were examined permits it. Copies and transfers change the holder but must not change the bytes.

Keeping a chain of custody takes these steps.

  1. At acquisition, record the instrument or program and its version, its settings, the operator, the time and the clock that gave the time, and every condition that decides whether an observation is valid, such as the configuration in force. Compute the digest of the raw output at once, before anything else can touch it, and store the raw output where it cannot be changed.

  2. At each copy or transfer, record the source, the destination, the new holder and the time. Recompute the digest at the destination; it must equal the digest at the source.

  3. At each transformation, record the input digests, the program and its version, its parameters, the rule that permits the transformation, who or what ran it, whether it finished successfully, and the output digest.

  4. Keep failed and repeated attempts. A rerun that replaced an earlier result is part of the history. Dropping it silently is itself an unrecorded transformation.

  5. Protect the log. Keep the custody log apart from the data, as an append-only log §8.13 in which each entry includes the digest of the previous entry. Changing or deleting an old entry then breaks the link from the entry after it. Hiding that break means rewriting every later entry, which changes the digest of the newest entry, so a verifier who kept a copy of the newest digest detects it. Signing the entries with a digital signature §5.14 also shows who wrote each one.

A reviewer checks the chain by walking it backward from the reported result to an acquisition entry.

Worked example

An instrument records three delays, A=[1,2,99]A = [1, 2, 99] ms. At acquisition, the instrument’s log also records that trial 3 ran with the wrong configuration file. A rule written before the experiment says: exclude every trial whose recorded configuration differs from the declared configuration. The custody log for the result reads as follows; each row also holds the digests of its input and output, the program that ran and the time.

Step Input Action and rule Output
1 instrument acquire; digest recorded at once A=[1,2,99]A = [1, 2, 99] ms
2 AA exclude trial 3; rule: wrong configuration B=[1,2]B = [1, 2] ms
3 BB arithmetic mean §11.12 C=1.5C = 1.5 ms

Step 3 computes C=(1+2)/2=3/2=1.5C = (1 + 2) / 2 = 3 / 2 = 1.5 ms. Without step 2, the mean would be (1+2+99)/3=102/3=34(1 + 2 + 99) / 3 = 102 / 3 = 34 ms. The one excluded value changes the result by a factor of 34/1.5≈22.734 / 1.5 \approx 22.7, so a reader must be able to see why it was excluded. The log shows that trial 3 was excluded because of a configuration record made at acquisition and a rule written in advance, not because 99 ms looked too large. The digest of CC alone would show none of this: it identifies the final number, not the choices that produced it.

Stated precisely

Number the stages of the evidence x0,x1,…,xnx_0, x_1, \dots, x_n, where x0x_0 is the raw output at acquisition and xnx_n the reported result. Write each step as xi+1=fi(xi;θi)x_{i+1} = f_i(x_i; \theta_i), where fif_i is the operation of step ii and θi\theta_i its parameters; a copy or transfer is a step whose operation leaves the bytes unchanged. In the example, x0=Ax_0 = A, f0f_0 removes trial 3 under the configuration rule, x1=Bx_1 = B, f1f_1 computes the mean, and x2=C=1.5x_2 = C = 1.5 ms. Let HH be a cryptographic hash function §5.1. The chain from x0x_0 to xnx_n is unbroken when, for every step ii:

  1. a log entry made when step ii ran records H(xi)H(x_i), fif_i, θi\theta_i, the actor and H(xi+1)H(x_{i+1});

  2. the output digest recorded for step ii equals the input digest recorded for step i+1i + 1;

  3. if fif_i changes the information in the data, a rule that existed before the data were examined permits fif_i with parameters θi\theta_i;

  4. H(x0)H(x_0) was recorded at acquisition, before anyone else had access to x0x_0.

The conclusion “xnx_n was obtained from x0x_0 only by the logged, permitted steps” then holds under four assumptions. First, each entry was written by the process that performed the step, or by a system that observed it, and describes what really happened. Second, HH is collision resistant §5.5, so a matching digest means matching bytes. Third, the log is tamper-evident, so a changed or deleted entry is detected. Fourth, each recorded time names the clock that produced it, so the order of events can be checked.

Limits and common mistakes

Custody shows that evidence was not altered outside recorded, permitted steps. It does not show that the original observation was accurate: a miscalibrated instrument produces wrong data with perfect custody.

A digest computed after an unrecorded gap proves only that the bytes did not change after that point. It cannot show what happened during the gap, so the log must show the gap.

A copy preserves the bytes but changes the holder, so it still needs an entry. A transformation changes the information and needs, besides its entry, a rule that permits it.

Dropping failed runs, repeated attempts or inconvenient values is a transformation, whether or not anyone calls it one. A rule written after seeing the data can be chosen to produce a desired result, so an exclusion is authorized only by a rule fixed before the data were examined, a prospective exclusion rule §13.15, typically written down in an analysis plan §13.17.

In law, chain of custody has formal requirements of its own, such as sealed containers, signatures and witnesses, and a court decides what evidence it admits. The record described here supports scientific and engineering accountability; it is not a legal certification. For digital evidence in investigations, the standard ISO/IEC 27037 gives guidelines for identifying, collecting, acquiring and preserving it [403].

Questions answered

Where are acquisition boundaries and authorized transformations recorded?

Acquisition boundaries and authorized transformations are recorded in a custody log: an append-only record, kept apart from the data, with one entry written at each boundary at the moment it is crossed, by the process or person that crosses it. An acquisition boundary is the point where an observation first becomes stored data; an authorized transformation is a change to the data that a rule written in advance permits. The acquisition entry records the instrument or program, its settings, the operator, the time and the clock, the conditions that decide whether each observation is valid, and the digest of the raw data §13.16 computed before anything else touched it. Each transformation entry records the digests of its input and output, the program and its parameters, who ran it and the outcome, and cites the rule that authorizes it.

The rules themselves, such as exclusion criteria, are recorded before the data are examined, in an analysis plan or a similar document, so that the log can cite them. A file name, a folder structure or the digest of the final result records none of this. Where an entry is missing, the log must show a gap, not a continuous chain inferred from consistent names.

Related entries: Artifact provenance (§13.1), Immutable evidence (§13.12), Raw data versus derived data (§13.16), Data lineage (§13.18), Prospective exclusion rule (§13.15), Analysis plan (§13.17), Append-only log (§8.13). Further reading: [403].