<?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>how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21049/how-to-transmitt-encryption-data-with-nrf51-sdk9-hrm-example</link><description>I just want to understand concept.
For example, I need transmit battery level, heart rate level and other.. in closed (encrypted characteristic). I use S130 nRF51 SDK9. HRS example.
If I run this example, on my smartfone I can see all of this data.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Apr 2017 15:29:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21049/how-to-transmitt-encryption-data-with-nrf51-sdk9-hrm-example" /><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82245?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 15:29:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e07e35a9-dd40-4100-b2f9-85b7f2587a61</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If you see the phone is bonded to your device, then the link is encrypted. Check the bonding list in Bluetooth setting in the phone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82244?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 14:06:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e96dd87-1928-4e5e-8c71-7f211b028ad2</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks. therefore, for crypted characteristics, my code like above is enought and correct? Or does it have another method for crypted data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82243?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 14:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b43a8c8-a6bf-44c6-bb28-8eb3b50939ba</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If you set BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM() to the characteristic, encryption will be required when the central want to read your data. And then you will get a popup on the phone to ask for pairing.&lt;/p&gt;
&lt;p&gt;After you pair, the link will be encrypted. But note that, the application will still show the normal data value when you read the characteristic, just because the encryption happens on lower layer and it&amp;#39;s transparent to the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82242?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 09:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:938d4a4f-3b87-4677-8919-273541fd8252</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks for answer. I use HRS example on nRF51 and I want to understand about encryption. How to do it.
So, on nRF51 I run HRS example in advertise mode. On central (smartfone application nRF connect) I can see data. Battery level for example. When on HRS project I add  into&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void gap_params_init(void) ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;code like on 1st post, on the smartfone I can see all my data without any encryption. For ex, I can see battery level.
What I should do for crypted this data? For crypted battery level for ex?
I suppose, I need add in&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void services_init(void)
    BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&amp;amp;bas_init.battery_level_char_attr_md.cccd_write_perm); 
BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&amp;amp;bas_init.battery_level_char_attr_md.read_perm); 
BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&amp;amp;bas_init.battery_level_char_attr_md.write_perm);

BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&amp;amp;bas_init.battery_level_report_read_perm);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;instead of&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;bas_init.battery_level_char_attr_md.cccd_write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;bas_init.battery_level_char_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&amp;amp;bas_init.battery_level_char_attr_md.write_perm);

BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;bas_init.battery_level_report_read_perm);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is it correct? If I want to crypted one of charecteristic? Or is there method to cripted all data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82241?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 07:47:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f1c2278-405e-4ebf-9714-2966ba97ef99</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Mikhail: please give more information on how you test it. What you meant by &amp;quot;see&amp;quot; and &amp;quot;can&amp;#39;t see&amp;quot; ? which tool did you use  ? Which central device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82240?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2017 10:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96098c52-363c-4d0f-8f2a-e4958629f2b6</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks for answer.
With only code  like in 1-st post&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void gap_params_init(void) ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t have encrypted dsta. Any data of charactericstic I can see without encryption.
But if I add in characteristic property encription, I can&amp;#39;t see data in that characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to transmitt encryption data with nRF51 SDK9 hrm example?</title><link>https://devzone.nordicsemi.com/thread/82239?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2017 10:22:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:611226db-41ca-45eb-aa7f-b8263b3605f9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mikhail,&lt;/p&gt;
&lt;p&gt;Do did you check if the data was encrypted or not ?&lt;/p&gt;
&lt;p&gt;The easiest way is to encrypt data is to pair/bond your phone with the device. After pairing/bonding, the communication between the phone and the device is encrypted with AES128.&lt;/p&gt;
&lt;p&gt;The passkey configuration is part of the pairing process when you want to have MITM protection.&lt;/p&gt;
&lt;p&gt;But you need to start pairing first. Please try to test with our proximity example where bonding is required to read a characteristic.&lt;/p&gt;
&lt;p&gt;I would suggest you to have a look at a BLE book to have a rough overview of how BLE security works for example &amp;quot;Bluetooth Low Energy: The Developer&amp;#39;s Handbook&amp;quot; , &amp;quot;Getting Started with Bluetooth Low Energy: Tools and Techniques for Low-Power Networking&amp;quot;
or have a look &lt;a href="https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>