<?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: Encrypted DEK decryption error in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1258999#M172286</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could you please tell me your CST tool version and your OpenSSL version? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ivan.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Apr 2021 15:30:24 GMT</pubDate>
    <dc:creator>IvanRuiz</dc:creator>
    <dc:date>2021-04-08T15:30:24Z</dc:date>
    <item>
      <title>Encrypted DEK decryption error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1255772#M171965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We're trying to encrypt the DEK for &lt;A href="https://www.nxp.com/docs/en/application-note/AN12056.pdf#page=8" target="_blank" rel="noopener"&gt;manufacturing protection following AN 12056&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We have encrypted the DEK with CST as follows,&lt;/P&gt;&lt;PRE&gt;./cst -out csf_encrypt.txt -c CSF1_crt.pem -i csf_encrypt.bin&lt;/PRE&gt;&lt;P&gt;However when we try to decrypt the encrypted DEK (as produced in above step), we get the following error:&lt;/P&gt;&lt;PRE&gt;openssl cms -decrypt -in /cst_encrypt_sign/dek_spl.bin -inform DER -out ./dek_spl_dec.bin -binary -inkey /CSF1_1_sha256_2048_65537_v3_usr_key.pem -passin file:/key_pass_in.txt&lt;BR /&gt;&lt;BR /&gt;Error reading S/MIME message\n140193583093056:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:../crypto/asn1/tasn_dec.c:1149:\n140193583093056:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:../crypto/asn1/tasn_dec.c:309:Type=CMS_ContentInfo\n&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're following the NXP app note closely, yet receiving these errors.&lt;/P&gt;&lt;H3&gt;&lt;FONT color="#0000FF"&gt;What are the steps to be followed for encrypting and decrypting the DEK with CST?&lt;/FONT&gt;&lt;/H3&gt;</description>
      <pubDate>Thu, 01 Apr 2021 10:51:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1255772#M171965</guid>
      <dc:creator>kanimozhi_t</dc:creator>
      <dc:date>2021-04-01T10:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted DEK decryption error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1258999#M172286</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could you please tell me your CST tool version and your OpenSSL version? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ivan.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 15:30:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1258999#M172286</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2021-04-08T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted DEK decryption error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1259360#M172315</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're using&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;CST&lt;/STRONG&gt; version &lt;STRONG&gt;3.3.1&lt;/STRONG&gt; and&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;OpenSSL&lt;/STRONG&gt; version &lt;STRONG&gt;1.1.1&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;and tried on both &lt;EM&gt;Ubuntu 18.04 and 20.04&lt;/EM&gt; yet no success.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 05:33:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1259360#M172315</guid>
      <dc:creator>kanimozhi_t</dc:creator>
      <dc:date>2021-04-09T05:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted DEK decryption error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1266138#M172999</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems that the front-end code of CST 3.3.1(also for CST3.1) has the issue. "-c" doesn't really work to input the public certification.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Need to add a ":" after c in cst.c in front end code and then rebuild the cst tool, then it can work.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvanRuiz_0-1619041406354.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142903iC4E7A691C881A356/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvanRuiz_0-1619041406354.png" alt="IvanRuiz_0-1619041406354.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried with below command and it work by updated cst binary.&lt;/P&gt;
&lt;P&gt;-----&lt;/P&gt;
&lt;P&gt;./cst -o csf_enc.bin -c IMG1_1_sha256_2048_65537_v3_usr_crt.pem -i csf_uboot_enc.txt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;./openssl cms -decrypt -binary -in dek.bin -inform DER -inkey IMG1_1_sha256_2048_65537_v3_usr_key.pem -out decrypted_dek.bin --passin pass:test&lt;/P&gt;
&lt;P&gt;-----&lt;/P&gt;
&lt;P&gt;Please note that the dek.bin's size is 439 bytes(not 16 bytes) after you really encrypt the dek by the first command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Ivan.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 21:44:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-DEK-decryption-error/m-p/1266138#M172999</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2021-04-21T21:44:14Z</dc:date>
    </item>
  </channel>
</rss>

