A digital signature proves two things: what the file is (by its hash) and who signed it (by the key). It doesn't prove a third that almost always matters: when. A signed hash is a point with no date. And without a verifiable date, anyone can sign a document today and claim it's a year old —or the reverse—.
The reflex is to look at the file's date. It doesn't work, for a simple reason: whoever holds the file controls it. The modification date on disk is changed with a command; it isn't a witness, it's a note the interested party writes themselves.
Timestamping solves this by bringing in a third party that cannot backdate.
How a TSA works
The classic standard is RFC 3161. The flow is:
- you compute your file's hash (you don't send the file, only its fingerprint),
- you send it to a timestamping authority (TSA),
- the TSA adds the time from a reliable source and signs the pair (your hash + the time) with its own key,
- it returns that stamp.
From there, anyone verifies the stamp with the TSA's public key and confirms two things: that this exact hash existed at that time, and that it hasn't been touched since. The file's content never leaves your side —the TSA only ever sees the fingerprint— which matters when the file is sensitive.
The alternative without a third party: chaining
You don't always want to depend on an external service. The other path is a verifiable append-only log: each new entry includes the hash of the previous one, forming a chain (or a Merkle tree). Inserting something with a past date would force recomputing everything that came after, and that is detectable. It's the mechanism behind transparency logs and, at bottom, the same one a blockchain uses to date its transactions without anyone having to trust a central clock.
The two approaches combine: you stamp with a TSA for the point-in-time proof and chain into an append-only log for the full journey.
What your software must do
If the system produces evidence someone might dispute:
- don't use the system date as proof —record it if you want, but don't present it as a certain date—,
- stamp each item's hash against an independent time source (a TSA, or a chained log you control but can't rewrite without it showing),
- and store the stamp alongside the signature and the hash: the three pieces together are what make digital evidence hold up when the date, and not just the content, comes into dispute.
A hash says what. A signature says who. Timestamping says when —and without the when, the other two prove less than they seem.
Xiliux