Skip to content

Commit 5d0e5a9

Browse files
de-nordicannwojFrancescoSer
committed
doc: nRF541l15: Add information on ECIES-X25519 support
Add information of supported AES-128 encryption with ECIES-X25519 used for key exchange. Co-authored-by: Anna Wojdyło <[email protected]> Co-authored-by: Francesco Domenico Servidio <[email protected]> Signed-off-by: Dominik Ermel <[email protected]>
1 parent 37571b2 commit 5d0e5a9

File tree

4 files changed

+88
-2
lines changed

4 files changed

+88
-2
lines changed

doc/nrf/app_dev/device_guides/nrf54l/dfu_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Images encryption
138138
*****************
139139

140140
MCUboot supports AES-encrypted images on the nRF54L15 SoC, using ECIES-X25519 for key exchange.
141-
For detailed information on ECIES-X25519 support, refer to the Encrypting MCUboot images with AES and ECIES-X25519 key exchange documentation page.
141+
For detailed information on ECIES-X25519 support, refer to the :ref:`ug_nrf54l_ecies_x25519` documentation page.
142142

143143
Image update types
144144
******************
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.. _ug_nrf54l_ecies_x25519:
2+
3+
MCUboot AES image encryption with ECIES-X25519 key exchange
4+
###########################################################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
MCUboot on the nRF54L15 SoC can support encrypted images using AES.
11+
Images are encrypted using AES, and ECIES-X25519 is used for key delivery (exchange) within the image.
12+
When image encryption is enabled, you can choose to upload signed or encrypted images to be swapped during boot.
13+
If MCUboot finds an encrypted image in the secondary slot, it decrypts the image during the slot swapping process.
14+
An image that was encrypted before being swapped into the primary slot is re-encrypted if the swap is later reverted.
15+
16+
Limitations
17+
***********
18+
19+
The current implementation has the following limitations:
20+
21+
* On the nRF54L15 SoC, ECIES-X25519 key exchange is supported only when the ED25519 signature algorithm is selected.
22+
This is the default configuration.
23+
* Encryption is not supported when using MCUboot in direct-xip mode.
24+
* Storing the ECIES-X25519 device private key in the Key Management Unit (KMU) is currently not supported.
25+
* HMAC and HKDF tools currently use the SHA-256 hash algorithm.
26+
27+
HMAC and HKDF impact on TLV and key exchange
28+
********************************************
29+
30+
An encrypted image includes a TLV that contains the public key for ECIES-X25519 key exchange, the encrypted AES key, and the MAC tag of the encrypted key.
31+
The key used to encrypt the AES key is derived using HKDF, and the MAC tag is generated using HMAC.
32+
33+
While the use of SHA-256 does not pose a security concern and has a minimal impact on performance, it increases the code size.
34+
This is because SHA-256 support must be included in addition to SHA-512, which is already used by the ED25519 signature algorithm.
35+
36+
Additionally, pre-installed MCUboot instances will not be able to boot images that use TLVs generated with different hash algorithms.
37+
38+
Building application with image encryption
39+
******************************************
40+
41+
To build an application that uses MCUboot with image encryption enabled, run the following command:
42+
43+
.. parsed-literal::
44+
:class: highlight
45+
46+
west build -b *board_target* -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DSB_CONFIG_BOOT_ENCRYPTION=y
47+
48+
The :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION` option enables encryption support in MCUboot.
49+
50+
The key exchange method is determined by the type of signature key selected.
51+
For the nRF54L15 SoC, the ED25519 signature algorithm is the default setting.
52+
53+
When encryption is enabled, the encrypted image files :file:`zephyr.signed.encrypted.bin` and :file:`zephyr.signed.encrypted.hex` are generated in the application build directory.
54+
55+
The BIN file is a binary image suitable for Device Firmware Update (DFU) operations using :ref:`MCUmgr<dfu_tools_mcumgr_cli>`.
56+
57+
When the :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE` option is enabled, you must provide an ECIES-X25519 private key in PEM format.
58+
This key is built into the MCUboot image during the build process.
59+
See the following example:
60+
61+
.. parsed-literal::
62+
:class: highlight
63+
64+
west build -b *board_target* -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DSB_CONFIG_BOOT_ENCRYPTION=y -DSB_CONFIG_BOOT_ENCRYPTION_KEY_FILE=\"<path to key.pem>\"
65+
66+
.. note::
67+
* The public key, derived from the specified private key file, is added to the image and later used on the device to derive the decryption key for the application image.
68+
This public key is automatically derived from the private key by imgtool, which is invoked by the build system when signing the image.
69+
* The sysbuild option :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION` sets the MCUboot configuration option :kconfig:option:`CONFIG_BOOT_ENCRYPT_IMAGE`.
70+
Similarly, the :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE` option sets both :kconfig:option:`CONFIG_BOOT_ENCRYPTION_KEY_FILE` for MCUboot and :kconfig:option:`CONFIG_MCUBOOT_ENCRYPTION_KEY_FILE` for the default application.
71+
72+
These values are then passed to imgtool for encrypting the application image.
73+
74+
You cannot override these options using MCUboot or application-level Kconfig options, as they are enforced by sysbuild.
75+
76+
Enabling encryption in |nRFVSC| projects
77+
****************************************
78+
79+
To correctly set up encryption in |nRFVSC|, you must familiarize yourself with `How to work with build configurations`_.
80+
When configuring build options, ensure to include :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION` and :kconfig:option:`SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE` Kconfig options using extra CMake arguments.
81+
82+
If you are modifying an existing project, you must regenerate it to activate new settings.

doc/nrf/app_dev/device_guides/nrf54l/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,4 @@ Refer to the compatibility matrices for the nRF54L Series devices to check the c
8888
kmu_basics
8989
kmu_provision
9090
dfu_config
91+
ecies_x25519.rst

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ Developing with nRF54L Series
7474

7575
* Increased the default value of the :kconfig:option:`CONFIG_MPSL_HFCLK_LATENCY` Kconfig option to support slower crystals.
7676
See the Kconfig description for a detailed description on how to select the correct value for a given application.
77-
* Added the :ref:`ug_nrf54l_dfu_config` documentation page, describing how to configure Device Firmware Update (DFU) and secure boot settings using MCUboot and NSIB.
77+
* Added:
78+
79+
* The :ref:`ug_nrf54l_dfu_config` documentation page, describing how to configure Device Firmware Update (DFU) and secure boot settings using MCUboot and NSIB.
80+
* The :ref:`ug_nrf54l_ecies_x25519` page on enabling the AES encryption with ECIES-X25519, which is used for secure encryption key exchange.
7881

7982
Developing with nRF54H Series
8083
=============================

0 commit comments

Comments
 (0)