<?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>Encrypted advertise</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13371/encrypted-advertise</link><description>I want to use NRF51822 to advertise is door close/open. No need bidirectional data sending.
Only one way from NRF sensor to mobile phone app.
Actually I have only two different packets: door open, door close.
I have to encrypt that packets.
It&amp;#39;s easy</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Apr 2016 05:30:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13371/encrypted-advertise" /><item><title>RE: Encrypted advertise</title><link>https://devzone.nordicsemi.com/thread/50993?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 05:30:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe333e04-d5d8-4306-85e5-f4cf866bea8f</guid><dc:creator>uriy</dc:creator><description>&lt;p&gt;Thank you! It looks very good solution for me!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encrypted advertise</title><link>https://devzone.nordicsemi.com/thread/50992?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 03:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92371c70-014e-4824-b348-f1e3af266412</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No need for CBC mode. When you agree the AES key reset a counter (something long) to zero on each side. When you encrypt a packet, increment the counter and encrypt the packet + counter, decrypt on the other side. As long as the counter is larger than any you have seen, it&amp;#39;s a new packet not a replay so accept it and then bump your own expected counter.&lt;/p&gt;
&lt;p&gt;If you change the key, reset the counter to zero. Doesn&amp;#39;t matter if you lose packets, as long as the counter keeps increasing you can be sure you&amp;#39;re not getting a replay attack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>