<?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 Re: LPC55S28 USERKEK provisioning using blhost in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684995#M53419</link>
    <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;The keys binary has to be correctly formatted which can be done with nxpimage utils convert hex2bin tool of the SPSDK.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;For example a txt file with the key as Hex number:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;userkey.txt:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;5468617473206d79204b756e67204675&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;results into&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;userkey.bin:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;uF gnuK yM stahT&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 14:58:16 GMT</pubDate>
    <dc:creator>TestNXP</dc:creator>
    <dc:date>2023-07-10T14:58:16Z</dc:date>
    <item>
      <title>LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1681343#M53322</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set USERKEK with blhost. As mentioned in the user guide I set USERKEK with this commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;blhost -p com4 -- key-provisioning enroll&lt;/P&gt;&lt;P&gt;blhost -p com4 -- key-provisioning set_user_key 11 userkey.bin&lt;/P&gt;&lt;P&gt;blhost -p com4 -- key-provisioning write_key_nonvolatile 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to store a 128 Bit AES Key and thus userkey.bin should be 16 Bytes big. However, it is mentioned that userkey.bin should be a plain text binary. My key file contains for example:&lt;/P&gt;&lt;P&gt;Type userkey.bin&lt;/P&gt;&lt;P&gt;ABCDEFABCDEFABCDEFABCDEFABCDEFAB&lt;/P&gt;&lt;P&gt;This makes it 32 Bytes big (when trying to set a 32Byte key it is 64 Bytes big and can not be set using blhost). When setting USERKEK with this userkey.bin, the encrypted cipher differs from what I am expecting, which makes me believe that the used userkey.bin is in the wrong format. I also tried converting the hex key into binary, which did not work aswell.&lt;/P&gt;&lt;P&gt;I can not find any information about how to create a valid userkey.bin which can be imported correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me. Thank in advance!&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 14:43:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1681343#M53322</guid>
      <dc:creator>TestNXP</dc:creator>
      <dc:date>2023-07-04T14:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682681#M53342</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/219866"&gt;@TestNXP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;key-provisioning is blhost command, about detail usage and example you can refer to &amp;lt;blhost User's Guider&amp;gt;, I also attach it for you.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;4.2.23 key-provisioning &amp;lt;operation&amp;gt; [arguments…]&lt;BR /&gt;The key-provisioning command is a pack of several security related commands.&lt;BR /&gt;• enroll&lt;BR /&gt;Example: -- key-provisioning enroll&lt;BR /&gt;Enroll key provisioning feature. No argument for this operation.&lt;BR /&gt;• set_user_key &amp;lt;type&amp;gt;&amp;lt;file&amp;gt;[,&amp;lt;size&amp;gt;]&lt;BR /&gt;Example: -- key-provisioning set_user_key 0xB userKey.bin&lt;/P&gt;
