<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91331/nrf52840-ncs-mcuboot-cc310-enabled-image-encryption</link><description>Hi there, 
 I am working on a new product iteration that uses the nRF52840. Our existing application is already using nRF52832 + NCS + MCUBoot with image signing. 
 I would like to take this opportunity to enable image encryption in MCUBoot and use the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Sep 2023 13:09:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91331/nrf52840-ncs-mcuboot-cc310-enabled-image-encryption" /><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/447957?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2023 13:09:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c60d986-f876-4e13-87ae-130d25b8aa2a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m glad to hear that the issue has been addressed upstream. The upmerge is currently in progress, and you can track its status here: PR:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/12112"&gt;https://github.com/nrfconnect/sdk-nrf/pull/12112&lt;/a&gt;. Unfortunately, I&amp;#39;m not able to give you an estimate of when this will be completed.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/447832?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2023 22:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e55d83e-3717-404f-a1b1-64adc05a84a6</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;I raised the issue with MCUBoot project.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/mcu-tools/mcuboot/discussions/1814"&gt;Encrypting image and using serial recovery &amp;middot; mcu-tools/mcuboot &amp;middot; Discussion #1814 (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;They said that the NCS version is behind and this issue was solved. Do&amp;nbsp; you know when an upmerge will happen with MCUBoot and/or Zephyr ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446932?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 15:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88c00fd3-7f65-4ba7-b38e-40bbc8210ff4</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;I&amp;#39;ll post something asking, although I think the upstream repository is different than what NCS has, so not sure if it is still a valid question. I don&amp;#39;t mind that in serial recovery you can only write to the primary slot, just don&amp;#39;t want it disable DFU in the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446830?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 10:43:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fb788c1-687c-40b7-b51c-d42d33f3936b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I understand your concern. Unfortunately, once I enable encryption, I can no longer upload images to the secondary slot using serial recovery. I&amp;#39;ve tried various configurations and patches, but regardless of what I tried, the image&amp;nbsp;was always updated &amp;quot;in-place&amp;quot;. And to upload an encrypted image directly to the primary slot, we need to use the single loader to have the image decrypted on-the-fly (single loader is included through the CONFIG_SINGLE_APPLICATION_SLOT=y symbol).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem with activating the single loader is that it disables FW updates via the application, leaving the serial recovery mechanism as the&amp;nbsp;only DFU method.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid my only suggestion is to try raising this issue in the MCUBoot project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446741?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 20:51:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f25c8d6f-bd97-4dee-80d7-e94cc9b21a32</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;Thank you. Now I can build and test. Which brings me to the original issue. When you add&amp;nbsp;&lt;span&gt;CONFIG_MCUBOOT_SERIAL&lt;/span&gt;&lt;span&gt;=y, you get an error:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;C:\ncs\v2.4.2\bootloader\mcuboot\boot\boot_serial\src\boot_serial.c:634: undefined reference to `boot_handle_enc_fw&amp;#39;&lt;br /&gt;collect2.exe: error: ld returned 1 exit status&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The only way I found to alleviate this is to enable&amp;nbsp;CONFIG_SINGLE_APPLICATION_SLOT=y. This is in the mcuboot child image. I think it&amp;#39;s important failsafe to be able to use DFU/SMP Server (USB CDC, UART/Serial, or BLE) from the mcuboot image (can enter DFU in the bootloader using gpio or wait for&amp;nbsp;DFU&amp;nbsp;command for a short time). I don&amp;#39;t care about switching images when you&amp;#39;re in the bootloader, but there will be some cases where this will be the only way to recover a faulty image (correctly signed and encrypted, but one that needs to be overwritten manually).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446610?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 09:20:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61537db8-a41f-4c63-93c0-e770c3506523</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please add &amp;#39;CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y&amp;#39; to the&amp;nbsp;mcuboot.conf overlay in your child_image folder. This should remove the dependency on mbedtls&amp;nbsp;and allow you to use Tinycrypt module for both the signature validation and decryption.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446512?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 17:01:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:185afe76-4827-48b0-96cd-f68bad276feb</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;I tried to build the sample application from the link above for the nrf52833dk board. It builds fine for the nrf5340dk, but not for the nrf52833dk. Below is a snippet of the build log, as I can&amp;#39;t upload the complete log file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;command-line&amp;gt;: warning: &amp;quot;MBEDTLS_CONFIG_FILE&amp;quot; redefined&lt;br /&gt;&amp;lt;command-line&amp;gt;: note: this is the location of the previous definition&lt;br /&gt;C:\ncs\v2.4.2\bootloader\mcuboot\ext\tinycrypt\lib\source\ctr_mode.c:33:10: fatal error: tinycrypt/constants.h: No such file or directory&lt;br /&gt; 33 | #include &amp;lt;tinycrypt/constants.h&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446408?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 07:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df2be87e-b0e4-4a07-89c3-335f97b4b8a5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please&amp;nbsp;try this sample put together by a coworker of mine:&amp;nbsp;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures/mcuboot_smp_encryption"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures/mcuboot_smp_encryption&lt;/a&gt;. It has been tested for the &amp;#39;nrf52840dk_nrf52840&amp;#39; board.&lt;/p&gt;
