docs: Update Chinese translation for security/flash-encryption.rst and index.rst

This commit is contained in:
renpeiying 2023-10-08 17:21:14 +08:00
parent 1ec70cd568
commit 6fba4113cc
3 changed files with 22 additions and 22 deletions

View File

@ -40,7 +40,7 @@ With flash encryption enabled, the following types of data are encrypted by defa
- Partition Table
- :ref:`nvs_encr_key_partition`
- Otadata
- All "app" type partitions
- All ``app`` type partitions
Other types of data can be encrypted conditionally:
@ -180,7 +180,7 @@ Assuming that the eFuse values are in their default states and the firmware boot
2. Firmware bootloader reads the ``{IDF_TARGET_CRYPT_CNT}`` eFuse value (``0b0000000``). Since the value is ``0`` (even number of bits set), it configures and enables the flash encryption block. It also sets the ``FLASH_CRYPT_CONFIG`` eFuse to 0xF. For more information on the flash encryption block, see *{IDF_TARGET_NAME} Technical Reference Manual* > *eFuse Controller (eFuse)* > *Flash Encryption Block* [`PDF <{IDF_TARGET_TRM_EN_URL}#efuse>`__].
3. Fimware bootloader first checks if a valid key is already present in the eFuse (e.g., burned using espefuse tool) then the process of key generation is skipped and the same key is used for flash encryption process. Otherwise, Firmware bootloader uses RNG (random) module to generate an AES-256 bit key and then writes it into the ``flash_encryption`` eFuse. The key cannot be accessed via software as the write and read protection bits for the ``flash_encryption`` eFuse are set. The flash encryption operations happen entirely by hardware, and the key cannot be accessed via software.
3. Fimware bootloader first checks if a valid key is already present in the eFuse (e.g., burned using espefuse tool), then the process of key generation is skipped and the same key is used for flash encryption process. Otherwise, Firmware bootloader uses RNG (random) module to generate an AES-256 bit key and then writes it into the ``flash_encryption`` eFuse. The key cannot be accessed via software as the write and read protection bits for the ``flash_encryption`` eFuse are set. The flash encryption operations happen entirely by hardware, and the key cannot be accessed via software.
4. Flash encryption block encrypts the flash contents - the firmware bootloader, applications and partitions marked as ``encrypted``. Encrypting in-place can take time, up to a minute for large partitions.
@ -242,7 +242,7 @@ Assuming that the eFuse values are in their default states and the firmware boot
2. Firmware bootloader reads the ``{IDF_TARGET_CRYPT_CNT}`` eFuse value (``0b000``). Since the value is ``0`` (even number of bits set), it configures and enables the flash encryption block. For more information on the flash encryption block, see `{IDF_TARGET_NAME} Technical Reference Manual <{IDF_TARGET_TRM_EN_URL}>`_.
3. Firmware bootloader uses RNG (random) module to generate an 256 or 128 bit key (depends on :ref:`Size of generated XTS-AES key <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`) and then writes it into `BLOCK_KEY0` eFuse. The software also updates the ``XTS_KEY_LENGTH_256`` according to the chosen option. The key cannot be accessed via software as the write and read protection bits for `BLOCK_KEY0` eFuse are set. The flash encryption operations happen entirely by hardware, and the key cannot be accessed via software. If 128-bit flash encryption key is used, then only the lower 128 bits of the eFuse key block are read-protected, the remaining 128 bits are readable, which is required for secure boot. The entire eFuse block is write-protected. If the FE key is 256 bits long, then ``XTS_KEY_LENGTH_256`` is 1, otherwise it is 0. To prevent this eFuse from being accidentally changed in the future (from 0 to 1), we set a write-protect bit for the RELEASE mode. If a valid key is already present in the eFuse (e.g., burned using espefuse tool) then the process of key generation is skipped and the same key is used for flash encryption process.
3. Firmware bootloader uses RNG (random) module to generate an 256 or 128 bit key (depends on :ref:`Size of generated XTS-AES key <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`) and then writes it into `BLOCK_KEY0` eFuse. The software also updates the ``XTS_KEY_LENGTH_256`` according to the chosen option. The key cannot be accessed via software as the write and read protection bits for ``BLOCK_KEY0`` eFuse are set. The flash encryption operations happen entirely by hardware, and the key cannot be accessed via software. If 128-bit flash encryption key is used, then only the lower 128 bits of the eFuse key block are read-protected, the remaining 128 bits are readable, which is required for secure boot. The entire eFuse block is write-protected. If the FE key is 256 bits long, then ``XTS_KEY_LENGTH_256`` is 1, otherwise it is 0. To prevent this eFuse from being accidentally changed in the future (from 0 to 1), we set a write-protect bit for the RELEASE mode. If a valid key is already present in the eFuse (e.g., burned using espefuse tool) then the process of key generation is skipped and the same key is used for flash encryption process.
4. Flash encryption block encrypts the flash contents - the firmware bootloader, applications and partitions marked as ``encrypted``. Encrypting in-place can take time, up to a minute for large partitions.

