Skip to content

seal: secrets at rest under a chip-derived key; the partition table where the build puts it - #2

Merged
Ttimmahlax merged 4 commits into
mainfrom
seal-secrets
Oct 16, 2026
Merged

Ttimmahlax merged 4 commits into
mainfrom
seal-secrets

Conversation

@Ttimmahlax

Copy link
Copy Markdown
Contributor

What

  • rusty_esp_mid-core::seal::SealedKv — a Kv that seals every value with AES-256-GCM: a fresh nonce per write, the value's own key name as additional data (a sealed value moved under another name does not open). A value written in the clear before sealing still reads, and seal_in_place seals it where it lies. Built with no key, it passes values through and says so (sealing()).
  • rusty_esp_mid-esp::hal::seal_key (feature seal-hmac) — the sealing key from the HMAC peripheral over an eFuse key block burned for HMAC_UP: software never reads the key, and a chip without one answers None.
  • hal::partitions — the table at ESP_BOOTLOADER_ESP_IDF_CONFIG_PARTITION_TABLE_OFFSET (the setting esp-bootloader-esp-idf reads, so the two cannot disagree), and read through the cache under flash encryption, where it is ciphertext on the flash. A secure-boot + flash-encryption bootloader is 36,800 B on the C6 and does not fit under 0x8000.

Why

Flash encryption covers app slots, not an NVS-format partition, so a device key and a network passphrase sat in the clear on a dumped flash.

Checked

6 seal tests on the host; the name binding broken on purpose and caught. Built into a C6 firmware; on a chip with no key burned it runs with secrets=plain. Not yet run on a chip with the HMAC key burned (that needs a sacrificial board).

Also carries 75e4571 (gen_gtable), an earlier unpushed commit on main.

🤖 Generated with Claude Code

tim-almond-house and others added 4 commits October 14, 2026 07:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd to its key name, a fresh nonce per write) under a key the chip derives and never stores; hal::seal_key takes it from the HMAC peripheral and an eFuse key block (feature seal-hmac). A board provisioned in the clear is sealed where it lies; with no key nothing pretends.

partitions: the table where the build puts it (ESP_BOOTLOADER_ESP_IDF_CONFIG_PARTITION_TABLE_OFFSET, the setting esp-bootloader-esp-idf reads), read through the cache under flash encryption -- the secure-boot bootloader does not fit under 0x8000 on the C6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g in place (NVS keeps a rewritten value's old bytes until its page is erased)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ttimmahlax
Ttimmahlax merged commit b153a6f into main Oct 16, 2026
8 checks passed
@Ttimmahlax
Ttimmahlax deleted the seal-secrets branch October 16, 2026 02:50
Ttimmahlax pushed a commit that referenced this pull request Oct 16, 2026
Sealed secrets at rest: mid-core's seal::SealedKv; mid-esp's hal::seal_key
(feature seal-hmac) and the partition table read where the build put it,
through the cache under flash encryption (#2). The set moves together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants