Integrity
How to prove a photograph has not been edited
Hunting for signs of retouching is an endless job. There is a simpler and conclusive way: fix a fingerprint at capture and compare it later.
The question is almost always asked backwards: «can we tell whether this photo has been retouched?». That is the hard road — sometimes an impassable one. The road that works is the opposite: do not look for the edit, make it impossible to hide.
Why pixel analysis is not enough
Forensic image analysis techniques do exist to hunt for traces of manipulation: compression inconsistencies, discontinuities in sensor noise, shadows and perspectives that do not add up. They are serious tools and, in expert hands, they deliver.
But they have two structural limits. First, they are probabilistic. They produce indications, not certainties, and a well-executed edit may leave no detectable trace. Second, and more awkwardly, they are a catch-up race. Every detection technique arrives after the manipulation technique it must expose, and is outrun by the next one.
Anyone who has to prove authenticity by hunting for signs of forgery has already given up the better position. Take the opposite one: fix what it was, then compare.
The cryptographic fingerprint: one question, one answer
A hash is a function that takes a file of any size and returns a fixed-length string. It has one property that is everything here: if even a single bit of the file changes, the fingerprint changes completely. Not «a little»: it becomes unrecognisable. This is the avalanche effect.
This turns a matter of opinion into a matter of arithmetic. The argument is no longer whether the image «looks» manipulated: you recompute the fingerprint and compare it with the one signed at capture. Either it matches, or it does not.
LOCUS computes three different fingerprints of the same media — MD5, SHA-256 and SHA-512 — in a single read pass. One necessary caveat: MD5 is included only for historical compatibility and interoperability with older tools. It is not a guarantee: against intentional collisions it has been considered insecure for years. The actual guarantees are SHA-256 and SHA-512.
The practical problem with hashes
There is an obvious operational limit. A fingerprint answers «is this the exact same file?», which is not always the question that matters. If someone resizes your photo, recompresses it or sends it through a chat, the hash changes — even though the image looks the same and nobody altered the content.
So a second tool is needed, one that works on visual content rather than bytes.
Perceptual fingerprints
A perceptual fingerprint describes what an image looks like rather than its bytes. LOCUS computes three, all 256-bit:
- aHash — reduces the image to a grid and compares each cell against the average brightness.
- dHash — records the changes in brightness between adjacent cells: it captures structure rather than absolute tone.
- pHash — works on the low frequencies of the image, the ones that survive recompression and resizing.
Visually similar images produce nearby perceptual fingerprints; the distance is measured by counting differing bits. That is how a recompressed copy is recognised — and how a localised retouch is spotted, since it shifts the fingerprint far more than plain recompression does.
A limit stated openly: perceptual fingerprints are not an integrity guarantee. They are not tamper-proof and they can collide: different images can produce nearby fingerprints. They are complementary to, never a substitute for, the cryptographic hash. Anyone presenting them as proof of authenticity is pushing the tool beyond what it promises.
A technical detail, for anyone wanting to repeat the computation: aHash and dHash are bit-exact deterministic on any architecture, whereas pHash uses floating-point arithmetic and must therefore be compared with a tolerance (LOCUS allows up to 16 differing bits out of 256). It is written in the manifest — not something to discover in a hearing.
The histogram: describing without revealing
LOCUS also computes the image histogram — the distribution of brightness values and of the three colour channels across 256 levels. It has a valuable property: it describes the image without showing it.
That is why, for photos, the histogram is the only thing transmitted to the server: the graph goes up instead of the photograph. The content of the evidence stays on the device, inside the bundle. A verifier can still recompute the histogram from the media and compare it with the signed one.
The layer almost nobody considers
One point of technical honesty deserves space, because it is often left unsaid: the photo coming out of a smartphone is not raw sensor data. It is the output of the device's computational photography pipeline — multi-frame fusion, noise reduction, tone mapping, optical corrections. Processing that cannot be switched off and happens before any app can intervene.
LOCUS states this explicitly in the signed manifest, in an object recording the capture source, the API used and the nature of the processing, including the note that the file is not raw sensor data. The bundle therefore holds three distinct layers: the byte-for-byte camera original, its decoded version used as the basis for perceptual fingerprints, and the authoritative media carrying watermark and metadata.
Declaring it does not weaken the evidence — it makes it defensible. An opposing party who discovers unaided that the file is «computational» has found a crack; one who reads it written in the signed manifest has found only transparency.
What can be asserted, in the end
With this approach you can state, and demonstrate: this file is identical to the one sealed at that instant, and anyone can verify it by recomputing the fingerprints. No need to trust us, no need for an expert, no need for a connection.
What cannot be said — and we do not say it — is that the depicted scene is genuine. File integrity and scene truthfulness are two different questions: the first is settled by mathematics, the second by context and by the accountability of the operator.
Continue with the chain of custody of photographic evidence and authenticity in the age of AI.