&lt;P&gt;Send the user key specified by &amp;lt;type&amp;gt; to bootloader. &amp;lt;file&amp;gt; is the binary file containing user key plain text. If &amp;lt;size&amp;gt; is not specified,&lt;BR /&gt;the entire &amp;lt;file&amp;gt; will be sent, otherwise, blhost only sends the first &amp;lt;size&amp;gt; bytes.&lt;BR /&gt;• set_key &amp;lt;type&amp;gt; &amp;lt;size&amp;gt;&lt;BR /&gt;Example: -- key-provisioning set_key 0x1 0x100&lt;BR /&gt;Generate &amp;lt;size&amp;gt; bytes of the key specified by &amp;lt;type&amp;gt;.&lt;BR /&gt;• write_key_nonvolatile [memoryID]&lt;BR /&gt;Example: -- key-provisioning write_key_nonvolatile 0x110&lt;BR /&gt;Write the key to a nonvolatile memory.&lt;BR /&gt;• read_key_nonvolatile [memoryID]&lt;BR /&gt;Example: -- key-provisioning read_key_nonvolatile 0x110&lt;BR /&gt;Load the key from a nonvolatile memory to bootloader.&lt;BR /&gt;• write_key_store &amp;lt;file&amp;gt;[,&amp;lt;size&amp;gt;]&lt;BR /&gt;Send the key store to bootloader. &amp;lt;file&amp;gt; is the binary file containing key store. If &amp;lt;size&amp;gt; is not specified, the entire &amp;lt;file&amp;gt; will be&lt;BR /&gt;sent. Otherwise, only send the first &amp;lt;size&amp;gt; bytes.&lt;BR /&gt;• read_key_store &amp;lt;file&amp;gt;[,&amp;lt;size&amp;gt;]&lt;BR /&gt;Read the key store from bootloader to host(PC). &amp;lt;file&amp;gt; is the binary file to store the key store.&lt;BR /&gt;&amp;lt;type&amp;gt; and corresponding &amp;lt;size&amp;gt; are target specific values, and various on different devices. For details, see the ROM chapter&lt;BR /&gt;in the Reference Manual&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 03:39:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682681#M53342</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2023-07-06T03:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682823#M53347</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/27788"&gt;@Alice_Yang&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;as I mentioned in my question, the user guide is does not help me because it is said there that the file shall be a plain text .bin file. However a 32Byte Key in plain text results into a 64Bytes plain text binary. Trying to load a 64 Byte plain text .bin with "-- key-provisioning set_user_11 key userkey.bin" does replay the status "failure". Loading the key with "-- key-provisioning set_user_key 11 userkey.bin,32" does success, but the encrypted cipher differs from what I am exspecting with the provided key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an example key .bin file? Or a working example with all the files to load a key into USERKEK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also in application I am getting the key by using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FFR_KeystoreGetKC(&amp;amp;flashInstance, keyCode0, kFFR_KeyTypeUser);&lt;/P&gt;&lt;P&gt;PUF_GetHwKey(PUF, keyCode0, sizeof(keyCode0), kPUF_KeySlot0, rand());&lt;/P&gt;&lt;P&gt;HASHCRYPT_AES_SetKey(HASHCRYPT, &amp;amp;m_handle, NULL, 16);&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 06:47:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682823#M53347</guid>
      <dc:creator>TestNXP</dc:creator>
      <dc:date>2023-07-06T06:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682990#M53354</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/27788"&gt;@Alice_Yang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As it seems the Key behind the generated and stored Key Code as USERKEK is simply all 0x00. Because I get the same result by encrypting my plain text with a AES-128 Key with all zeros. So when setting the user key with a plain text .bin file something seems to go wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried following:&lt;/P&gt;&lt;P&gt;blhost -p com4 key-provisioning set_user_key 11 "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -s, --key-size 128&lt;/P&gt;&lt;P&gt;where XXX... is the key I want to store. This results in a different encrypted cipher, but still not in the one I might exspect.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 08:52:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1682990#M53354</guid>
      <dc:creator>TestNXP</dc:creator>
      <dc:date>2023-07-06T08:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684191#M53388</link>
      <description>&lt;P&gt;In the example mentioned here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://spsdk.readthedocs.io/en/latest/examples/lpc55sxx_secure_fw_update.html" target="_blank"&gt;https://spsdk.readthedocs.io/en/latest/examples/lpc55sxx_secure_fw_update.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SBKEK is generated using&lt;/P&gt;&lt;PRE&gt;nxpimage sb21 get-sbkek&lt;/PRE&gt;&lt;P&gt;I checked the generated key and it seems to be a reversed binary of the hex string.&lt;/P&gt;&lt;P&gt;I found a tool under SPSDK for converting hex plain text into .bin file. I was not able to test this yet but it might be the solution to my problem.&lt;/P&gt;&lt;P&gt;I have to say that the description in blhost user guide and LPC55S2x user guide is very missleading as it says that a key in plain text binary form shall be provided.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jul 2023 10:48:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684191#M53388</guid>
      <dc:creator>TestNXP</dc:creator>
      <dc:date>2023-07-08T10:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684576#M53408</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/219866"&gt;@TestNXP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can use SPSDK tool, blhsot inside.&lt;/P&gt;
&lt;P&gt;If you want to sue secure boot function, you can also consider the tool of "&lt;FONT size="3"&gt;MCUXpresso Secure Provisioning Tool"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING" target="_blank"&gt;https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;based on the open-source&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/software/development-software/secure-provisioning-sdk-spsdk:SPSDK" target="_blank"&gt;Secure Provisioning SDK&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 07:13:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684576#M53408</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2023-07-10T07:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S28 USERKEK provisioning using blhost</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684995#M53419</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;The keys binary has to be correctly formatted which can be done with nxpimage utils convert hex2bin tool of the SPSDK.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;For example a txt file with the key as Hex number:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;userkey.txt:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;5468617473206d79204b756e67204675&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;results into&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;userkey.bin:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;uF gnuK yM stahT&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 14:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S28-USERKEK-provisioning-using-blhost/m-p/1684995#M53419</guid>
      <dc:creator>TestNXP</dc:creator>
      <dc:date>2023-07-10T14:58:16Z</dc:date>
    </item>
  </channel>
</rss>

