<?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>Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14758/protecting-write-characteristic---best-option</link><description>Hi! I have some issues with security and BLE. I have a device (using the nrf51822 and S110 softdevice) that has a custom service with a single read write characteristic. Problem is that I want to protect that characteristic from being written to by just</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Mar 2019 02:59:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14758/protecting-write-characteristic---best-option" /><item><title>RE: Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/thread/178210?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 02:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:133f3d97-7b8a-4a99-81b1-82166ab8eb21</guid><dc:creator>Jebakumar</dc:creator><description>&lt;p&gt;nicely explained&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/thread/56354?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2016 18:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2d2c231-dc08-48ba-a277-c81fc17566ff</guid><dc:creator>r00li</dc:creator><description>&lt;p&gt;Thanks for the nicely detailed explanation of security in BLE! It&amp;#39;s really helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/thread/56353?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2016 11:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f21288c8-a026-48a2-ac7f-5d81306c06fa</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;BLE security mode 1 has four security levels, and a connection operate in one of these levels.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;No security – No encryption&lt;/li&gt;
&lt;li&gt;Unauthenticated pairing with encryption, but no MITM protection&lt;/li&gt;
&lt;li&gt;Authenticated pairing with encryption and MITM protection&lt;/li&gt;
&lt;li&gt;Authenticated LE Secure Connections pairing with encryption&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Every time two devices connect, the connection operate in security level 1 - no security. Then you perform an authentication procedure or encryption procedure to increase the level of security of the connection.&lt;/p&gt;
&lt;p&gt;With the authentication procedure the higher level of security is achieved by doing unauthenticated or authenticated pairing. Authenticated pairing results in authenticated encryption keys, while unauthenticated pairing results in unauthenticated encryption keys.&lt;/p&gt;
&lt;p&gt;Pairing is authenticating another device, and establishing temporary shared secret keys which can be used to encrypt a link. Bonding is pairing followed by distribution of keys which can be used to encrypt the link in future reconnections. With only pairing the keys are only valid on the current connection, with bonding the keys are typically stored persistently (as a bond) and can be used on subsequent connections.&lt;/p&gt;
&lt;p&gt;With the encryption procedure the higher level of security is achieved by encrypting the connection with encryption keys that are already available (no pairing necessary). This is typically if encryption keys were shared and stored after previously performed bonding. These encryption keys can also be authenticated or unauthenticated and determine the security level.&lt;/p&gt;
&lt;p&gt;It is possible to set a security requirement on a characteristic value, it is also possible to have different security requirements on writes and reads of a characteristic value.&lt;/p&gt;
&lt;p&gt;You want the user to be authenticated before he/she can acccess the characteristic value, so you should set the required security level for writing to level 3.&lt;/p&gt;
&lt;p&gt;To increase the security level of the connection to level 3 you have two options, pairing with Passkey Entry or OOB.&lt;/p&gt;
&lt;p&gt;Passkey Entry normally requires a display or a keyboard, but with our SoftDevices you can set a static passkey, so the device doesn&amp;#39;t need any input. This would be similar to a predefined password, only it will be a predefined passkey. This is of course less secure, since the passkey is static. The passkey is also short, only 6 digits, or around 20 bits, which means it provides very limited protection against eavesdroppers during the pairing process. If the attack is not performed during the pairing process, the encryption is secure and confidentiality is achieved.&lt;/p&gt;
&lt;p&gt;With OOB a 128 bit key is normally transferred by some other means, for example by using Near-Field Communcation, but you can also have this static in our SoftDevices. The OOB key is intended to be random, so setting it statically is less secure. A problem is that as far as I know Android and iOS doesn&amp;#39;t allow you to set OOB key directly, only through NFC or other.&lt;/p&gt;
&lt;p&gt;If you bond you can store the authenticated keys persistenly and do an encryption procedure on subsequent connections. This will increase the security level to 3, and you will be able to write the characterisitic value.&lt;/p&gt;
&lt;p&gt;In my mind these are the options that are offered to you by the BLE protocol, you can of course (additionally) implement something in the application layer. &lt;a href="https://devzone.nordicsemi.com/blogs/721/intro-to-application-level-security-using-the-ecb-/"&gt;This&lt;/a&gt; blog may not be relevant, but it is an interesting read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/thread/56352?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2016 15:10:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07d472bc-bd06-483d-a0c0-1527d7641b75</guid><dc:creator>r00li</dc:creator><description>&lt;p&gt;Either a phone or some specialized embedded system running linux.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting write characteristic - best option?</title><link>https://devzone.nordicsemi.com/thread/56351?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2016 09:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b3848a7-155b-47bf-9df9-8e85b734d2aa</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What kind of central devices would connect to this device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>