<?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>AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22062/aes-ccm-encryption-decryption-examples</link><description>Hello, 
 Are there examples of AES CCM encryption/decription? 
 Is there a recommended procedure for generating nounces? 
 Are there recommended procedures for using CCM? 
 Thank you. 
 Update : I forgot to mention I am using a nrf52832.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Jun 2017 11:35:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22062/aes-ccm-encryption-decryption-examples" /><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86629?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2017 11:35:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e58daf3a-2110-4bb1-b4a5-38a8e0a5bb5c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nabil&lt;/p&gt;
&lt;p&gt;As explained in the case you link to the HRS example does not require encryption. Unless you request it from the central side the link will remain open.&lt;/p&gt;
&lt;p&gt;With LESC it is not possible simply to sniff the data, that is correct, but you can still perform a man-in-the-middle attack.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86625?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2017 10:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f18116e-fc02-4bfb-86e8-330c644f2c7a</guid><dc:creator>Nabil</dc:creator><description>&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;In this answer : &lt;a href="https://devzone.nordicsemi.com/question/98156/bluetooth-encryption/?answer=98476#post-id-98476"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;we can read that :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Just Works: STK generated on both sides, based on packets sent in plain text. No security against MITM attacks
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I&amp;#39;m working with SDK11 on S132 then the link is encrypted in the Heart Rate Sensor example ?&lt;/p&gt;
&lt;p&gt;If I enable the LE Secure Connections it&amp;#39;s impossible to sniff data ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86632?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2017 09:28:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b79d9446-1ddb-46fa-b4de-f9783cee2916</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nabil&lt;/p&gt;
&lt;p&gt;If you are using Bluetooth then you don&amp;#39;t need my example, you can just use the built in pairing mechanisms of the Bluetooth stack.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to use passkey then you can revert to &amp;#39;just works&amp;#39; pairing (providing encryption only, without authentication). This makes you vulnerable to attacks during the pairing phase, but if you make sure to pair in a safe location then you will have a secure connection afterwards.&lt;/p&gt;
&lt;p&gt;If you enable the LE Secure Connections feature (introduced in Bluetooth 4.2) then you also get passive eavesdropping (sniffer) protection, but you don&amp;#39;t get man in the middle protection unless you enable authentication.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86631?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2017 10:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85f38beb-2381-43ee-b613-ce92b9668e16</guid><dc:creator>Nabil</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I want to encrypt data ( to protect against sniffer ) without bonding. I&amp;#39;m only pairing with devices. I don&amp;#39;t want to use passkey and I don&amp;#39;t have display/keyboard capabilities on peripheral.&lt;/p&gt;
&lt;p&gt;Is it simply possible to exchange key without autentification ?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll check your Github link thanks&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86630?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2017 10:02:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d4bd6d4-3d81-43b7-bcca-0f922ed27bd0</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nabil&lt;/p&gt;
&lt;p&gt;Did you see my response above?&lt;br /&gt;
I made a small example and put it on Github.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86626?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 13:43:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cce74b20-b725-4251-8c22-6e105e46ba42</guid><dc:creator>Nabil</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is something for nRF52832 available ? I want to encrypt/decrypt data but micro-ecc is not really documented...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86622?ContentTypeID=1</link><pubDate>Tue, 30 May 2017 12:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a0be827-c9de-4d33-a052-bd70aaccc0ff</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Macro&lt;/p&gt;
&lt;p&gt;The padding is a bug. In my first implementation I implemented the counter as a 5 byte array, and added 3 bytes of padding as per the specification, but later I changed the counter to a uint64_t to simplify the code. Unfortunately I forgot to remove the padding when doing so.&lt;/p&gt;
&lt;p&gt;I have removed the padding now, and updated the repo.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86621?ContentTypeID=1</link><pubDate>Mon, 29 May 2017 06:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73d0a74f-d9ef-46c9-bca9-689fa67cdd8a</guid><dc:creator>Macro</dc:creator><description>&lt;p&gt;Hi, I checked the encryption/decryption and basing on my experience with non-simultanious-radio use crypting the 3 byte _padding for nonce part in example is misaligning. BR Macro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86620?ContentTypeID=1</link><pubDate>Sun, 28 May 2017 20:38:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11d19c3d-b9e4-4d1a-9546-da019b5305e7</guid><dc:creator>Macro</dc:creator><description>&lt;p&gt;Hi, Solved the infinite loop issue. Result was due wrong enabling bit usage. However the direction bit and padding issue are still interesting issues due different size crypting needs vs. example. BR Macro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86619?ContentTypeID=1</link><pubDate>Sat, 27 May 2017 08:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18085c90-11eb-4756-9467-9d2a02320999</guid><dc:creator>Macro</dc:creator><description>&lt;p&gt;Hi, I have a few questions appeared at same:
CCM data field is defined in example as:
typedef struct
{
uint8_t key[CCM_KEY_SIZE];
uint64_t counter;
uint8_t _padding[8 - CCM_COUNTER_SIZE];
uint8_t iv[CCM_IV_SIZE];&lt;br /&gt;
}ccm_data_t;
In NRF52832 product specification address offset of 24 octet mentions direction bit without further explanation and generally after 8 (effective 5) byte counter field is only 1 byte before nonce IV location. In example there is 3 byte _padding instead. BR Macro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86618?ContentTypeID=1</link><pubDate>Fri, 26 May 2017 11:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e31d0bd7-c8f3-444e-85b2-4d0c17748ebf</guid><dc:creator>Macro</dc:creator><description>&lt;p&gt;Hi. I have tried to utilize example to make AES CCM encryption/decryption independently of Radio. I mean just encrypt data or decrypt and not sending data over radio interface. Not utilizing the SDK or SD. Quite much following the example but ending to situation that already the KSGEN ends upto infinite loop never ending before watchdog resets the system. In radio interface S0 and S1 are not enabled. I tried fisrt with packet size 128 bytes and later as in example 8 bytes. But same result. Any possibility as the feature is fresh in mind to make example where encryption is not done simultanously with the radio interface? Or any key issues to remind. I took also account the ERRDATA for CCM slowness issue. BR. Macro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86617?ContentTypeID=1</link><pubDate>Fri, 26 May 2017 09:31:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fbbad33-5ae5-4594-86e6-77ad3298b767</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I would appreciate any feedback on the example, if it answers your questions or not. If I don&amp;#39;t hear anything I will assume the example is good enough ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86616?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 14:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71fdf215-646e-4cd2-bfbf-1be3c0ff67fe</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Hello Torbjørn,&lt;/p&gt;
&lt;p&gt;Thank you very much!&lt;/p&gt;
&lt;p&gt;Sure, if you need anything from my end please let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86615?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 12:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e8b280a-1280-45d8-bca4-bb9ccfea4582</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Lucas&lt;/p&gt;
&lt;p&gt;I made an example and made it available on Github:&lt;br /&gt;
&lt;a href="https://github.com/NordicSemiconductor/nrf52-esb-ccm-example"&gt;github.com/.../nrf52-esb-ccm-example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please have a look at it and let me know if it can be of any help. If you have any feedback on the code I will make sure to take it into consideration :)&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86628?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 20:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b99294d-d6c5-4462-aed7-d922bde3eeb9</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Hello Torbjørn,&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86627?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 12:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac8e1a2-8a28-4cc2-bab3-41dab5352efd</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Oliver&lt;/p&gt;
&lt;p&gt;It seems this is a recurring request, but I can&amp;#39;t find any existing examples for the CCM in the nRF51/52 series. I will set aside some time to implement such an example next week, but I can&amp;#39;t promise anything before that :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86624?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 18:04:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cefa4f05-f42b-40d0-b440-afaa0d7a1d86</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Hello Oliver,&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;It seems this cryptocell is only available for nrf52840.&lt;/p&gt;
&lt;p&gt;Are there any examples using the peripheral included in nrf52832?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AES CCM encryption/decryption examples</title><link>https://devzone.nordicsemi.com/thread/86623?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 17:50:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc8eea46-7854-4257-912b-c025793d0bb6</guid><dc:creator>Oliver</dc:creator><description>&lt;p&gt;You can find an AES CCM example in the SDK v13.0.0 in examples\crypto\nrf_cc310\aes:
&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fcryptocell_example.html&amp;amp;cp=4_0_0_4_7_0&amp;amp;anchor=cryptocell_example_test"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>