<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552367#M5658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble getting wise from the documents supplied with the KBOOT Bootloader.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current question is: where is the (AES128) key stored the bootloader uses to decrypt possibly encrypted firmware ("secure binary") it receives?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from various examples I see, there is a symbol called BL_FEATURE_ENCRYPTION_KEY_ADDRESS which is defined as "0xb000"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from the other symbols I see, that the default application offset is 0xa000. this would imply that the key is stored in the address space of the application.&lt;/P&gt;&lt;P&gt;In my understanding the bootloader should have some sort of key store in the address space before the application.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you light me up?&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2016 09:03:26 GMT</pubDate>
    <dc:creator>peterruesch</dc:creator>
    <dc:date>2016-07-08T09:03:26Z</dc:date>
    <item>
      <title>KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552367#M5658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble getting wise from the documents supplied with the KBOOT Bootloader.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current question is: where is the (AES128) key stored the bootloader uses to decrypt possibly encrypted firmware ("secure binary") it receives?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from various examples I see, there is a symbol called BL_FEATURE_ENCRYPTION_KEY_ADDRESS which is defined as "0xb000"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from the other symbols I see, that the default application offset is 0xa000. this would imply that the key is stored in the address space of the application.&lt;/P&gt;&lt;P&gt;In my understanding the bootloader should have some sort of key store in the address space before the application.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you light me up?&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 09:03:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552367#M5658</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-08T09:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552368#M5659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;I ran into this issue a month or so ago and have only made my personal notes (README_DES.txt) and comments in the source "C" code (look for "//DES").&lt;/P&gt;&lt;P&gt;ZIP file attached.&lt;/P&gt;&lt;P&gt;In summary I figured out how to create a simple ascii key text file that has the 128-bit AES custom key.&lt;/P&gt;&lt;P&gt;Ex: decafbadface0fffc0ffee00deadbeef&lt;/P&gt;&lt;P&gt;The command line elf2sb.exe is used to convert binary or elf file using the key file to get a *.sb (secure boot) file.&lt;/P&gt;&lt;P&gt;Example command lines in README_DES.txt.&lt;/P&gt;&lt;P&gt;The sbloader.c file is in the ZIP too that has been modified to have the same custom key and looks like:&lt;/P&gt;&lt;P&gt;uint32_t s_aesKey[AES_128_KEY_SIZE_WORDS]={0xdecafbad, 0xface0fff, 0xc0ffee00, 0xdeadbeef}; //DES works for key file "decafbadface0fffc0ffee00deadbeef"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes:&amp;nbsp; This was done using Kinetis_Bootloader_2_0_0 for the USB MSD secure boot drag-n-drop of the Secure Binary (*.sb) file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 16:34:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552368#M5659</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-08T16:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552369#M5660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are two ways to store the AES128 key:&lt;/P&gt;&lt;P&gt;if BL_FEATURE_ENCRYPTION_KEY_ADDRESS is defined, that means user wants to store the key in somewhere of flash memory area, the key address can be set arbitrarily (Note: the address shouldn't be located in bootloader area).&lt;/P&gt;&lt;P&gt;if BL_FEATURE_ENCRYPTION_KEY_ADDRESS is not defined, that means user should use the default key address, the address is located in dedicated flash IFR area (0x30 - 0x33), this area can only be accessed by special bootloader commands (flash-read-once, flash-program-once), and it is write-once.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 02:46:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552369#M5660</guid>
      <dc:creator>jay_heng</dc:creator>
      <dc:date>2016-07-11T02:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552370#M5661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks David for the upload. I will have a look into it. Is there a upstream repository where such changes are tracked and collected?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jie, you propose that the key should not be stored in the bootloader address space. Whats your suggestion then?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 07:38:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552370#M5661</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-11T07:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552371#M5662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following line from the README_DES.txt:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14682230006905195 jive_text_macro" data-renderedposition="34_8_1192_32" jivemacro_uid="_14682230006905195"&gt;&lt;P&gt;Generate *.sb file with key file from binary input file:&lt;/P&gt;&lt;P&gt;elftosb.exe -V -f kinetis -k ledkey.txt -c led_demo_bin.bd -o led_demo_bin+key.sb led_demo.bin&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where does the offset of 0xA000 come from shown in the output of this command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_1468225050181139 jive_macro_code jive_text_macro" data-renderedposition="144_8_1192_64" jivemacro_uid="_1468225050181139" modifiedtitle="true"&gt;&lt;P&gt;[developer@localhost debug]$ ./elftosb -V -f kinetis -z -c led_demo_bin.bd -o led_demo_bin_z_key.sb gpio_led_output_frdmk64f.bin &lt;/P&gt;&lt;P&gt;Boot Section 0x00000000:&lt;/P&gt;&lt;P&gt;&amp;nbsp; ERAS | adr=0x0000a000 &lt;/P&gt;&lt;P&gt;| cnt=0x00002800 | flg=0x0000&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you did not specify it in the *.bd file. I thought this is something mandatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 08:19:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552371#M5662</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-11T08:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552372#M5663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ahh.. it's coming from the erase command. 40k == 0xA00.&lt;/P&gt;&lt;P&gt;but why did you comment out all other lines in the bd files? the resulting secure binary does not contain the application!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 08:23:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552372#M5663</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-11T08:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552373#M5664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I edited the command file to include the supplied binary into the sb file.&lt;/P&gt;&lt;P&gt;It also warns you if you dont provide and offset address which is mandatory for binary input files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is an output log form the bd file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14682261663592531 jive_text_macro" data-renderedposition="138_8_1192_144" jivemacro_uid="_14682261663592531" modifiedtitle="true"&gt;&lt;P&gt;[developer@localhost debug]$./elftosb -V -f kinetis -z -c command_file.bd -o led_demo_bin_zero_key.sb -DAPPLICATION_OFFSET=0xA000 $PWD/gpio_led_output_frdmk64f.bin &lt;/P&gt;&lt;P&gt;APPLICATION_OFFSET = 40960&lt;/P&gt;&lt;P&gt;APPLICATION_BINARY = /opt/Freescale/sdk_2.0/boards/frdmk64f/driver_examples/gpio/led_output/kds/debug/gpio_led_output_frdmk64f.bin&lt;/P&gt;&lt;P&gt;Boot Section 0x00000000:&lt;/P&gt;&lt;P&gt;&amp;nbsp; ERAS | adr=0x00000000 | cnt=0x00000000 | flg=0x0001&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD | adr=0x0000a000 | len=0x00004de8 | crc=0xb2e27f35 | flg=0x0000&lt;/P&gt;&lt;P&gt;&amp;nbsp; RESET&lt;/P&gt;&lt;P&gt;[developer@localhost debug]$ ls -lh led_demo_bin_zero_key.sb &lt;/P&gt;&lt;P&gt;-rw-rw-r--. 1 developer developer 20K Jul 11 10:35 led_demo_bin_zero_key.sb&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 08:36:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552373#M5664</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-11T08:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552374#M5665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Back from a day off.&lt;/P&gt;&lt;P&gt;Looks like you are well on your way.&amp;nbsp; Good work and thanks for sharing your command file.&lt;/P&gt;&lt;P&gt;Have you implemented using the customer key successfully?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 20:00:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552374#M5665</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-12T20:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552375#M5666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for stopping by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, I have not yet put more effort into a custom key solution. As you can see from my community activity, there are more open questions. &lt;/P&gt;&lt;P&gt;I want to change the source code as little as possible to keep it "mainline". And at some points I am not sure which is the most compatible solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very happy you share my thoughts! Do you have an idea how this matter (location of aes key) is treated in the future?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jie Heng proposes to store the key not in the bootloader area. can you tell me why?&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/429945#comment-810357" title="https://community.nxp.com/thread/429945#comment-810357"&gt;https://community.nxp.com/thread/429945#comment-810357&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:21:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552375#M5666</guid>
      <dc:creator>peterruesch</dc:creator>
      <dc:date>2016-07-13T08:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: KBOOT: location of BL_FEATURE_ENCRYPTION_KEY_ADDRESS</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552376#M5667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Jie is indicating two separate locations that a "key" could be stored in the MCU.&amp;nbsp; One being the Flash just like any other variable gets stored.&amp;nbsp; The other is the IFR (nonvolatile information register) field which is "hidden" from normal Flash space and accessed using special flash command sequence.&amp;nbsp; That IFR has OTP (one time programmable) fields so if that is OK you could use it.&lt;/P&gt;&lt;P&gt;The real issue is how secure do you want the key.&amp;nbsp; If the Flash is "locked" (using the flash configuration field FOPT/FSEC fields) the normal Flash can be protected.&lt;/P&gt;&lt;P&gt;Other Kinetis devices have a DryIce module for storing keys.&amp;nbsp; I&amp;nbsp; suspect with time (and IoT devices evolving )more and more methods for securing keys will be implemented in silicon. &lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 18:24:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KBOOT-location-of-BL-FEATURE-ENCRYPTION-KEY-ADDRESS/m-p/552376#M5667</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-13T18:24:15Z</dc:date>
    </item>
  </channel>
</rss>

