Skip to Content
PoC BatteryP05 — DICE Layering

P05 — DICE Key-Layering Chain in Pure Software

Status green · Claim PC5 · Corpus anchor L4 §1.1 device identity; registry opentitan “owner-deployable RoT PKI” · Effort S · Execution host external: omarchy

What it proves

PC5 — the TCG DICE construction (UDS → CDI → per-layer derived keys, IDEVID/LDEVID) is a standard, mechanically reproducible cryptographic chain that a user can implement in ~fifty lines of Python. The corpus marks this detail as an L4 §1.1 inference — this runbook turns the inference into a demonstration: when the gate prints, you will have derived the full chain in software and watched one flipped firmware byte change every key.

Why it matters

The same layering is what Caliptra’s “unique cryptographic identity via secure boot” and OpenTitan’s DICE IDEVID are built on, so this run also proves P02’s whole premise end-to-end. The corpus only lists this detail as an inference in L4 §1.1; a working chain is what turns that inference into evidence. If the chain were not reproducible in pure software, the book’s simplest demonstration of what “device identity” means would be gone.

Why this, not that

We do (Y)We don’t (X)Because
Implement DICE math in pure PythonRun Caliptra’s whole RTL just to see identityDICE is a construction, not a silicon artifact; proving the chain (HMAC layering of firmware measurements into CDI, then keys) is the clearest possible evidence of what “device identity” means
Provide --flip to prove sensitivity to one firmware byteOnly show the happy pathThe RoT promise is authenticity — change one byte of the measured firmware, and every derived key must change; that is the negative proof
Self-verify the ECDSA signatures at each layerStop at “here’s a derived hash”Identity that never publishes a signed attestation would be insufficient; the signature check is the “attestation” output

What you need

  • Python 3.9+, pip install cryptography. No TPM, no hardware. Runs anywhere, including the Linux server and this Mac.

How to run it

  1. cd poc/P05-dice-layering — enter the runbook directory.
  2. pip3 install -r requirements.txt — install the cryptography dependency.
  3. python3 scripts/dice_layering.py — run the default chain: two layers, well-known UDS.
  4. python3 scripts/dice_layering.py --flip — NEGATIVE run: flip one byte of stage-1 firmware.

What “done” looks like

python3 scripts/dice_layering.py # MUST print, one line per layer: # POC-P05-OK-IDEVID: signature verified # POC-P05-OK-LDEVID: signature verified python3 scripts/dice_layering.py --flip # MUST print: # POC-P05-NEGATIVE: CDI changed after single-byte flip

Where the evidence goes

Copy into evidence/:

  • run_ok.txt — full output of the regular run.
  • run_flip.txt — full output of the --flip run.

What this does not prove

  • The CDI-layering labels are matched to the TCG DICE spec’s terminology (“immutable root key”, layer-0 RO measurement, etc.) — cite the spec (TCG DICE Architectures) in the report, or the L4 §1.1 inference note, whichever is more defensible.
  • This is not a shipping chip identity — it produces test keys. It proves the mechanism, which is what PC5 claims.
Last updated on
Superdefence II — defensive security research.