id: b1a3e966f0704d1f848873f05f9f6a69
parent_id: b6f9dc86c1624d62bd2e9713dd9a2de3
item_type: 1
item_id: fa9e72ee12554f978a86ab3f7888cc63
item_updated_time: 1782806848093
title_diff: "[]"
body_diff: "[{\"diffs\":[[0,\"e **\"],[-1,\"production** event/data flow and the security\\\n> rationale.\"],[1,\"modes** and security rationale. Production detail now\\\n> lives in two dedicated notes:\\\n> - **\\\"Keyfob Flow 1 — Content Supply: Ford IVSS/GIVIS → Clypeum KLMS\\\"**\\\n> - **\\\"Keyfob Flow 2 — Provisioning: Station ↔ Key Fob ↔ Clypeum\\\"**\\\n>\\\n>\"],[0,\" For\"]],\"start1\":313,\"start2\":313,\"length1\":66,\"length2\":238},{\"diffs\":[[0,\"atus see\"],[-1,\"\\\n>\"],[0,\" **\\\"Ford\"]],\"start1\":603,\"start2\":603,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"Ford EoL Key\"],[1,\"\\\n>\"],[0,\" Fob Provisi\"]],\"start1\":615,\"start2\":615,\"length1\":24,\"length2\":26},{\"diffs\":[[0,\")\\\"**\"],[-1,\"; for the full 5-actor\\\n> message tables + bundle/cache plane see **\\\"Keyfob Station — KLMS Data Contract\\\n> & E2E Sequence\\\"**\"],[0,\".\\\n\\\n#\"]],\"start1\":660,\"start2\":660,\"length1\":131,\"length2\":8},{\"diffs\":[[0,\"uction: \"],[-1,\"KLMS\"],[1,\"Clypeum\"],[0,\"-orchest\"]],\"start1\":683,\"start2\":683,\"length1\":20,\"length2\":23},{\"diffs\":[[0,\"ver \"],[-1,\"comes near\"],[1,\"reaches\"],[0,\" the\"]],\"start1\":763,\"start2\":763,\"length1\":18,\"length2\":15},{\"diffs\":[[0,\"ves \"],[-1,\"only in\\\nthe generation HSM (Ford/Clypeum). The factory side gets only throwaway session\\\nkeys + pre-encrypted content.\\\n\\\n**Topology (revised):**\\\n- **Master key + KDF3 (Phase 1)** run at the **generation side**. Per-fob static\\\n  keys are packaged into **encrypted bundles**.\\\n- The **station-side HSM** (YubiHSM 2 / Nitrokey / Utimaco)\"],[1,\"in the\\\n**Clypeum NetHSM** (imported from NXP, never exported); the NetHSM\"],[0,\" doe\"]],\"start1\":801,\"start2\":801,\"length1\":339,\"length2\":81},{\"diffs\":[[0,\"es **AES\"],[-1,\" \"],[1,\"\\\n\"],[0,\"primitiv\"]],\"start1\":881,\"start2\":881,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"ives\"],[-1,\"\\\n \"],[0,\" only** \"],[-1,\"(AES-CMAC/AES-CBC) and holds the **bundle-decryption private key\\\n  (generated inside it)**. It does NOT understand SCP03/KDF3.\\\n- The **KLMS orchestrates** Phase-2 (static→session) by calling the HSM per AES\\\n  op, and maintains a **cache of decrypted packages** (watchdog ≥2 weeks stock).\\\n\\\n### Async plane — bundle/cache (keeps stock warm, decoupled from the line)\\\n\\\n```\\\nGEN SIDE              STATION-SIDE HSM            KLMS (cache + watchdog)\\\n─────────────────────────────────────────────────────────────────────────\\\n (A0) export \"],[1,\"and the **KLMS orchestrates** SCP03.\\\n\\\nTwo independent planes:\\\n\\\n- **Flow 1 — Content Supply (async):** Ford IVSS/GIVIS ships per-fob **content**\\\n  (FESN, SPID, certs, device key) as encrypted **\"],[0,\"bundle\"],[-1,\"-\"],[1,\"s** (\"],[0,\"encrypt\"],[-1,\"ion pubkey  ◄───────── generated keypair; privkey never leaves\\\n encrypt bundle of N packages ─────────────────►  fetch / push\\\n                       decrypt bundle ────────►\\\n                                                  decrypt → key objects (HSM) + content → cache\\\n                                                  watchdog: stock < 2-wk? → request more\\\n```\\\n\\\n### Real-time plane — per fob\\\n\\\n```\\\nSTATION                       KEY FOB (card)                 KLMS (orch)      Station-HSM (AES)\\\n──────────────────────────────────────────────────────────────────────────────────────────────\\\n 1. INITIALIZE UPDATE  ──────►\\\n    80 50 <KVN> 00 08 <host_challenge[8]>\\\n                        ◄─────  2. div_data(10=UID) ‖ key_info ‖ seq_ctr[3]\\\n                                   ‖ card_challenge[8] ‖ card_cryptogram[8]\\\n\\\n 3. POST /provision/session  ─────────────────────────────────►\\\n    { uid, key_version, host_challenge, card_challenge,\\\n      sequence_counter, card_cryptogram, fob_identity (SPID/FESN) }\\\n                                  4. cache lookup(uid) → static-key handles + content\\\n                                  5. AES-CMAC(s_mac, …)  ───────────────────────────►\\\n                                  6. ◄──────────────────────── expected card-cryptogram\\\n                                     VERIFY card_cryptogram  ← reject rogue/clone fob\\\n                                  7. AES-CMAC(s_enc/s_mac, …) ×3  ───────────────► (session \"],[1,\"ed to a keypair\\\n  generated in the NetHSM). The Clypeum **watchdog** fetches bundles, the NetHSM\\\n  decrypts them, and a decrypted-package cache is kept at ≥ **2 weeks** of stock.\\\n  *No SCP03 keys here.*\\\n- **Flow 2 — Provisioning (real-time):** the station sends the fob UID + handshake\\\n  to Clypeum via a **DLL over mTLS**. Clypeum looks up cached content and uses the\\\n  NetHSM to derive **static keys (\"],[0,\"KDF\"],[1,\"3\"],[0,\", \"],[-1,\"Phase 2)\\\n                                  8. ◄──────────────────────── SES-ENC/MAC/RMAC\\\n                                  9. AES-CMAC(s_mac, …)  ───────────────────────► host cryptogram\\\n                                 10. AES-CBC(s_dek, A003_scalar)  ───────────────► pre-encrypt\\\n                        ◄──────────────────────────────────── 11. response\\\n    { ses_enc, ses_mac, ses_rmac, host_cryptogram,\\\n      personalization_items (A003 already S-DEK-encrypted),\\\n      post_perso_commands, transaction_id, expires_at }\\\n\\\n12. EXTERNAL AUTHENTICATE  ──────►\\\n    84 82 <level> 00 <host_cryptogram>   (C-MAC over cmd via SES-MAC)\\\n                        ◄─────  9000  (channel open)\\\n\\\n13. STORE DATA blocks (DGI payload)  ──────►  (each C-MAC'd with SES-MAC)\\\n14. Lifecycle transition  84 E2 80 <P2> 00  ──────►   → FACTORY\\\n15. Post-perso raw commands (no SM)         ──────►\\\n16. result → KLMS ──► audit + retire cached package (consume)\\\n17. DROP session keys → zeroized\\\n```\\\n\\\n### What never reaches the factory floor\\\n- **Master key** — generation-side gen-HSM only (not in the station HSM, KLMS, or station).\\\n- **Per-fob static keys (S-ENC/MAC/DEK)** — held as HSM key objects on the\\\n  factory side; ideally never as plaintext in the KLMS.\\\n- **Plaintext fob private key (A003)** — pre-encrypted (AES-CBC under S-DEK) by\\\n  the HSM; the station only ever sees the ciphertext.\\\n\\\n### \"],[1,\"master+UID)** → **session keys** +\\\n  cryptograms + A003 S-DEK encryption, returning a **container** (session keys +\\\n  pre-encrypted content). The station then runs EXTERNAL AUTHENTICATE → STORE DATA\\\n  → lifecycle → post-perso → zeroize.\\\n\\\n**\"],[0,\"What\"]],\"start1\":896,\"start2\":896,\"length1\":3386,\"length2\":876},{\"diffs\":[[0,\"ized\"],[-1,\" on drop)\\\n- E\"],[1,\"):** e\"],[0,\"phem\"]],\"start1\":1806,\"start2\":1806,\"length1\":21,\"length2\":14},{\"diffs\":[[0,\"hemeral \"],[-1,\"**\"],[0,\"session \"]],\"start1\":1817,\"start2\":1817,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"keys\"],[-1,\"** for the active channel (unavoidable — the terminal\\\n  must C-MAC every `STORE DATA`).\\\n- The pre-encrypted A003 ciphertext (already encrypted; not decryptable by the\\\n  station).\\\n\\\n### \"],[1,\" + the\\\npre-encrypted A003 ciphertext. **Never** the master key, static keys, or S-DEK.\\\n\\\n**\"],[0,\"Secu\"]],\"start1\":1833,\"start2\":1833,\"length1\":192,\"length2\":98},{\"diffs\":[[0,\"operties\"],[1,\":**\"],[0,\"\\\n- A com\"]],\"start1\":1938,\"start2\":1938,\"length1\":16,\"length2\":19},{\"diffs\":[[0,\"station \"],[-1,\"**\"],[0,\"cannot d\"]],\"start1\":1966,\"start2\":1966,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"her UIDs\"],[-1,\"**\"],[0,\" (no mas\"]],\"start1\":1999,\"start2\":1999,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"ster\"],[-1,\" key, no\\\n  \"],[1,\"/\"],[0,\"stat\"]],\"start1\":2014,\"start2\":2014,\"length1\":19,\"length2\":9},{\"diffs\":[[0,\"romises \"],[-1,\"**\"],[0,\"only tha\"]],\"start1\":2060,\"start2\":2060,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"sion\"],[-1,\"**, not the\\\n  fob for life\"],[0,\".\\\n- The \"],[-1,\"**\"],[0,\"card\"]],\"start1\":2094,\"start2\":2094,\"length1\":44,\"length2\":16},{\"diffs\":[[0,\" by \"],[-1,\"the KLMS**\"],[1,\"Clypeum\"],[0,\" (\"],[1,\"`\"],[0,\"card\"]],\"start1\":2127,\"start2\":2127,\"length1\":20,\"length2\":18},{\"diffs\":[[0,\"gram\"],[1,\"`\"],[0,\" check)\"],[-1,\": a rogue/blank\\\n  fob presenting a UID it doesn't hold is rejected before session\"],[1,\" before\"],[0,\" keys \"],[-1,\"are \"],[0,\"issue\"],[-1,\"d\"],[0,\".\\\n\"],[-1,\"- The **master key is never on the factory floor** — even a full factory\\\n  compromise (station + HSM + KLMS) exposes only the bundle-decryption key +\\\n  cached static keys, not the master key.\\\n\\\n### \"],[1,\"\\\n**\"],[0,\"Impl\"]],\"start1\":2152,\"start2\":2152,\"length1\":311,\"length2\":39},{\"diffs\":[[0,\"oundary)\"],[1,\":**\"],[0,\"\\\n- `Scp0\"]],\"start1\":2208,\"start2\":2208,\"length1\":16,\"length2\":19},{\"diffs\":[[0,\"ect \"],[-1,\"KLMS-issued session keys\\\n  (no static keys; KLMS authenticates the card).\\\n- `KlmsProvisioner` (`kf-provision/src/klms.rs`)\"],[1,\"the container's session keys.\\\n- `KlmsProvisioner`\"],[0,\" — r\"]],\"start1\":2271,\"start2\":2271,\"length1\":130,\"length2\":57},{\"diffs\":[[0,\" flagged\"],[-1,\"\\\n \"],[0,\" `encryp\"]],\"start1\":2340,\"start2\":2340,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"LMS+\"],[1,\"Net\"],[0,\"HSM\"],[-1,\", verifies\\\n  the card cryptogram\"],[0,\").\\\n-\"],[-1,\" The\"],[0,\" KLM\"]],\"start1\":2437,\"start2\":2437,\"length1\":51,\"length2\":18},{\"diffs\":[[0,\"ls (\"],[-1,\"cache, \"],[0,\"watc\"]],\"start1\":2464,\"start2\":2464,\"length1\":15,\"length2\":8},{\"diffs\":[[0,\"og, \"],[-1,\"HSM primitives, bundle decrypt) are\\\n  Clypeum's; our boundary is the Station↔KLMS contract.\\\n\\\n### Open questions for SecOps / Clypeum\\\n- [ ] REST/DLL wire contract (trait is the interface; implementation pending).\\\n- [ ] mTLS details for the station↔KLMS link.\\\n- [ ] **HSM product** (YubiHSM 2 / Nitrokey / Utimaco) for station-side primitives + bundle decrypt.\\\n- [ ] **Static-key placement**: HSM key objects (preferred) vs KLMS RAM.\\\n- [ ] **Bundle encryption scheme** (RSA-OAEP / ECIES / AES-KW) + push vs pull delivery.\\\n- [ ] **Does A003 plaintext reach the KLMS**, or is it encrypted inside the HSM during unwrap?\\\n- [ ] **2-week stock sizing** (line rate × hours × margin).\\\n- [ ] **Does KLMS verify card_cryptogram?** (Recommended — the mock already does.)\\\n- [ ] TTL on issued session keys (recommended ~5 s).\\\n- [ ] Production security level: C-MAC only, or C-MAC + R-MAC + C-DEC?\\\n- [ ] Key-version strategy (how the station knows which KVN the fob expects)\"],[1,\"cache, NetHSM orchestration) are Clypeum's.\\\n\\\n> See the two Flow notes for full message tables, request/response JSON, and ASCII diagrams\"],[0,\".\\\n\\\n-\"]],\"start1\":2474,\"start2\":2474,\"length1\":966,\"length2\":144}]"
metadata_diff: {"new":{},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-06-30T08:07:46.322Z
created_time: 2026-06-30T08:07:46.322Z
type_: 13