What does Zero Trust for a One-Commander Empire conclude, in numbers, about “Credential Hygiene: Format Checks and Revocation Lists”?

Answer: Chapter 3 shows that entropy cannot separate hexadecimal keys from commit hashes, while a format with a check value raises 1.5 alarms a month, and compresses revocation lists into a Bloom filter.

Scope of the numbers: The book is defensive only and describes no attack, intrusion, bypass or evasion technique; all hosts, domains and tokens are synthetic, parameters are illustrative, and all calculations are generated by its programs. It is general business analysis, not a security audit or legal advice, and any production change requires human review and sign-off.

中文版

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: 1.5

rule tpr fpr alerts precision
entropy t3.5 0.9745 0.799250 159,852.9 0.000018
entropy t4.0 0.5000 0.010000 2,001.5 0.000749
format F0.5000 0.000000 1.5 0.999998
format F, all keys A1.0000 0.000000 3.0 0.999999
missed per 1,000 leaked secrets, published detection shares:
TruffleHog, Search found 0.2524, missed747.6
TruffleHog, BigQuery found 0.2939, missed706.1
regex only, Search found 0.1926, missed807.4
regex only, BigQuery found 0.2229, missed777.1
findable after push in a median of 20 s: scan before push

Key formula

\[H = -\sum_i \frac{c_i}{n}\log_2\frac{c_i}{n}.\]
Show the full program
# Chapter 3. p33: base rates decide whether a secret scanner is usable.
# A one-person shop scans N = 200,000 long random-looking strings a month
# (hashes, ids, blobs); s = 3 of them are real secrets (illustrative).
# The strings are half git-style hashes, a quarter identifiers and a
# quarter paths; real secrets are half A and half B style. Flag shares
# come from p31 (t = 3.5: hashes 0.9510, identifiers 0.4985, paths 0.7965,
# B keys 0.9490; t = 4.0: paths 0.0400, B keys 0). Format F with checksum
# flags A tokens only. Alerts = N fpr + s tpr and
# precision = s tpr / alerts (Bayes). Published detection shares from
# Meli et al. (2019): TruffleHog found 0.25236 of their Search secrets
# and 0.2939 of BigQuery secrets; with its regexes only, 0.19263 and
# 0.2229. Their own distinct-format regexes: 133,934 of 134,887 unique
# Search candidates were valid, an accuracy of 99.29 percent.
import math

N, S = 200000, 3


def scan(tpr, fpr):
    alerts = math.fsum([N * fpr, S * tpr])
    return alerts, (S * tpr / alerts if alerts else 0.0)


if __name__ == "__main__":
    print("rule                     tpr    fpr      alerts  precision")
    fpr35 = math.fsum([0.5 * 0.9510, 0.25 * 0.4985, 0.25 * 0.7965])
    rules = [("entropy t=3.5", math.fsum([0.5, 0.5 * 0.9490]), fpr35),
             ("entropy t=4.0", 0.5, 0.25 * 0.0400),
             ("format F", 0.5, 1.0 / 62 ** 6),
             ("format F, all keys A", 1.0, 1.0 / 62 ** 6)]
    for name, tpr, fpr in rules:
        a, prec = scan(tpr, fpr)
        print("{:<24} {:>6.4f} {:>8.6f} {:>10,.1f} {:>9.6f}".format(
            name, tpr, fpr, a, prec))
    print("missed per 1,000 leaked secrets, published detection shares:")
    for name, share in (("TruffleHog, Search", 0.25236),
                        ("TruffleHog, BigQuery", 0.2939),
                        ("regex only, Search", 0.19263),
                        ("regex only, BigQuery", 0.2229)):
        print("  {:<22} found {:.4f}, missed {:>6.1f}".format(
            name, share, 1000.0 * (1.0 - share)))
    print("findable after push in a median of 20 s: scan before push")

Single source and citation

Fan, Y. (2026). Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense (Version 1.0.0), Chapter 3: Credential Hygiene: Format Checks and Revocation Lists. 5D Library. DOI pending

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

BibTeX
@book{fan2026336,
  author    = {Fan, Yafu},
  title     = {Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book