From 765b75d37bbc8d1152e322ba2ddb5d94f748d3d8 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 29 Jun 2021 11:31:10 +1000 Subject: [PATCH] docs: Add description of manual encryption steps Closes https://github.com/espressif/esp-idf/issues/5037 --- docs/en/security/flash-encryption.rst | 57 +++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/docs/en/security/flash-encryption.rst b/docs/en/security/flash-encryption.rst index 9feb56658e..7834970870 100644 --- a/docs/en/security/flash-encryption.rst +++ b/docs/en/security/flash-encryption.rst @@ -373,7 +373,9 @@ Enabling flash encryption will increase the size of bootloader, which might requ This command will write to flash memory unencrypted images: the firmware bootloader, the partition table and applications. Once the flashing is complete, {IDF_TARGET_NAME} will reset. On the next boot, the firmware bootloader encrypts: the firmware bootloader, application partitions and partitions marked as ``encrypted`` then resets. Encrypting in-place can take time, up to a minute for large partitions. After that, the application is decrypted at runtime and executed. -At this stage, if you need to update and re-flash binaries, see :ref:`encrypt-partitions`. +If using Development Mode, then the easiest way to update and re-flash binaries is :ref:`encrypt-partitions`. + +If using Release Mode, then it is possible to pre-encrypt the binaries on the host and then flash them as ciphertext. See :ref:`manual-encryption`. .. _encrypt-partitions: @@ -440,9 +442,9 @@ For subsequent plaintext field updates, use :ref:`OTA scheme ` then you will need to pass the ``--flash_crypt_conf`` argument to ``espsecure.py`` to set the matching value. This will not happen if the device configured flash encryption by itself, but may happen if burning efuses manually to enable flash encryption. + +The command ``espsecure.py decrypt_flash_data`` can be used with the same options (and different input/output files), to decrypt ciphertext flash contents or a previously encrypted file. + Technical Details -----------------