<?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>i.MX ProcessorsのトピックRe: Generate same black key(on different boot) from blob using caam-keygen</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705554#M210880</link>
    <description>&lt;P&gt;It is very clear description in&amp;nbsp;2.3 DM-Crypt using CAAM's Secure Key of&amp;nbsp;AN12714.&lt;/P&gt;&lt;P&gt;The black key is session key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;DM-Crypt&amp;nbsp; is using red key to do encryption not the black key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The black key changing every power cycle. But CAAM will get the same red key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you read&amp;nbsp;i.MX Linux User's Guide(bsp release document) 10.6 crypto_af_alg application support or&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/crypto-af-alg-blackkey-demo/ta-p/1376300" target="_blank" rel="noopener"&gt;crypto af_alg blackkey demo - NXP Community&lt;/A&gt;.&amp;nbsp;&amp;nbsp;, you can see&amp;nbsp; it doesn't matter the black key is changing. CAAM knows the openssl key to decrypt the encrypted data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;black key is used to protect red/plaint text key.&amp;nbsp; black key is not directly used for encryption.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suggest you can read &amp;nbsp;i.MX Linux User's Guide(bsp release document) the&amp;nbsp;&amp;nbsp;10.5 Disk encryption acceleration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-16_161544.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/236651iB86529F4E8B579F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-08-16_161544.png" alt="2023-08-16_161544.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2023 08:16:24 GMT</pubDate>
    <dc:creator>rudi_cyber</dc:creator>
    <dc:date>2023-08-16T08:16:24Z</dc:date>
    <item>
      <title>Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705061#M210828</link>
      <description>&lt;P&gt;Feels that I'm missing some steps on how to generate black keys from blobs every boot and use it to decrypt my partitions.&lt;BR /&gt;&lt;BR /&gt;I was expecting that from a blob, I'd be able to, every boot, generate a black key from the blob using `caam-keygen import &amp;lt;path-to-blob&amp;gt; importKey` and use this black key to decrypt my devices, however I can see that every boot this key changes.&lt;BR /&gt;So what we're missing here?&lt;BR /&gt;&lt;BR /&gt;To create the blob, I'm using `caam-keygen create devicekey ecb -s 64` and then using the black key `devicekey` to encrypt my partition. However, only persisting the `.bb` file to use it on the next boot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using kirskstone branch and haven't enabled HAB yet.&lt;BR /&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705061#M210828</guid>
      <dc:creator>belpai</dc:creator>
      <dc:date>2023-08-15T14:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705221#M210846</link>
      <description>&lt;P&gt;It is basic security design. Every power cycle CAAM will generate a different black key from black key blob.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is similar to the dynamic password when you access your bank account.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 21:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705221#M210846</guid>
      <dc:creator>rudi_cyber</dc:creator>
      <dc:date>2023-08-15T21:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705517#M210877</link>
      <description>&lt;P&gt;Thank you for the answer &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/215734"&gt;@rudi_cyber&lt;/a&gt;, I get your point, but still something is not right...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, let's go for the next step on how we encrypt the partitions... We were previously using the blob to encrypt/decrypt, but we know this is not quite safe as the blob is just available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're using `cryptsetup` for this, so for encrypting we're:&lt;/P&gt;&lt;P&gt;`cryptsetup -q luksFormat /dev/mmcblk1 --key-file /tmp/devicekey`&lt;/P&gt;&lt;P&gt;and to decrypt (after reboot) we're:&lt;/P&gt;&lt;P&gt;`cryptsetup open /dev/mmcblk1 rootA --key-file /tmp/deviceKey`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're checking the an12714 (attached), they're using dmsetup instead, however still having a reboot in the middle and using the same black key generated from the blob in different boots to decrypt the partition. What am I missing here?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 07:42:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705517#M210877</guid>
      <dc:creator>belpai</dc:creator>
      <dc:date>2023-08-16T07:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705554#M210880</link>
      <description>&lt;P&gt;It is very clear description in&amp;nbsp;2.3 DM-Crypt using CAAM's Secure Key of&amp;nbsp;AN12714.&lt;/P&gt;&lt;P&gt;The black key is session key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;DM-Crypt&amp;nbsp; is using red key to do encryption not the black key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The black key changing every power cycle. But CAAM will get the same red key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you read&amp;nbsp;i.MX Linux User's Guide(bsp release document) 10.6 crypto_af_alg application support or&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/crypto-af-alg-blackkey-demo/ta-p/1376300" target="_blank" rel="noopener"&gt;crypto af_alg blackkey demo - NXP Community&lt;/A&gt;.&amp;nbsp;&amp;nbsp;, you can see&amp;nbsp; it doesn't matter the black key is changing. CAAM knows the openssl key to decrypt the encrypted data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;black key is used to protect red/plaint text key.&amp;nbsp; black key is not directly used for encryption.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suggest you can read &amp;nbsp;i.MX Linux User's Guide(bsp release document) the&amp;nbsp;&amp;nbsp;10.5 Disk encryption acceleration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-16_161544.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/236651iB86529F4E8B579F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-08-16_161544.png" alt="2023-08-16_161544.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 08:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1705554#M210880</guid>
      <dc:creator>rudi_cyber</dc:creator>
      <dc:date>2023-08-16T08:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707194#M211022</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/214554"&gt;@belpai&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CAAM's built-in blob protocol provides a method for protecting user-defined data across&lt;BR /&gt;system power cycles. The data to be protected is encrypted so that it can be safely placed&lt;BR /&gt;into non-volatile storage before the chip is powered down. Each time that the blob protocol is used to protect data, a different randomly generated key is used to encrypt the data. This random key is itself encrypted using a key encryption key and the resulting encrypted key is then stored along with the encrypted data. The key-encryption key is derived from the chip's master secret key so the key-encryption key can be recreated when the chip powers up again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 03:56:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707194#M211022</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2023-08-18T03:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707381#M211045</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192970"&gt;@Harvey021&lt;/a&gt;I'm starting to understand it a bit better. Thanks for the patience&lt;/P&gt;&lt;P&gt;However, how can I have access to the key-encryption key? As IMHO, this is a good one to be used to encrypt our rootfs, as it's related to the CAAM module only and can't be read from a NV partition.&lt;/P&gt;&lt;P&gt;After this is done, at some point we'll fuse (enable HAB), so then the partition can only be decrypt by the same hw (same CAAM).&lt;BR /&gt;&lt;BR /&gt;More specifically: how (based on what I showed on my previous replies) I should approach this issue? You agree with me that encrypting using the blob as key isn't a very good idea, right?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707381#M211045</guid>
      <dc:creator>belpai</dc:creator>
      <dc:date>2023-08-18T08:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707616#M211068</link>
      <description>&lt;P&gt;I have read the documentation a few times by now, however it only covers black keys and dmsetup... and I need cryptsetup(luks2) and red keys...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the same documentation is mentioned that:&lt;/P&gt;&lt;P&gt;"The red key can still be encapsulated to blobs and decapsulated to red key only by CAAM. The encapsulation and decapsulation is performed through the Linux Key Retention service."&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I understand from this that having a redkey blob, I can (by adding to the keyring) make it a plain red key. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;How can I have a red key blob?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My goal is to use cryptsetup with Luks2, and not do this manually every boot on the initramfs, however it seems that caam-keygen only generates black key blobs and black keys from it, so this is not what I need.&lt;BR /&gt;Feel free to help here as well &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192970"&gt;@Harvey021&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I also read this: &lt;A href="https://fossies.org/linux/cryptsetup/docs/Keyring.txt" target="_blank"&gt;https://fossies.org/linux/cryptsetup/docs/Keyring.txt&lt;/A&gt; that works just fine IF I have a non-changing key on the keyring...&lt;/P&gt;&lt;P&gt;Thank you both,&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:17:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1707616#M211068</guid>
      <dc:creator>belpai</dc:creator>
      <dc:date>2023-08-18T15:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate same black key(on different boot) from blob using caam-keygen</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1708896#M211206</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"encrypting using the blob as key isn't a very good idea, right?"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Would you be willing to share your thoughts through mail?&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:harvey.yu_1@nxp.com" target="_blank"&gt;harvey.yu_1@nxp.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 07:59:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Generate-same-black-key-on-different-boot-from-blob-using-caam/m-p/1708896#M211206</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2023-08-22T07:59:46Z</dc:date>
    </item>
  </channel>
</rss>

