SSM-Clock Stamp – Tamper Detection (file bytes) (5.3)

Objective. Prove that any byte change after stamping is immediately detected by the content hash check — fully offline, plain ASCII.

Setup (inputs)

  • A stamped file A and its one-line stamp:
    SSMCLOCK1|iso_utc|rasi_idx|theta_deg|sha256(file)|chain[|kv:...]
  • Optional ledger (append-only). No network, no PKI.

Steps (deterministic)

  1. Baseline: verify A with its stamp → expect PASS.
  2. Tamper: modify A (e.g., append \n or flip one byte).
  3. Re-verify: run verify --file A --stamp "<line>".

Expected output (stdout, ASCII)

HASH_OK=false CLOCK_OK=true CHAIN_OK=true   # or CHAIN_OK=na if no ledger
VERDICT=FAIL

Why this happens (core rule)

  • The stamp binds exact bytes via h_file = H_algo(file_bytes).
  • Verification recomputes the digest and requires string equality:
    h' = H_algo(file_bytes) and h' == h_file.
  • Any byte change → new h'HASH_OK=falseFAIL.
  • This check is independent of time and chain.

Notes (must)

  • Compute file hash in binary mode; do not use text-mode reads.
  • Respect kv:algo if present; default is sha256.
  • Digests are lowercase 64-hex.
  • The clock and chain may still check out, but hash mismatch alone is sufficient to fail.

Navigation
Back: SSM-Clock Stamp – Two Files, Same Minute (5.2)
Next: SSM-Clock Stamp – Ledger Break (row deletion/reorder) (5.4)