⚖️ The Git Timestamp Vulnerability
In Git, commit timestamps are notoriously trivial to forge. The standard GIT_AUTHOR_DATE and GIT_COMMITTER_DATE environment variables are unverified client-side strings. Anyone can execute:
git commit --amend --date="2018-01-01T00:00:00Z"
Because Git records whatever timestamp the local system clock reports, a git commit history alone possesses zero legal weight regarding when the software was actually authored. In an IP ownership dispute, patent priority contest, or trade secret litigation, opposing counsel can immediately impeach Git commit timestamps as self-serving, unauthenticated hearsay under Federal Rule of Evidence 802.
🛡️ The RFC 3161 Standard Solution
RFC 3161 (Internet X.509 Public Key Infrastructure Time-Stamp Protocol) solves this decisively. A trusted Time Stamp Authority (TSA)—such as DigiCert or Sectigo—acts as an independent, cryptographic notary public.
The client hashes the target data (in GitProof, the SHA-256 Merkle root of the repository commit tree) and transmits only the hash imprint inside an ASN.1 DER-encoded TimeStampReq message. The TSA verifies the hash, combines it with the atomic time received from calibrated atomic clocks (GPS / NIST standards), signs the bundle with its certified X.509 private key, and returns an ASN.1 TimeStampResp token.
The TSA receives only the 32-byte SHA-256 message imprint. Zero bytes of source code, commit messages, file paths, or committer identities ever leave your workstation. The TSA cannot reconstruct what was hashed; it only certifies that whatever produced that hash existed prior to the timestamp.
🔬 ASN.1 Structure & Certificate Verification
A qualified RFC 3161 timestamp response encapsulates a Cryptographic Message Syntax (CMS) SignedData structure:
- Policy OID: Identifies the TSA's qualified certificate policy (e.g., DigiCert Standard Time Stamping Policy
2.16.840.1.114412.7.1). - MessageImprint: Contains the SHA-256 algorithm identifier (
2.16.840.1.101.3.4.2.1) and the 32-byte digest of the Merkle tree. - SerialNumber: A monotonically increasing, non-repeating integer assigned by the TSA hardware security module (HSM).
- GenTime: The exact generalized UTC time when the token was signed.
- SignerInfo: The RSA/ECDSA digital signature of the TSA, chaining to public Root CAs trusted by all major operating systems.
💻 Implementation in GitProof (`pkg/notarize`)
GitProof implements pure-Go RFC 3161 notarization and verification without external C libraries or system openssl dependencies:
# Notarize current Git commit tree against DigiCert TSA gproof seal --notarize # Inspect cryptographic verification & TSA timestamp gproof verify
During gproof verify, the engine performs mathematical verification:
- Recomputes the repository Merkle DAG leaf hashes to confirm working tree integrity.
- Parses the ASN.1
TimeStampResptoken embedded inproof.json. - Validates that the token's MessageImprint matches the computed Merkle root.
- Verifies the TSA's X.509 signature against the embedded certificate chain and public trust anchors.