Evidence and audit

Hash chaining

Hash chaining is the technique of computing each record’s cryptographic digest over both its own content and the digest of the record before it, so that a change to any record changes its digest and invalidates every digest after it. It makes alteration detectable by anyone who recomputes the digests; it does not prevent alteration, and it constrains only an attacker who cannot recompute them.

also called hash chain · hash-chained log · chained digests · hash linking

The whole technique is one line. The digest of record n is taken over the digest of record n minus one, a separator, and a canonical serialisation of record n’s content, with the record’s own digest field excluded and a fixed genesis value standing in for the digest of record zero. Everything else about a hash-chained log is a consequence of that line. Two details in it do most of the work: canonical serialisation — sorted keys, no whitespace, one encoding per record — so that two parties independently compute the same value, and the exclusion of the record’s own digest from its own input, without which a verifier recomputing from a stored row would cover a field the original write never covered and every check would fail. The same reasoning applies to any column added later: if it is not inside the digest input, it is not protected, and that should be written down rather than assumed.

Detection is located, not merely raised. Alter record 12 and the discrepancy appears twice — record 12’s recomputed digest no longer matches the value stored beside it, and record 13’s stored link no longer matches record 12’s actual digest — so a walk from genesis can name the first sequence at which the chain breaks and say which of the two it found. Removal shows up as a broken link at the following record, or as a gap if sequence numbers are drawn from a counter that deletion does not lower. This is the practical advantage over a periodic digest of a whole table: a table digest tells you something changed, and a chain tells you where.

The property being relied on is not that digests are hard to compute. They are cheap and public, and anyone holding the rows can compute them. It is that a change requires recomputing every record after it, and therefore write access to all of them. Against an outside reader, a bug that rewrote a column, a partial restore, or an injection that reaches one row, that is a real barrier. Against the party who administers the database it is none: they rewrite the entry, walk forward, re-hash the remainder, and the chain verifies clean afterwards. Any statement about what a hash chain proves is incomplete without naming which of those two attackers it is being claimed against.

Keying closes the second case, at a cost worth understanding. Replace the plain digest with a message authentication code — HMAC-SHA256 under a key held outside the store — and rewriting history needs the key as well as database access. Three qualifications travel with that: the key must be injected from a secret manager the database administrator cannot read, or it buys nothing; records written before the key existed cannot be re-tagged under it, because re-tagging is the act being prevented, so they are covered instead by a keyed checkpoint over the head they add up to, and altering any of them moves that head; and unkeyed digests must be tolerated only as an unbroken prefix, because once a record verifies under the key, an unkeyed successor is a forgery rather than a legacy row. One trap is worth naming separately: do not key a digest that anything looks records up by. Systems commonly store the SHA-256 of a credential as its identifier, and keying that digest would make every credential already issued unresolvable. An integrity tag can be keyed; an identifier cannot.

What chaining structurally lacks is a partial proof. Verification is linear in the length of the log — it gets slower every day, and it is normally the reason implementations end up streaming the walk in bounded chunks — and there is no way to demonstrate that one record belongs to the chain without disclosing the records around it. That is what a Merkle tree with signed tree heads provides, at the cost of more machinery than most on-premises deployments want to carry. Choosing the chain is a reasonable decision; choosing it without knowing that a regulator cannot be handed a verifiable extract is not.

in practice

One altered field, and the forgery that defeats it

An audit entry at sequence 12 records a tool call with an amount of 200. Someone edits it to 20,000 in the database and changes nothing else. A verification walk recomputes the digest of entry 12 from the stored row, finds it does not match the stored digest, and reports a content mismatch at sequence 12 — the link from 13 would have failed as well. Now the same person walks forward and recomputes the digest of every entry from 12 to the end with the same algorithm the writer used. The walk now passes: valid, with no break anywhere. That second case is why any implementation should ship the forgery as a test rather than only the detection — with the assertion that it passes on an unkeyed chain and fails once the digests are keyed, so neither half of the claim can quietly drift.

not the same as

What hash chaining is routinely confused with

Merkle tree
A Merkle tree hashes records pairwise up to a single root, which yields a proof that one record is in the set in logarithmic size and without revealing the others. A chain gives linear verification and no partial proof. Choose the tree when somebody has to be handed a verifiable subset; choose the chain when they will always be handed the whole log.
Digital signature
A chain proves internal consistency, not origin: it cannot distinguish the application wrote this from somebody with the file wrote this. A signature adds a key and therefore an author. The two answer different questions, and a log usually wants both — the chain for ordering, a signature over the head for provenance.
Checksum
A checksum detects accidental corruption and is not built to resist someone choosing the bytes. A cryptographic digest resists that, but used unkeyed it still constrains only a party who cannot recompute it — which is the same limit the chain has, restated.
next

Related terms

Audit chain

An audit chain is a record of administrative actions in which every entry carries a cryptographic digest computed over its own content and over the digest of the entry before it, so the entries form one linked sequence rather than a set of independent rows. Editing, reordering or removing an entry breaks that sequence at an identifiable point, which is what lets the integrity of the record be demonstrated rather than asserted.

Tamper-evident

Tamper-evident describes a record whose alteration can be detected afterwards by whoever checks it. Tamper-proof would describe a record that cannot be altered at all — a property no scheme delivers over storage the alterer administers — so a claim of tamper-evidence means something only when it names the attacker it holds against and the check that would reveal the change.

Evidence anchoring

Evidence anchoring is the practice of periodically signing a short statement about the state of a record — typically the sequence number and digest of its most recent entry, linked to the previous such statement — and publishing that statement somewhere the keeper of the record cannot reach. The claim it supports is narrow and checkable: any copy of an anchor held elsewhere contradicts any rewrite of the record made after that copy was taken.

Digest-sealed export

A digest-sealed export is an evidence bundle issued together with a cryptographic digest computed over the canonical serialisation of its contents, so that a recipient holding that digest from another source can recompute it and confirm the file has not changed since it was issued. The seal establishes integrity relative to a value the recipient already holds; it establishes nothing about origin, because anyone able to rewrite the bundle can recompute the digest.

how this is implemented

Where Token Observe does this

The definition above is the field's, not the product's. This is the part of the product that implements it, for a reader who wants to see one.

Evidence and audit

The terms next to this one

What a record of an agent's actions proves, and the several places where a word in common use claims more than the mechanism delivers.

get in touch

Definitions are the easy part.

The glossary is written to be useful whether or not you ever buy anything. If you have got to the point of deciding how to implement one of these in your own estate, say what your agents do and you will get a straight answer about what it would actually take.

no form · no qualification step · no sales desk · the other three ways in