<?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>Force BLE connection &amp;amp; pairing inside my own mobile app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51174/force-ble-connection-pairing-inside-my-own-mobile-app</link><description>Hi, I am wondering if there is a way to reject Bluetooth pairing with Nordic peripheral outside of my own mobile application. For example the Fitbit devices will reject connecting to phone if the user tries to pair the Fitbit device from the phone&amp;#39;s Bluetooth</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Aug 2019 07:01:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51174/force-ble-connection-pairing-inside-my-own-mobile-app" /><item><title>RE: Force BLE connection &amp; pairing inside my own mobile app</title><link>https://devzone.nordicsemi.com/thread/205180?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 07:01:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7fd1daf-e2ce-45c1-8599-b8e05afc97d9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The easy answer is that this is not possible. A&amp;nbsp;peripheral connects to a phone, and not an app. The softdevice doesn&amp;#39;t have any method to ensure this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But as I tried to say, you&amp;nbsp;&lt;strong&gt;can&lt;/strong&gt; try to do some tricks with the key handling, so that it would be more difficult, but it is not possible to restrict the use only with one app.&lt;/p&gt;
&lt;p&gt;Let us say that your peripheral requires the phone to send a certain message every 5 seconds, or else it will disconnect. Let us say that your app does this, so when you use another app, it will disconnect. But if someone tries to sniff this connection, and they see what&amp;#39;s going on, it will be possible to replicate in their own app.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Force BLE connection &amp; pairing inside my own mobile app</title><link>https://devzone.nordicsemi.com/thread/205138?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 18:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:284116c4-aeef-4126-82a4-75f1b2d5dd3d</guid><dc:creator>thoric_fish</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;What about ensuring the Nordic peripheral only connects to my own app? Like you mentioned if other app have the same passkey as my own app then the other app can connect to the Nordic peripheral. Does SoftDevice support any method to make sure the Nordic device only&amp;nbsp;can connect to my app, in addition to pairing with passkey?&lt;/p&gt;
&lt;p&gt;For example the Nordic peripheral would&amp;nbsp;first&amp;nbsp;check a unique token from my app before successful connection and then&amp;nbsp;check for a&amp;nbsp;correct passkey before pairing.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Force BLE connection &amp; pairing inside my own mobile app</title><link>https://devzone.nordicsemi.com/thread/204987?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 10:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f903e442-7e22-42e6-9efe-0e03c4a69619</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]There&amp;nbsp;are options for whitelisting and&amp;nbsp;scanning &amp;amp; filtering by addresses, UUIDs, and other identifiers but it seems like all of these can be spoofed.[/quote]
&lt;p&gt;&amp;nbsp;I would not be surprised if the fitbit pairing can be spoofed as well. Basically, you mention all the methods that prevent your device from pairing with the &amp;quot;wrong&amp;quot; devices. Passkeys probably being the most commonly used. This can be implemented in your app (that it will automatically fetch and send the passkey for you), but there is nothing stopping any other apps from sending the same passkey. I bet that the fitbit app checks the serial number of the device, fetch the passkey from the cloud and then sends it, allowing only the app to connect to it. If you sniff the connection being established (for the first time, since it probably uses bonding), you would probably be able to sniff up something, unless they use LESC on top of that). That being said, I have not tested the fitbit pairing. I don&amp;#39;t know how they restrict it to be used with the app. It is only speculations.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So basically, you can refuse a connection if the connecting device doesn&amp;#39;t have the right keys. It is also possible to do some &amp;quot;security by obscurity&amp;quot;, but that will only work until someone figures out how you secure it.&lt;/p&gt;
&lt;p&gt;So the only option I can think of is to use some Out of Band pairing keys which you need to store in a database in the cloud, which only your app can access. Then your app needs to fetch the advertising name, or some serial number that differs between each device to request that specific key to pair with your device. You can, of course, use the same key for every device, but again, if someone figures out that key, and this leaks, then anyone can connect to it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>