<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117818/psa-cryptocell-with-mbedtls-for-unsupported-ciphers</link><description>I am working off of the NRF SDK Zephyr repository where I am using the NRF Security subsystem in order to use PSA for AES encrypt/decrypt. I need additional ciphers such as DES which the cryptocell on the nRF5340 does not support. MbedTLS has a software</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Jan 2025 10:04:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117818/psa-cryptocell-with-mbedtls-for-unsupported-ciphers" /><item><title>RE: PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/thread/518110?ContentTypeID=1</link><pubDate>Mon, 13 Jan 2025 10:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d765a34-c576-4a4e-9ef8-f1f4a55aae88</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Am I right that you are working on upstream Zephyr and is receiving support here?&lt;br /&gt;&lt;a href="https://discord.com/channels/720317445772017664/884102502021210152/1326274299962593360"&gt;https://discord.com/channels/720317445772017664/884102502021210152/1326274299962593360&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I found that the members there&amp;nbsp;have explained that to add support for DES, you can make a small custom PSA driver based on the Mbed TLS implementation. It seems however that you are heading on a different direction, however.&lt;/p&gt;
&lt;p&gt;Do you still have any questions here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/thread/517806?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 21:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:695cde8a-30e3-45b9-be08-28e66f1f09a0</guid><dc:creator>kwolff</dc:creator><description>&lt;p&gt;Yes. It&amp;#39;s to communicate with a third-party and I can&amp;#39;t use another cryptography method. No choice but to use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/thread/517799?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 20:31:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:890e9d61-58a2-420d-a45f-d1e419932129</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi kwolff,&lt;/p&gt;
&lt;p&gt;My apology, I must have misread something to think the CryptoCell can support DES. You are right that it doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;And you are also perfectly right in your investigation that none of the software driver&amp;nbsp;for nRF Security support DES.&lt;/p&gt;
&lt;p&gt;As for legacy Mbed TLS APIs,&amp;nbsp;I find that DES isn&amp;#39;t supported there either, but I am checking with someone more experienced on it to see if I missed anything.&lt;/p&gt;
&lt;p&gt;That being said, while looking this up, it appears to me that DES is rather weak and is being deprecated in most systems. Do you absolutely need DES?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/thread/517561?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 22:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:898b1322-2682-40d3-aaf1-cfb4427ef8b2</guid><dc:creator>kwolff</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/vthieu"&gt;Hieu&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;If I try to add CONFIG_PSA_WANT_KEY_TYPE_DES, I get the following compile time error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;path&amp;gt;/subsys/nrf_security/include/psa/core_unsupported_ciphers_check.h:678:2: error: #error &amp;quot;No crypto implementation for DES-CBC-no-padding&amp;quot;
  678 | #error &amp;quot;No crypto implementation for DES-CBC-no-padding&amp;quot;
      |  ^~~~~&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If I don&amp;#39;t include CONFIG_PSA_WANT_KEY_TYPE_DES, I get the error described in the original post where the return from psa_import_key returns the error PSA_ERROR_NOT_SUPPORTED. Following the path to the error, this is because PSA_WANT_KEY_TYPE_DES is not enabled.&lt;/p&gt;
&lt;p&gt;This issue can be reproduced by modifying the sample at samples/crypto/aes_cbc as my current PSA configuration looks the exact same. I want the same thing this sample wants with the addition of being able to encrypt/decrypt using DES.&lt;/p&gt;
&lt;p&gt;Cryptocell is incapable of handling DES as noted here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a id="" href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/cryptocell.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/cryptocell.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CONFIG_PSA_HAS_KEY_SUPPORT from&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/09d59449c58b67d1bb3ca75a54b1bbfec1b54e6f/subsys/nrf_security/Kconfig.psa.nordic"&gt;subsys/nrf_security/Kconfig.psa.nordic&lt;/a&gt; does not show support for DES keys.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config PSA_HAS_KEY_SUPPORT
	bool
	default y
	depends on PSA_WANT_KEY_TYPE_AES 			|| \
		   PSA_WANT_KEY_TYPE_CHACHA20			|| \
		   PSA_WANT_KEY_TYPE_DERIVE			|| \
		   PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT	|| \
		   PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT	|| \
		   PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE	|| \
		   PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE	|| \
		   PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY		|| \
		   PSA_WANT_KEY_TYPE_HMAC			|| \
		   PSA_WANT_KEY_TYPE_PASSWORD			|| \
		   PSA_WANT_KEY_TYPE_PASSWORD_HASH		|| \
		   PSA_WANT_KEY_TYPE_PEPPER			|| \
		   PSA_WANT_KEY_TYPE_RAW_DATA			|| \
		   PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT	|| \
		   PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT	|| \
		   PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE	|| \
		   PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE	|| \
		   PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY		|| \
		   PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT	|| \
		   PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT	|| \
		   PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_GENERATE	|| \
		   PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE	|| \
		   PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY		|| \
		   PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_IMPORT	|| \
		   PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_EXPORT	|| \
		   PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_EXPORT	|| \
		   PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_GENERATE	|| \
		   PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_DERIVE	|| \
		   PSA_WANT_KEY_TYPE_SRP_PUBLIC_KEY
	help
	  Prompt-less configuration that states that key types are supported.&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/09d59449c58b67d1bb3ca75a54b1bbfec1b54e6f/doc/nrf/libraries/security/nrf_security/doc/driver_config.rst#L82"&gt;doc/nrf/libraries/security/nrf_security/doc/driver_config.rst &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PSA Cryptocell with MbedTLS for unsupported ciphers</title><link>https://devzone.nordicsemi.com/thread/517559?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 22:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0525d12c-0966-47b2-be95-d67b7d2919e4</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi kwolff,&lt;/p&gt;
&lt;p&gt;Could you please give more details&amp;nbsp;on the issue?&lt;/p&gt;
&lt;p&gt;Is it a compile time error, or is it a run time?&lt;/p&gt;
&lt;p&gt;If compile time, what is the full error log?&lt;/p&gt;
&lt;p&gt;How can the issue be reproduced?&amp;nbsp;The .conf file you shared are just the aes_cbc sample&amp;#39;s file unmodified.&lt;/p&gt;
&lt;p&gt;I am not clear about your plan to connect Mbed TLS implementation to NCS PSA (nRF Security) implementation yet. However, nRF Security &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.0/subsys/nrf_security/include/psa/core_unsupported_ciphers_check.h#L670-L698"&gt;seems capable of DES keys&lt;/a&gt;. You will have to enable CONFIG_PSA_WANT_KEY_TYPE_DES.&lt;/p&gt;
&lt;p&gt;Also, why do you think the CryptoCell cannot&amp;nbsp;handle&amp;nbsp;DES key?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>