[quote user="eb12345"]A lot of the documentation talks about encrypting images on secondary paritions, but to get this to compile, mcuboot requires&amp;nbsp; CONFIG_SINGLE_APPLICATION_SLOT=y.[/quote]
&lt;p&gt;To support encrypted DFU, the image must be stored in a secondary slot. So I&amp;#39;m not sure why the build fails without the CONFIG_SINGLE_APPLICATION_SLOT=y setting. I would help to see the build log if you want to investigate this further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/446383?ContentTypeID=1</link><pubDate>Sat, 16 Sep 2023 23:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ade50d10-f534-440f-be97-0ee1931ab01b</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;Thank you for this update. I was able to build the application.&lt;/p&gt;
&lt;p&gt;A lot of the documentation talks about encrypting images on secondary paritions, but to get this to compile, mcuboot requires&amp;nbsp; CONFIG_SINGLE_APPLICATION_SLOT=y.&lt;/p&gt;
&lt;p&gt;Have you been able to get mcuboot image encryption to work with secondary paritions ? The version of mcuboot bundled in ncs talks about secondary partitions, but it seems to me that only newer versions of mcuboot support it. Is there a way to build a newer version of mcuboot without too much headache ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429574?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 13:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bade04d-9f40-417a-b464-f3883dd94bea</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;No, your understanding is correct, but there are potentially other ways the key may be leaked. For instance, if someone gains access to the hex file used in production or exploits unknown software vulnerabilities, etc. But the latest silicon certainly helps limit the risk.&lt;/p&gt;
&lt;p&gt;Here is the threat&amp;nbsp;model defined by MCUBoot:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/encrypted_images.html#threat-model"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/encrypted_images.html#threat-model&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429567?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 13:08:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8612e40c-2d36-471d-8d11-2da21064dba1</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Thank you Vidar. Maybe I&amp;#39;m miss understanding but isn&amp;#39;t the encryption key stored in SOC flash which can then be read-back protected and with the latest silicon (at least on NRF52840) that *should* be protected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429525?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 10:54:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a850279-4b93-4cfe-8298-7908e7fc79f7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;We currently do not provide an official solution for encrypted DFU.&amp;nbsp;One of the reasons for this is that the solution provided by MCUBoot does not utilize any secure storage for the encryption key and that the same encryption key will be&amp;nbsp;shared across all devices.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429517?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 10:17:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96534e05-ae7d-4054-b210-ded70e1958f3</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Thank you Vidar.&amp;nbsp; We will attempt to follow that guidance but your comments give&amp;nbsp;us great pause toward continuing this high volume project in the nrfConnect SDK.&amp;nbsp; I must confirm: is there any other mechanism/infrastructure that Nordic *does* support in the nrfConnect SDK for image encryption?&amp;nbsp; Please interpret the question broadly, not just in the scope of the NRF52840.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429513?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 09:49:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63f111ab-2996-4b3c-938f-165434874ab8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We have not implemented support for encryption in the signing mechanism because we don&amp;#39;t support&amp;nbsp;DFU FW encryption in our SDK. This means we have not evaluated or verified the encryption support offered by the MCUBOOT project. Therefore, if you want the signing function to include encryption, you must patch the cmakelist file as described in my first reply in this thread. You should also consider including the --clear flag (&lt;a href="https://github.com/mcu-tools/mcuboot/blob/8724081f9056291023c5d8be3e9df11f91a6bd78/scripts/imgtool/main.py#L291"&gt;https://github.com/mcu-tools/mcuboot/blob/8724081f9056291023c5d8be3e9df11f91a6bd78/scripts/imgtool/main.py#L291&lt;/a&gt;) if use external flash (this will ensure the image is re-encrypted if moved to secondary slot).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/429509?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 09:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be4d27a-239c-4baf-a3d1-1f38c2f5fb14</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Thanks to your help (specifically your&amp;nbsp;rather specific sample child_images zip file) I was able to compile my project with desired image signing and encryption support.&amp;nbsp; There are no warnings/errors in the build log and I see the MCU child image pointing to the desired key files, hurray!.&lt;/p&gt;
&lt;p&gt;Unfortunately, one last Huge issue remains: the build process does not generate an encrypted DFU file or firmware image.&amp;nbsp; It does generate a signed image as expected.&amp;nbsp; Reading around, all posts are a few years old on this subject so I&amp;#39;m hesitant to try them toward creating the TLV + encrypting the&amp;nbsp;firmware image myself from the generated signed bin file...&amp;nbsp;&amp;nbsp;Looking forward to your guidance.&lt;/p&gt;
&lt;p&gt;I know we&amp;#39;ve long strayed from the topic of this post and it may be wise to move this elsewhere.&amp;nbsp; I can&amp;#39;t imagine I&amp;#39;m the only one struggling here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/428385?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 09:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea6db2a0-bdb6-4c0b-9398-1579d12acda7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/Kconfig"&gt;CONFIG_BOOT_&lt;/a&gt;*&amp;nbsp;Kconfig symbols are used for MCUBOOT specific configurations. Therefore, they need to be applied to the MCUBOOT build, and not the application.&lt;/p&gt;
&lt;p&gt;As you found out, you can&amp;nbsp;point to a specific&amp;nbsp; Kconfig file or fragment for your MCUBOOT build by editing the CMakelists.txt file. However,&amp;nbsp;the more common approach for&amp;nbsp;applying changes to&amp;nbsp;a child image configuration is to create a&amp;nbsp;&amp;#39;child_image&amp;#39; folder in the project directory and&amp;nbsp;add the Kconfig file/overlays there as outlined in the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/multi_image/index.html#image-specific-variables"&gt;&amp;#39;Image-specific variables&amp;#39;&lt;/a&gt;&amp;nbsp;section of the SDK documentation.&amp;nbsp;&lt;/p&gt;
[quote user="papatel"]But you have me concerned given your last response was defining a single .pem file.[/quote]
&lt;p&gt;This file is only for encryption and not for signing. You should&amp;nbsp;provide another key file to derive the public signing key from. Attached below is an example of what the &amp;#39;child_image&amp;#39; folder may look like.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6445.child_5F00_image.zip"&gt;devzone.nordicsemi.com/.../6445.child_5F00_image.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/428302?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 04:07:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e0b4e4e-4bd6-473e-be2c-9d0ce5245f11</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Instead of going back and forth too much.&amp;nbsp; Let&amp;#39;s start over.&amp;nbsp; We want to enable both signature and encryption, can you give me the&amp;nbsp;correct&amp;nbsp;set of symbols to set and exactly what file to put them in?&amp;nbsp;&amp;nbsp;I expected to have everything in prj.conf but from searching around everyone puts these settings in mcuboot.conf (which that detail isn&amp;#39;t documented?) and then you have to modify the CMakeLists file...&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If you provide or point me to documentation on all the required details, I will execute verbatim and report back.&amp;nbsp; To be 100% clear: we&amp;nbsp;need bootloader signature verification using only a derived public key (the private key is NOT stored anywhere in the firmware image).&amp;nbsp; For image encryption, we obviously need&amp;nbsp;a private key in the image (but that will be a different key than the signing key pair). I believe this is the intended implementation based on Nordic&amp;#39;s MCU boot errata.&amp;nbsp; But you have me concerned given your last response was defining a single .pem file.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/428126?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 09:59:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdba3cbb-5d25-4143-b465-9bd697634e4d</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="papatel"]defining&amp;nbsp;CONFIG_BOOT_SIGNATURE_KEY_FILE with an absolute path to an ECDSA private key.&amp;nbsp; I cannot figure out what settings to add to this conf file or prj.conf to enable image encryption as well[/quote]
&lt;p&gt;What happens when you point this symbol to your key file, do you get a build error? To enable encryption in the bootloader, it should be sufficient to set the following symbols:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BOOT_ENCRYPT_EC256=y
CONFIG_BOOT_ENCRYPTION_KEY_FILE=&amp;quot;&amp;lt;encryption key file&amp;gt;.pem&amp;quot;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/427783?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 12:07:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7d78138-e71e-4b00-9421-47f225b70f78</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Thank you for the fast response Vidar!&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having a good deal of difficulty enabling image encryption regardless of the encryption library used.&amp;nbsp; I see good (but incomplete) documentation around imaging signing and verification and what KConfig values to set but there seems to be missing guidance entirely on how exactly to enable encryption on the image as well.&amp;nbsp; At this moment I have signing working by creating an mcuboot.conf and defining&amp;nbsp;CONFIG_BOOT_SIGNATURE_KEY_FILE with an absolute path to an ECDSA private key.&amp;nbsp; I cannot figure out what settings to add to this conf file or prj.conf to enable image encryption as well.&amp;nbsp; I found&amp;nbsp;the&amp;nbsp;CONFIG_BOOT_ENCRYPTION_KEY_FILE&amp;nbsp;setting but I&amp;#39;ve had had no luck setting that analogously with a another key...&lt;/p&gt;
&lt;p&gt;Can you assist or point me to the documentation I missed?&lt;/p&gt;
&lt;p&gt;I also have the below added to my CmakeLists.txt file just after the&amp;nbsp; &amp;quot;cmake_minimum_required(VERSION 3.20.0)&amp;quot; line.&amp;nbsp; Getting boot signature was hard enough; I was only able to figure it out after watching someone&amp;#39;s video on the subject.&amp;nbsp;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)
    list(APPEND mcuboot_OVERLAY_CONFIG
      &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;
      )
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Personally,&amp;nbsp;I think signature and image encryption should be front and center and super easy to configure on every platform it&amp;#39;s supported.&amp;nbsp; Curious why it&amp;#39;s so difficult given that nearly every organization that deploys firmware on this platform is going to want these features.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/427774?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 11:40:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41d0552b-8fa8-42cf-a472-a184baead922</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span&gt;There haven&amp;#39;t been any updates regarding support for encryption, unfortunately.&lt;/span&gt;&lt;/p&gt;
[quote user="papatel"]Is there any update on firmware image encryption?&amp;nbsp; I know APP Protect is totally broken so a hacker can easily&amp;nbsp;dump any firmware on any NRF52 device anyway.[/quote]
&lt;p&gt;We have introduced a new silicon revision for all 52 variants that mitigates this vulnerability. For more details, please refer to the relevant IN for your IC.e.g.&amp;nbsp;&lt;a title="IN141 Informational Notice v1.1" href="https://infocenter.nordicsemi.com/pdf/in_141_v1.1.pdf?cp=5_0_2_9"&gt;IN141 Informational Notice v1.1&lt;/a&gt;.&amp;nbsp;if you use the nRF52840.&lt;/p&gt;
[quote user="papatel"]Maybe I&amp;#39;m missing or misunderstanding some information on the 2.3.99 environment?&amp;nbsp; I don&amp;#39;t want to go through modifying the SDK to make this work as needed[/quote]
&lt;p&gt;You don&amp;#39;t have to modify the SDK if you&amp;#39;re okay with not having hardware-accelerated crypto support in the bootloader. The change I proposed in my initial reply was in case you wanted the build script to encrypt the update binaries for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/427671?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 07:15:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dee0fc9b-0d4c-415c-a6e5-59a912c552d1</guid><dc:creator>papatel</dc:creator><description>&lt;p&gt;Thank you Sean for your post illuminating that this isn&amp;#39;t a supported feature.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any update on firmware image encryption?&amp;nbsp; I know APP Protect is totally broken so a hacker can easily&amp;nbsp;dump any firmware on any NRF52 device anyway.&amp;nbsp; But&amp;nbsp;some SoCs from Nordic are now supporting secure key storage so it seems that NRFConnect development environment&amp;nbsp;should&amp;nbsp;make image signing And image encryption front-center and super easy to use.&amp;nbsp; Maybe I&amp;#39;m missing or misunderstanding some information on the 2.3.99 environment?&amp;nbsp; I don&amp;#39;t want to go through modifying the SDK to make this work as needed.&amp;nbsp; That&amp;#39;s a recipe for having to code again and again as we port to new silicon released by Nordic.&amp;nbsp; My understanding is that the nrfConnect ecosystem and integration with Zephyr and MCUBoot was to prevent just that...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/383517?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 15:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7d7afa4-08b6-4b46-ba1a-a957fc09705a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Sean,&lt;/p&gt;
&lt;p&gt;No problem. I just wanted to make sure you and anyone else reading this thread were aware that this is is not an officially supported feature.&lt;/p&gt;
&lt;p&gt;1. We only use the &lt;span&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE&lt;/span&gt; and CONFIG_BOOT_ENCRYPTION_KEY_FILE symbol in our SDK.&lt;/p&gt;
[quote user="FARLY7"]It seems like this feature is not fully implemented or deprecated?[/quote]
&lt;p&gt;I think it is available in upstream zephyr. As noted in the warning message, NCS has its own signing mechanism. I guess we needed this to support multi image builds.&lt;/p&gt;
[quote user="FARLY7"] I would rather not edit the CMakeLists.txt file directly, as we use different key files for different board builds, so it seems we will need to perform the encryption/signing separately.[/quote]
&lt;p&gt;It is not ideal to have to patch SDK files, but I think it is the easiest solution in this case. It should be possible to use the CONFIG_BOOT_ENCRYPTION_KEY_FILE symbol defined by your MCUBOOT child image.&lt;/p&gt;
&lt;p&gt;2. Thanks for making me aware of this issue. I will check if it something we can try address in the upcoming release.&lt;/p&gt;
&lt;p&gt;I usually place the key files in the child image folder together with the mcuboot configuration file so I don&amp;#39;t have to use a relative path:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4786.child_5F00_image.zip"&gt;devzone.nordicsemi.com/.../4786.child_5F00_image.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/383385?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 06:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9685ad9-bc31-4118-a2b9-aa85c18f120a</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thanks for the detailed answer.&lt;/p&gt;
&lt;p&gt;We are aware of the vulnerabilities of storing the keys in FLASH but thank you for noting that - it is important for anyone else reading.&lt;/p&gt;
&lt;p&gt;Ok, I understand why using the CC310 for MCUBoot encryption is currently unsupported. I have opted for the simple option from your suggestions, and I am now able to successfully compile. We can still use the CC310 in our application for signing operations.&lt;/p&gt;
&lt;p&gt;There are two further related questions I would like to ask:&lt;/p&gt;
&lt;p&gt;1. Your last point mentioned manually editing the&amp;nbsp;&lt;span&gt;ncs/nrf/modules/mcuboot/CMakeLists.txt file to automatically include encrypted binaries in the build process. However, I found the KConfig option &lt;/span&gt;&lt;code&gt;CONFIG_MCUBOOT_ENCRYPTION_KEY_FILE&lt;/code&gt;, that says it&amp;#39;s meant to&amp;nbsp;perform this operation automatically? However, this KConfig option is not available unless I also specify &lt;span&gt;&lt;code&gt;CONFIG_MCUBOOT_SIGNATURE_KEY_FILE&lt;/code&gt;, and enabling this option results in the warnings below:&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;CMake Warning at /Users/FARLY7/workspace/um/catch-firmware-active/nrf/modules/mcuboot/CMakeLists.txt:630 (message):&lt;/code&gt;&lt;br /&gt;&lt;code&gt; CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is set to&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;./bootloader/mcuboot/catch-active-bloodaxe_gen2-sign-p256.pem&amp;quot;.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;You are using the NCS Mcuboot signing, which means this option will be&lt;/code&gt;&lt;br /&gt;&lt;code&gt; ignored.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Image signing in NCS is done via the MCUboot image&amp;#39;s&lt;/code&gt;&lt;br /&gt;&lt;code&gt; CONFIG_BOOT_SIGNATURE_KEY_FILE option.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Consider setting CONFIG_MCUBOOT_SIGNATURE_KEY_FILE in your application&lt;/code&gt;&lt;br /&gt;&lt;code&gt; image back to its default value, the empty string.&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It seems like this feature is not fully implemented or deprecated? I found&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/29566"&gt;this&lt;/a&gt;&amp;nbsp;related GitHub Issue. We are already only using the&amp;nbsp;&lt;span&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE as suggested, so is our only option&amp;nbsp;to automatically generate the encrypted binaries to use your suggestion? I would rather not edit the CMakeLists.txt file directly, as we use different key files for different board builds, so it seems we will need to perform the encryption/signing separately.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2.&amp;nbsp; Not really a question, but I see the issue still exists where if the key file path provided is a relative one, CMake will print the false warning that MCUBoot is using the default key, when it is correctly using the provided key. (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71892/cmake-warning-using-default-mcuboot-key-it-should-not-be-used-for-production"&gt;see here&lt;/a&gt;). I hope this is fixed soon,&lt;/span&gt; as it is quite confusing.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sean&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 + NCS + MCUBoot, CC310-enabled image encryption?</title><link>https://devzone.nordicsemi.com/thread/383355?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 21:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75a59a8c-e15a-4d85-aa3a-fbb4d4b36356</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Sean,&lt;/p&gt;
&lt;p&gt;Encrypted DFU is feature we do not officially support in our SDK, even though it is made available through the mcuboot project. Also be aware that the solution does not utilize a secure key storage for the private key kept on the device. This means we cannot guarantee that the key cannot be extracted. &lt;/p&gt;
&lt;p&gt;That said, the reason you are unable to build the bootloader in its current configuration is that the cc310 runtime library (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/crypto/doc/nrf_cc310_bl.html"&gt;nrf_cc310_bl crypto library&lt;/a&gt;) linked in by the bootloader only provide ECDSA and SHA-256 support. This sufficient to perform signature validation of the FW image, but not encryption/decryption.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While it&amp;#39;s not really what you want, a simple workaround would be to select the TINYCRYPT SW backend instead (CONFIG_BOOT_ECDSA_TINYCRYPT=y). The other alternative would probably be to integrate the full version of the cc310 library. This will require changes to the bootloader itself. If you end up trying this, then I think a good start is to take a look at the cc310_glue file here (&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/ext/nrf/cc310_glue.c"&gt;https://github.com/nrfconnect/sdk-mcuboot/blob/main/ext/nrf) /cc310_glue.c&lt;/a&gt; and the include headers in &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/tree/main/boot/bootutil/include/bootutil/crypto"&gt;https://github.com/nrfconnect/sdk-mcuboot/tree/main/boot/bootutil/include/bootutil/crypto&lt;/a&gt;. These files show the functions currently implemented for the cc310 backend.&lt;/p&gt;
&lt;p&gt;You may also edit the imgtool sign command in ncs/nrf/modules/mcuboot/CMakeLists.txt if you want the build to encrypt the update binaries for you.&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/modules/mcuboot/CMakeLists.txt b/modules/mcuboot/CMakeLists.txt
index 6dd442214..dffc07e35 100644
--- a/modules/mcuboot/CMakeLists.txt
+++ b/modules/mcuboot/CMakeLists.txt
@@ -149,6 +149,7 @@ if(CONFIG_BOOTLOADER_MCUBOOT)
       COMMAND
       # Sign the binary version of the input hex file.
       ${sign_cmd}
+      --encrypt &amp;lt;insert path or symbol here that points to your key file &amp;gt;
       ${sign_dependencies}
       --slot-size ${SIGN_ARG_SLOT_SIZE}
       ${to_sign_bin}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>