View File

@ -31,21 +31,21 @@ flash 加密功能用于加密与 {IDF_TARGET_NAME} 搭载使用的片外 flash
.. _encrypted-partitions:
Encrypted Partitions
加密分区
--------------------
启用 flash 加密后,系统将默认加密下列类型的 flash 数据:
启用 flash 加密后,会默认加密以下类型的数据:
- 固件引导加载程序
- :ref:`second-stage-bootloader` 固件引导加载程序
- 分区表
- :ref:`nvs_encr_key_partition`
- Otadata
- 所有 “app” 类型的分区
- 所有 ``app`` 类型的分区
其他类型的数据将视情况进行加密:
- 任何在分区表中标有“加密”标志的分区。详情请见 :ref:`encrypted-partition-flag`
- 如果启用了安全启动,则可以加密安全启动引导程序摘要(见下文)。
- 分区表中标有 ``encrypted`` 标志的分区。如需了解详情,请参考 :ref:`encrypted-partition-flag`
- 如果启用了安全启动,则会对安全启动引导程序摘要进行加密(见下文)。
.. _flash-encryption-efuse:
@ -180,9 +180,9 @@ flash 的加密过程
2. 固件的引导加载程序将读取 ``{IDF_TARGET_CRYPT_CNT}`` eFuse 值 (``0b0000000``)。因为该值为 0偶数位固件的引导加载程序将配置并启用 flash 加密块,同时将 ``FLASH_CRYPT_CONFIG`` eFuse 的值编程为 0xF。关于 flash 加密块的更多信息,请参考 *{IDF_TARGET_NAME} 技术参考手册* > *eFuse 控制器 (eFuse)* > *flash 加密块* [`PDF <{IDF_TARGET_TRM_CN_URL}#efuse>`__]。
3. 固件的引导加载程序使用 RNG随机数生成模块生成 AES-256 位密钥,然后将其写入 ``flash_encryption`` eFuse 中。由于 ``flash_encryption`` eFuse 已设置编写和读取保护位,将无法通过软件访问密钥。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。
3. 固件引导加载程序首先检查 eFuse 中是否已经存在有效密钥(例如用 espefuse 工具烧写的密钥),如果存在,则会跳过密钥生成,并将该密钥用于 flash 加密过程。否则,固件引导加载程序会使用 RNG随机数发生器模块生成一个 AES-256 位密钥,并将其写入 ``flash_encryption`` eFuse 中。由于已设置了 ``flash_encryption`` eFuse 的读保护位和写保护位,因此无法通过软件访问密钥。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。
4. flash 加密块将加密 flash 的内容(固件的引导加载程序、应用程序、以及标有“加密”标志的分区)。就地加密可能会耗些时间(对于大分区最多需要一分钟)。
4. flash 加密块将加密 flash 的内容(固件的引导加载程序、应用程序、以及标有 ``加密`` 标志的分区)。就地加密可能会耗些时间(对于大分区最多需要一分钟)。
5. 固件引导加载程序将在 ``{IDF_TARGET_CRYPT_CNT}`` (0b0000001) 中设置第一个可用位来对已加密的 flash 内容进行标记。设置奇数个比特位。
@ -198,7 +198,7 @@ flash 的加密过程
2. 固件的引导加载程序将读取 ``{IDF_TARGET_CRYPT_CNT}`` eFuse 值 (``0b000``)。因为该值为 0偶数位固件引导加载程序将配置并启用 flash 加密块。关于 flash 加密块的更多信息,请参考 *{IDF_TARGET_NAME} 技术参考手册* > *eFuse 控制器 (eFuse)* > *自动加密块* [`PDF <{IDF_TARGET_TRM_CN_URL}#efuse>`__]。
3. 固件的引导加载程序使用 RNG随机数生成模块生成 256 位或 512 位密钥,具体取决于 :ref:`生成的 XTS-AES 密钥的大小 <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`,然后分别将其写入一个或两个 `BLOCK_KEYN` eFuses。软件也为存储密钥的块更新了 ``KEY_PURPOSE_N``。由于一或两个 ``BLOCK_KEYN`` eFuse 已设置编写和读取保护位,将无法通过软件访问密钥。``KEY_PURPOSE_N`` 字段也受写保护。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。
3. 固件引导加载程序首先检查 eFuse 中是否已经存在有效密钥(例如用 espefuse 工具烧写的密钥),如果存在,则会跳过密钥生成,并将该密钥用于 flash 加密过程。否则,固件引导加载程序使用 RNG随机数发生器模块生成一个 256 位或 512 位的密钥,具体位数取决于 :ref:`生成的 XTS-AES 密钥的大小 <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`,然后将其分别写入一个或两个 `BLOCK_KEYN` eFuse。软件也为存储密钥的块更新了 ``KEY_PURPOSE_N``。由于上述或两个 ``BLOCK_KEYN`` eFuse 已设置了读保护和写保护位,因此无法通过软件访问密钥。``KEY_PURPOSE_N`` 字段也受写保护。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。
4. flash 加密块将加密 flash 的内容(固件的引导加载程序、应用程序、以及标有“加密”标志的分区)。就地加密可能会耗些时间(对于大分区最多需要一分钟)。
@ -224,7 +224,7 @@ flash 的加密过程
2. 固件的引导加载程序将读取 ``{IDF_TARGET_CRYPT_CNT}`` eFuse 值 (``0b000``)。因为该值为 0偶数位固件引导加载程序将配置并启用 flash 加密块。关于 flash 加密块的更多信息,请参考 `{IDF_TARGET_NAME} 技术参考手册 <{IDF_TARGET_TRM_CN_URL}>`_
3. 固件的引导加载程序使用 RNG随机数生成)模块生成 256 位密钥,然后将其写入 `BLOCK_KEYN` eFuse。软件也为存储密钥的块更新了 ``KEY_PURPOSE_N``。由于 ``BLOCK_KEYN`` eFuse 已设置编写和读取保护位,故无法通过软件访问密钥。``KEY_PURPOSE_N`` 字段也受写保护。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。
3. 固件的引导加载程序使用 RNG随机数发生器)模块生成 256 位密钥,然后将其写入 `BLOCK_KEYN` eFuse。软件也为存储密钥的块更新了 ``KEY_PURPOSE_N``。由于 ``BLOCK_KEYN`` eFuse 已设置了读保护和写保护位,因此无法通过软件访问密钥。``KEY_PURPOSE_N`` 字段也受写保护。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。如果 eFuse 中已经存在有效密钥(例如用 espefuse 工具烧写的密钥),则会跳过密钥生成,并将该密钥用于 flash 加密过程。
4. flash 加密块将加密 flash 的内容(固件的引导加载程序、应用程序、以及标有“加密”标志的分区)。就地加密可能会耗些时间(对于大分区最多需要一分钟)。
@ -242,7 +242,7 @@ flash 的加密过程
2. 固件的引导加载程序将读取 ``{IDF_TARGET_CRYPT_CNT}`` eFuse 值 (``0b000``)。因为该值为 0偶数位固件引导加载程序将配置并启用 flash 加密块。关于 flash 加密块的更多信息,请参考 `{IDF_TARGET_NAME} 技术参考手册 <{IDF_TARGET_TRM_CN_URL}>`_
3. 固件的引导加载程序使用 RNG随机数生成)模块生成 256 位或 128 位密钥(具体位数取决于 :ref:`Size of generated XTS-AES key <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`),然后将其写入 `BLOCK_KEY0` eFuse。同时根据所选选项软件对 ``XTS_KEY_LENGTH_256`` 进行更新。由于 ``BLOCK_KEY0`` eFuse 已设置写和读保护位故无法通过软件访问密钥。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。若使用 128 位 flash 加密密钥,则整个 eFuse 密钥块都受写保护,但只有低 128 位受读保护,高 128 位是可读的,以满足安全启动的需要。如果 flash 加密密钥是 256 位,那么 ``XTS_KEY_LENGTH_256`` 为 1否则为 0。为防止意外将 eFuse 从 0 改为 1RELEASE 模式设置了一个写保护位。
3. 固件的引导加载程序使用 RNG随机数发生器)模块生成 256 位或 128 位密钥(具体位数取决于 :ref:`生成的 XTS-AES 密钥大小 <CONFIG_SECURE_FLASH_ENCRYPTION_KEYSIZE>`),然后将其写入 `BLOCK_KEY0` eFuse。同时根据所选选项软件对 ``XTS_KEY_LENGTH_256`` 进行更新。由于 ``BLOCK_KEY0`` eFuse 已设置写保护和读保护位故无法通过软件访问密钥。flash 加密操作完全在硬件中完成,无法通过软件访问密钥。若使用 128 位 flash 加密密钥,则整个 eFuse 密钥块都受写保护,但只有低 128 位受读保护,高 128 位是可读的,以满足安全启动的需要。如果 flash 加密密钥是 256 位,那么 ``XTS_KEY_LENGTH_256`` 为 1否则为 0。为防止意外将 eFuse 从 0 改为 1RELEASE 模式设置了一个写保护位。如果 eFuse 中已经存在有效密钥(例如用 espefuse 工具烧写的密钥),则跳过密钥生成,并将该密钥用于 flash 加密过程。
4. flash 加密块将加密 flash 的内容(固件的引导加载程序、应用程序、以及标有“加密”标志的分区)。就地加密可能会耗些时间(对于大分区最多需要一分钟)。
@ -570,10 +570,10 @@ flash 加密设置
:not esp32: - 如果不需要 UART ROM 下载模式,则应完全禁用该模式,或者永久设置为“安全下载模式”。安全下载模式永久性地将可用的命令限制在更新 SPI 配置、更改波特率、基本的 flash 写入和使用 `get_security_info` 命令返回当前启用的安全功能摘要。默认在发布模式下第一次启动时设置为安全下载模式。要完全禁用下载模式,请选择 :ref:`CONFIG_SECURE_UART_ROM_DL_MODE` 为“永久禁用 ROM 下载模式(推荐)”或在运行时调用 :cpp:func:`esp_efuse_disable_rom_download_mode`。
- 启用 :doc:`安全启动<secure-boot-v2>` 作为额外的保护层,防止攻击者在启动前有选择地破坏 flash 中某部分。
Enable Flash Encryption Externally
外部启用 flash 加密
----------------------------------
In the process mentioned above, flash encryption related eFuses which ultimately enable flash encryption are programmed through the firmware bootloader. Alternatively, all the eFuses can be programmed with the help of ``espefuse`` tool. Please refer :ref:`enable-flash-encryption-externally` for more details.
在上述过程中,对与 flash 加密相关的 eFuse 是通过固件引导加载程序烧写的,或者,也可以借助 ``espefuse`` 工具烧写 eFuse。如需了解详情请参考 :ref:`enable-flash-encryption-externally`
可能出现的错误
-----------------

View File

@ -1,16 +1,16 @@
Security Guides
安全指南
***************
:link_to_translation:`en:[English]`
Overview
概述
--------
.. toctree::
:maxdepth: 1
security
Features
功能
--------
.. toctree::
:maxdepth: 1
@ -19,7 +19,7 @@ Features
:esp32: secure-boot-v1
secure-boot-v2
Workflows
流程
---------
.. toctree::
:maxdepth: 1