TExcelTAD
Home › Applied Cryptography: Ciphers, Hashes, Signatures, PKI & TLS › Certificate Transparency and ACME

Certificate Transparency and ACME

In 2011 the Dutch CA DigiNotar was breached and the attacker issued a certificate for *.google.com, which was then used to intercept the Gmail traffic of hundreds of thousands of users in Iran. Google found out only because Chrome had Google's own keys pinned. Any of the hundreds of trusted CAs could issue a certificate for any name, and nobody, not even the domain owner, could see what had been issued. Two developments changed that picture: Certificate Transparency made issuance public and auditable, and ACME made issuance automatic, which is what makes short-lived certificates practical.

Certificate Transparency

CT (RFC 6962, version 2 in RFC 9162) requires that publicly trusted certificates be recorded in public, append-only logs run by independent operators (Google, Cloudflare, DigiCert, Sectigo, Let's Encrypt and others).

  1. Before issuing, the CA submits a precertificate to several logs.
  2. Each log returns a signed certificate timestamp (SCT): a promise to include the entry within the maximum merge delay (24 hours).
  3. The CA embeds the SCTs in the certificate (or the server delivers them in a TLS extension or a stapled OCSP response).
  4. Browsers require SCTs: Chrome and Safari reject public certificates without enough SCTs from distinct, qualified logs.
  5. Monitors watch the logs; anyone can search them (crt.sh, Censys, Cloudflare's monitor, Facebook's). A domain owner sees every certificate issued for their names, usually within minutes.

CT doesn't prevent mis-issuance; it makes it detectable, which deters CAs and lets owners react. Several CAs were distrusted after CT helped reveal their mistakes (Symantec's CA business, including Thawte, GeoTrust and RapidSSL, in 2017–2018, among them).

Why the logs can't quietly cheat: Merkle trees

A log stores entries as the leaves of a Merkle tree: each leaf is hashed, pairs of hashes are hashed together, up to a single tree head that the log signs. Two kinds of proof keep the log honest:

  • an inclusion proof shows that a certificate is in the tree with a given head, using only about log⁡2n\log_2 n hashes;
  • a consistency proof shows that a newer tree head extends an older one, so entries can't be removed or changed after the fact.

The example builds a seven-entry toy log with the RFC 6962 hashing rules (a 0x00 prefix for leaves and 0x01 for inner nodes, so a leaf can never be passed off as a node) and verifies an inclusion proof.

python · try it yourself
import hashlib

def leaf_hash(entry): return hashlib.sha256(b"\x00" + entry).digest()      # RFC 6962: 0x00 for leaves
def node_hash(l, r):  return hashlib.sha256(b"\x01" + l + r).digest()      # 0x01 for inner nodes

def mth(leaves):                                     # Merkle tree hash of a list of leaf hashes (RFC 6962 2.1)
    if len(leaves) == 1: return leaves[0]
    k = 1
    while k * 2 < len(leaves): k *= 2
    return node_hash(mth(leaves[:k]), mth(leaves[k:]))

def audit_path(m, leaves):                           # inclusion proof for leaf index m
    if len(leaves) == 1: return []
    k = 1
    while k * 2 < len(leaves): k *= 2
    if m < k: return audit_path(m, leaves[:k]) + [mth(leaves[k:])]
    return audit_path(m - k, leaves[k:]) + [mth(leaves[:k])]

def verify(m, n, leaf, path, root):                  # RFC 9162 2.1.3.2, simplified for this toy
    fn, sn, r = m, n - 1, leaf
    for p in path:
        if fn % 2 == 1 or fn == sn:
            r = node_hash(p, r)
            while fn % 2 == 0 and fn != 0:
                fn >>= 1; sn >>= 1
        else:
            r = node_hash(r, p)
        fn >>= 1; sn >>= 1
    return r == root

certs = [b"cert: www.lab.test serial 01", b"cert: api.lab.test serial 02", b"cert: mail.lab.test serial 03",
         b"cert: lab.test serial 04", b"cert: vpn.lab.test serial 05", b"cert: shop.lab.test serial 06",
         b"cert: login.lab.test serial 07"]
leaves = [leaf_hash(c) for c in certs]
root = mth(leaves)
print("log size:", len(leaves), " tree head:", root.hex()[:24], "...")
m = 4
path = audit_path(m, leaves)
print(f"proof for entry {m} ({certs[m].decode()}): {len(path)} hashes")
print("inclusion verified:", verify(m, len(leaves), leaves[m], path, root))
print("forged entry rejected:", not verify(m, len(leaves), leaf_hash(b"cert: vpn.lab.test serial 99"), path, root))
for n in (7, 1_000_000, 10**10):
    print(f"proof size for a log of {n:>14,} entries: {(n - 1).bit_length()} hashes")
log size: 7  tree head: 0a2487f623de7f3b326cb2c0 ...
proof for entry 4 (cert: vpn.lab.test serial 05): 3 hashes
inclusion verified: True
forged entry rejected: True
proof size for a log of              7 entries: 3 hashes
proof size for a log of      1,000,000 entries: 20 hashes
proof size for a log of 10,000,000,000 entries: 34 hashes

Even for ten billion entries, an inclusion proof is at most 34 hashes (about 1 KB). The same structure secures Go's module checksum database, Sigstore's Rekor transparency log and binary-transparency systems (Software supply chain). Logs are being migrated to the newer static CT API ("tiled" logs, served as static files), which Let's Encrypt and others moved to in 2025.

ACME: automatic issuance

