<?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>nrf_ecb_crypt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6820/nrf_ecb_crypt</link><description>I am trying to decrypt some data.
My data is encrypted using AES-ECB No padding method.
I know the 32Byte key used for decryption.
Following is the code snippet. I am not getting desired decrypted data.
Any comments on this? 
 //key
 uint8_t key</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 May 2015 07:10:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6820/nrf_ecb_crypt" /><item><title>RE: nrf_ecb_crypt</title><link>https://devzone.nordicsemi.com/thread/24020?ContentTypeID=1</link><pubDate>Fri, 01 May 2015 07:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f20d534-ab9f-465d-a634-63e7e81bec0d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Well if you port some open source C implementation of AES decrypt function then you willl cry because performance will be hardly usable. Better choice is probably designing protocols where you need only AES encryption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ecb_crypt</title><link>https://devzone.nordicsemi.com/thread/24019?ContentTypeID=1</link><pubDate>Fri, 01 May 2015 06:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:557758e0-3616-4f82-bbb5-5c6ab741da65</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;clear!!
AES block is only for encryption!!
Thanks!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ecb_crypt</title><link>https://devzone.nordicsemi.com/thread/24018?ContentTypeID=1</link><pubDate>Fri, 01 May 2015 04:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b2a171-ee78-4332-a47e-d2b75cafac62</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;I read all posts of earlier topic but I am not getting clear view.
Is it possible to decrypt AES ECB data using Nordic API&amp;#39;s? or Do I need to port some other library on
Nordic?&lt;/p&gt;
&lt;p&gt;Please give your valuable comments.&lt;/p&gt;
&lt;p&gt;Thanks!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ecb_crypt</title><link>https://devzone.nordicsemi.com/thread/24017?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2015 21:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1691c016-c484-4d7a-adf4-d05edb827a3f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi Milan, have you read all responses to your previous question on the same &lt;a href="https://devzone.nordicsemi.com/question/33513/how-to-decrypt-aes-ecb-nopadding-data/"&gt;topic&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Nordic nRF51 ICs and Soft Device API do not support AES decryption, only encryption. So the result &lt;code&gt;of nrf_ecb_crypt&lt;/code&gt; function call are always AES-128 ECB encrypted data. So your test vector is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AES-128-ECB-ENCRYPT(clear text = 0x3DB77B406B1D5B38A3CF34FB27D83B8E, key = 0x5A34F5F2BB0C6FEF8E9480DEE1316C51) = 0x7ED754853E36C3E3FFCFF4484F56F10D&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;rather then&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AES-128-ECB-DECRYPT(clear text = 0x3DB77B406B1D5B38A3CF34FB27D83B8E, key = 0x5A34F5F2BB0C6FEF8E9480DEE1316C51) = 0x35613334663566326262306336666566 (aka &amp;quot;5a34f5f2bb0c6fef&amp;quot; in ASCII;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What is definitely confusing is description of &lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00756.html"&gt;AES ECB encryption module in Nordic&amp;#39;s documentation&lt;/a&gt; but even they say &amp;quot;encryption/decryption&amp;quot; there is no input flag which would determine which operation will be performed and it (obviously) cannot be visible just from the inputs (key or cypher text data).&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>