<?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のトピックUsing Keyring for key to be used for CAAM partition encryption</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Using-Keyring-for-key-to-be-used-for-CAAM-partition-encryption/m-p/2053130#M234559</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I am following this method to encrypt my emmc partition-&lt;/P&gt;&lt;P&gt;1. generate key:&lt;BR /&gt;KEYNAME=dm_trust&lt;BR /&gt;KEY="$(keyctl add trusted $KEYNAME 'new 32' @s)"&lt;BR /&gt;keyctl pipe $KEY &amp;gt;~/$KEYNAME.blob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Set variables:&lt;/P&gt;&lt;P&gt;DEV=/dev/mmcblk0p4&lt;BR /&gt;ALGO=capi:cbc\(aes\)-plain&lt;BR /&gt;TARGET=crypt&lt;BR /&gt;BLOCKS=$(blockdev --getsz $DEV)&lt;BR /&gt;KEYNAME=dm_trust&lt;BR /&gt;TABLE="0 $BLOCKS $TARGET $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1 allow_discards"&lt;/P&gt;&lt;P&gt;3. Create new device mapper&lt;BR /&gt;&lt;BR /&gt;echo $TABLE | dmsetup create encrypted&lt;/P&gt;&lt;P&gt;4. LOAD device mapper "encrypted"&lt;BR /&gt;echo $TABLE | dmsetup load encrypted&lt;/P&gt;&lt;P&gt;5. Format and mount partition:&lt;/P&gt;&lt;P&gt;mkfs.ext4 /dev/mapper/encrypted&lt;BR /&gt;mount -t ext4 /dev/mapper/encrypted /crypt&lt;/P&gt;&lt;P&gt;Now, I would like not to have the&amp;nbsp;$KEYNAME.blob in my system but use the keyring. Since the session keyring expires after reboot, I tried to save the key on a persistent keyring:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;keyctl newring my-keyring @u &amp;gt; /etc/keyrings/my-persistent-keyring_id
keyctl add trusted my-key "load $(cat ~/dm_trust.blob)" $(cat /etc/keyrings/my-persistent-keyring_id)
keyctl link $(cat /etc/keyrings/my-persistent-keyring_id) @u&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately the 2nd (and 3rd ) keyctl call return "permission denied" even if I am root.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct procedure to store the key in the keyring ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 16:40:18 GMT</pubDate>
    <dc:creator>P3r3gr1nus</dc:creator>
    <dc:date>2025-02-27T16:40:18Z</dc:date>
    <item>
      <title>Using Keyring for key to be used for CAAM partition encryption</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-Keyring-for-key-to-be-used-for-CAAM-partition-encryption/m-p/2053130#M234559</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I am following this method to encrypt my emmc partition-&lt;/P&gt;&lt;P&gt;1. generate key:&lt;BR /&gt;KEYNAME=dm_trust&lt;BR /&gt;KEY="$(keyctl add trusted $KEYNAME 'new 32' @s)"&lt;BR /&gt;keyctl pipe $KEY &amp;gt;~/$KEYNAME.blob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Set variables:&lt;/P&gt;&lt;P&gt;DEV=/dev/mmcblk0p4&lt;BR /&gt;ALGO=capi:cbc\(aes\)-plain&lt;BR /&gt;TARGET=crypt&lt;BR /&gt;BLOCKS=$(blockdev --getsz $DEV)&lt;BR /&gt;KEYNAME=dm_trust&lt;BR /&gt;TABLE="0 $BLOCKS $TARGET $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1 allow_discards"&lt;/P&gt;&lt;P&gt;3. Create new device mapper&lt;BR /&gt;&lt;BR /&gt;echo $TABLE | dmsetup create encrypted&lt;/P&gt;&lt;P&gt;4. LOAD device mapper "encrypted"&lt;BR /&gt;echo $TABLE | dmsetup load encrypted&lt;/P&gt;&lt;P&gt;5. Format and mount partition:&lt;/P&gt;&lt;P&gt;mkfs.ext4 /dev/mapper/encrypted&lt;BR /&gt;mount -t ext4 /dev/mapper/encrypted /crypt&lt;/P&gt;&lt;P&gt;Now, I would like not to have the&amp;nbsp;$KEYNAME.blob in my system but use the keyring. Since the session keyring expires after reboot, I tried to save the key on a persistent keyring:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;keyctl newring my-keyring @u &amp;gt; /etc/keyrings/my-persistent-keyring_id
keyctl add trusted my-key "load $(cat ~/dm_trust.blob)" $(cat /etc/keyrings/my-persistent-keyring_id)
keyctl link $(cat /etc/keyrings/my-persistent-keyring_id) @u&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately the 2nd (and 3rd ) keyctl call return "permission denied" even if I am root.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct procedure to store the key in the keyring ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 16:40:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-Keyring-for-key-to-be-used-for-CAAM-partition-encryption/m-p/2053130#M234559</guid>
      <dc:creator>P3r3gr1nus</dc:creator>
      <dc:date>2025-02-27T16:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using Keyring for key to be used for CAAM partition encryption</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-Keyring-for-key-to-be-used-for-CAAM-partition-encryption/m-p/2054588#M234652</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I send you email with a reference, hope that can be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 09:21:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-Keyring-for-key-to-be-used-for-CAAM-partition-encryption/m-p/2054588#M234652</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2025-03-03T09:21:14Z</dc:date>
    </item>
  </channel>
</rss>