The Automatic Certificate Management Environment (RFC 8555), created for Let's Encrypt (launched 2015), lets software obtain certificates without humans:

  1. The client creates an account key and registers with the CA.
  2. It places an order for names; the CA returns a challenge per name.
  3. The client proves control of each name:
    • HTTP-01: serve a file at http://<name>/.well-known/acme-challenge/<token>;
    • DNS-01: publish a TXT record _acme-challenge.<name> (required for wildcards);
    • TLS-ALPN-01: answer a special TLS handshake on port 443.
  4. The client sends a CSR; the CA issues the certificate; the client installs it and renews automatically (typically when a third of the lifetime remains, or when the CA's ACME Renewal Information, ARI, says so).

The challenge response binds the token to the account key, so only the account that asked can complete it. The key authorization is token + "." + thumbprint, where the thumbprint is the base64url SHA-256 of the account's public key in canonical JWK form (RFC 7638); DNS-01 publishes the base64url SHA-256 of that string. With a fixed lab-only account key and an example token:

python · try it yourself
import base64, hashlib, json
from cryptography.hazmat.primitives.asymmetric import ec

def b64u(b): return base64.urlsafe_b64encode(b).rstrip(b"=").decode()

account = ec.derive_private_key(424242, ec.SECP256R1())     # fixed lab-only ACME account key
n = account.public_key().public_numbers()
jwk = {"crv": "P-256", "kty": "EC", "x": b64u(n.x.to_bytes(32, "big")), "y": b64u(n.y.to_bytes(32, "big"))}
thumb = b64u(hashlib.sha256(json.dumps(jwk, separators=(",", ":"), sort_keys=True).encode()).digest())
print("JWK thumbprint (RFC 7638):", thumb)

token = "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"           # sent by the CA (example value)
key_auth = token + "." + thumb
print("HTTP-01: serve at /.well-known/acme-challenge/" + token[:12] + "...")
print("         body =", key_auth[:24] + "..." + key_auth[-8:])
print("DNS-01 : TXT _acme-challenge.lab.test =", b64u(hashlib.sha256(key_auth.encode()).digest()))
JWK thumbprint (RFC 7638): p3eBvEEZ9nJFRhqsh-jtu1EsN-8JEe4OjKi6J0ed_e8
HTTP-01: serve at /.well-known/acme-challenge/evaGxfADs6pS...
         body = evaGxfADs6pSRb2LAv9IZf17...6J0ed_e8
DNS-01 : TXT _acme-challenge.lab.test = 61uN3Qu2Bn9Ozbtq_XDZaVo24gh2VLU9wJgWmatz-Jk

Weak points of domain validation

Domain-validated certificates are only as strong as the control check:

  • BGP or DNS hijacking can let an attacker pass HTTP-01 or DNS-01 for a domain they don't own; CAs now validate from several network vantage points ("multi-perspective issuance corroboration", required by the CA/Browser Forum since 2025).
  • Dangling DNS (a CNAME to a deleted cloud resource) lets someone claim the resource and get certificates for your subdomain.
  • CAA records (RFC 8659) say which CAs may issue for a domain: lab.test. CAA 0 issue "letsencrypt.org". CAs must check them.

How problems are detected

  • CT monitoring of your own domains: alerts for any certificate you didn't request (unknown CA, unknown names, unexpected wildcards). Free monitors exist; large organisations run their own.
  • CT as reconnaissance (in authorised assessments): certificates reveal internal host names (vpn-old.lab.test, jira-staging.lab.test); defenders should check what their own CT footprint exposes.
  • Expiry and renewal failures: ACME clients failing silently; certificates close to expiry in monitoring.
  • CAA and DNS hygiene: missing CAA records, dangling CNAMEs.

How it is fixed

  • Automate issuance and renewal with ACME everywhere possible; alert on renewal failures.
  • Publish CAA records naming your CAs (and iodef for reports).
  • Monitor CT for your domains and have a runbook: confirm, contact the CA, request revocation, investigate how validation was passed.
  • Avoid putting sensitive internal names in public certificates: use an internal CA for them.

Pitfalls

  • Thinking CT is a privacy tool: it is the opposite; every public certificate's names are published.
  • Wildcards as a way to hide names: they hide the names but spread one key over many systems.
  • Running ACME clients as root with broad file-system access; keep the account key and the web-root write access narrow.

Practice

1. A CT monitor alerts on a certificate for login.lab.test from a CA your organisation doesn't use. What do you do?

Check whether any team requested it (shadow IT happens). If not, treat it as mis-issuance or a validation compromise: contact the CA with the CT log entry and ask for revocation, check DNS and BGP for hijacking and dangling records, add or tighten CAA records, and look for traffic to unexpected servers for that name.

2. Why does the CT hash put 0x00 before leaves and 0x01 before inner nodes?

Domain separation: without it, an inner node's input (two concatenated hashes) could be presented as a leaf, enabling second-preimage tricks against the tree.

3. Which ACME challenge do you need for *.lab.test?

DNS-01: wildcard certificates can only be validated through DNS.

Practice problem in 21 languages: Merkle Root.

Test yourself

What does Certificate Transparency achieve?

  1. It encrypts certificates
  2. It makes every publicly trusted certificate publicly visible, so mis-issuance can be detected
  3. It replaces CAs
  4. It revokes certificates

Why can a CT inclusion proof stay small even for billions of entries?

  1. Entries are compressed
  2. A Merkle proof needs only about log⁡2n\log_2 n hashes
  3. Proofs are signed
  4. Only recent entries are included

Which ACME challenge proves control by publishing a DNS TXT record?

  1. HTTP-01
  2. DNS-01
  3. TLS-ALPN-01
  4. OCSP

What do CAA DNS records specify?

  1. The certificate's SAN
  2. Which CAs may issue certificates for the domain
  3. The OCSP URL
  4. The TLS version