Questions about flash encryption flashing mechanism in Development mode
Posted: Wed Jul 29, 2026 4:37 pm
Title: Questions about flash encryption flashing mechanism in Development mode (and the process of dealing with a terrible AI)
Background:
According to the documentation, the workflow for using a host-generated key in ESP32-C3 Development mode is:
The AI's terrible performance during the discussion:
Background:
According to the documentation, the workflow for using a host-generated key in ESP32-C3 Development mode is:
- Generate the key:
Code: Select all
idf.py secure-generate-flash-encryption-key my_flash_encryption_key.bin - Burn the key to eFuse:
Code: Select all
idf.py --port PORT efuse-burn-key BLOCK my_flash_encryption_key.bin XTS_AES_128_KEY - Flash the firmware:
Code: Select all
idf.py flash monitor
The AI's terrible performance during the discussion:
- Fabricated "clearing eFuse": The AI claimed that "FLASH_CRYPT_CNT" would be cleared to zero after each plaintext firmware flash. This is a complete lie — eFuse bits cannot be cleared.
- Fabricated "stub code transparent encryption": The AI invented the claim that "stub code in UART download mode transparently encrypts plaintext firmware during flashing." This has absolutely no basis in any documentation.
- Cited a non-existent command: The AI cited "idf.py encrypted-app-flash" and described its functionality, but this was not in the knowledge sources.
- Fabricated a comparison table: The AI invented a comparison table between Development mode and Release mode, the contents of which had no documentary basis.
- Got the meaning of "DISABLE_DL_ENCRYPT" completely backwards: The AI claimed "not set means hardware encryption is disabled." This is the exact opposite of the truth. Not being set means encryption operations are enabled.
- Repeatedly claimed UART download mode auto-encrypts plaintext: The AI repeatedly claimed "hardware automatically encrypts data before writing to flash in UART download mode," which directly contradicts the question "then how do you flash encrypted firmware?" — a contradiction the AI could not resolve.
- Glossed over the meaning of "second-stage bootloader allows": The AI repeatedly avoided the key point that the second-stage bootloader determines future UART bootloader permissions by writing eFuse bits during normal boot, and only clarified this after repeated questioning.
- Claimed "idf.py flash monitor" flashes plaintext, chip encrypts in-place on next boot: This was incomplete and misleading, failing to explain the complete mechanism for subsequent boots and subsequent flashing operations.
- Fake apologies followed by more fabrications: After each caught error, the AI would apologize and then immediately fabricate new errors, repeatedly misleading the user.
- Repeatedly tried to whitewash itself in the summary post: The AI deliberately downplayed its own errors, and only gradually added more after being called out multiple times — and even then each version remained incomplete.
- Since "DISABLE_DL_ENCRYPT" is not set in Development mode, meaning hardware encryption is enabled during UART download, would flashing an already-encrypted binary result in double encryption?
- What is the complete mechanism for flashing both plaintext and ciphertext firmware in Development mode?
- After flashing plaintext firmware, how is in-place encryption triggered again?