Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

If someone asks you to prove it, can you produce the exact bytes you timestamped?

说明与用途

在对发布进行哈希时,必须能够重现确切的字节,否则证明无效。解决方案包括确定性打包、哈希清单或存储归档本身。

问题

When a release is hashed, signed, or timestamped, a challenge may arise if the exact bytes that produced the hash cannot be reproduced, making the proof ineffective.

结果

Deterministic packaging or manifest hashing ensures that the same SHA‑256 can be reproduced, allowing a valid proof of the exact bytes. Storing the exact archive is the simplest guarantee.

工作流

  • 1. Build the artifact (e.g., make dist).
  • 2. Package into an archive (tar -czf release.tar.gz dist/).
  • 3. Compute SHA‑256 hash of the archive.
  • 4. Rebuild the artifact and repeat steps 1‑3 to compare hashes.
  • 5. If hashes differ, identify metadata causing drift (mtime, owner, group, mode, entry order).
  • 6. Apply deterministic flags: export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct); tar --sort=name --mtime="@${SOURCE_DATE_EPOCH}" --owner=0 --group=0 --numeric-owner --mode='u+rwX,go+rX,go-w' -cf - dist/ | gzip -n > release.tar.gz; sha256sum release.tar.gz.
  • 7. Re‑run rebuild test to verify identical hashes.
  • 8. Alternatively, generate a manifest of file contents and hash it: cd dist; find . -type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum > ../MANIFEST.sha256; cd ..; sha256sum MANIFEST.sha256.
  • 9. Store the exact archive or manifest for future proofing.

证据

The tar format stores more than file contents. Every entry gets: the file's modification time, which your rebuild just reset

来源

With GNU tar and gzip: export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct) tar --sort=name --mtime="@${SOURCE_DATE_EPOCH}" --owner=0 --group=0 --numeric-owner --mode='u+rwX,go+rX,go-w' -cf - dist/ | gzip -n > release.tar.gz sha256sum release.tar.gz

来源

Another option is to stop timestamping the archive at all. Timestamp a manifest of what's inside it

来源

  • 记录日期: 2026-10-13T14:41:09.105Z