What does Merkle Trees for Manuscript Evidence conclude, in numbers, about “The Blind Spot of One Fingerprint: an Overall Hash Only Says Whether Something Changed”?

Answer: Chapter 1 makes single-byte edits to a nine-file illustrative manuscript and guesses the edited file from the overall hash, with a hit rate of 0.1133, no better than the 0.1111 of blind guessing.

Scope of the numbers: Its manuscripts, timestamps, salts and parameters are illustrative, and all calculations are generated by its programs. Chapter 1 makes single-byte edits to a nine-file illustrative manuscript and guesses the edited file from the overall hash, with a hit rate of 0.1133, no better than the 0.1111 of blind guessing.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.1111, 0.1133

file mean bits sd bits (of 256 output bits, 300 edits each)
0128.09 7.93
1128.15 8.42
2127.96 8.53
3127.95 7.93
4127.83 7.58
5128.11 7.83
6127.70 8.03
7127.69 8.16
8127.47 8.17
grand mean distance127.88 bits
spread of file means0.68 bits
guess-the-file accuracy0.1133 (test edits 2700)
chance level 1/90.1111
standard error at chance0.0060
bits needed to name the file3.1699
Show the full program
# Chapter 1. p11: one digest of the whole book says "changed", not where.
# Model: a demo manuscript of 9 files (preface + 8 chapters) is hashed
# as one SHA-256 digest. We change one byte in a random file at a random
# offset and measure the Hamming distance between old and new digests.
# If the digest carried any trace of WHERE the edit happened, the mean
# distance would differ by file and a classifier could guess the file.
# Training and test edits use different fixed seeds. Texts are synthetic
# (illustrative texts, not a real manuscript).
import hashlib
import math
import random

NFILE = 9


def file_text(i, ver=1):
    # illustrative manuscript: about 5 KB of fixed text per file
    line = "B-295 demo manuscript, file %02d, version %d. " % (i, ver)
    return (line * 120).encode("ascii")


def book_digest(files):
    h = hashlib.sha256()
    for f in files:
        h.update(f)
    return h.digest()


def hamming(a, b):
    return bin(int.from_bytes(a, "big") ^ int.from_bytes(b, "big")).count(
        "1")


def edits(offset, per_file):
    rng = random.Random(20261113 + offset)
    base = [file_text(i) for i in range(NFILE)]
    d0 = book_digest(base)
    out = []
    for i in range(NFILE):
        for _ in range(per_file):
            f = bytearray(base[i])
            pos = rng.randrange(len(f))
            f[pos] = (f[pos] + 1 + rng.randrange(255)) % 256
            files = base[:i] + [bytes(f)] + base[i + 1:]
            out.append((i, hamming(d0, book_digest(files))))
    return out


train = edits(0, 300)
test = edits(1, 300)
means = []
print("file  mean bits  sd bits  (of 256 output bits, 300 edits each)")
for i in range(NFILE):
    xs = [d for f, d in train if f == i]
    m = math.fsum(xs) / len(xs)
    sd = math.sqrt(math.fsum((x - m) ** 2 for x in xs) / (len(xs) - 1))
    means.append(m)
    print("%4d  %9.2f  %7.2f" % (i, m, sd))
hits = 0
for f, d in test:
    guess = min(range(NFILE), key=lambda j: (abs(d - means[j]), j))
    if guess == f:
        hits += 1
grand = math.fsum(d for _, d in train) / len(train)
print("grand mean distance           %.2f bits" % grand)
print("spread of file means          %.2f bits" % (max(means) - min(means)))
print("guess-the-file accuracy       %.4f (test edits %d)"
      % (hits / len(test), len(test)))
print("chance level 1/9              %.4f" % (1 / NFILE))
print("standard error at chance      %.4f"
      % math.sqrt((1 / NFILE) * (1 - 1 / NFILE) / len(test)))
print("bits needed to name the file  %.4f" % math.log2(NFILE))

Single source and citation

Fan, Y. (2026). Merkle Hash Trees and Trusted Timestamps: Tamper-Evidence for Monograph Versions and Minimal Proofs of Priority (Version 1.0.0), Chapter 1: The Blind Spot of One Fingerprint: an Overall Hash Only Says Whether Something Changed. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-295 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026295,
  author    = {Fan, Yafu},
  title     = {Merkle Hash Trees and Trusted Timestamps: Tamper-Evidence for Monograph Versions and Minimal Proofs of Priority},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book