<?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>BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92081/ble-data-transfer-use-aes-ccm-encryption-and-unencryption</link><description>Hi, 
 I development a elock device to use nordic 52832 chip. I want to transfer some information between phone app and my device. Like UUID / user account / user password. 
 for against BLE sniffer, we need use AES method to protect our information. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Oct 2022 11:25:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92081/ble-data-transfer-use-aes-ccm-encryption-and-unencryption" /><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390972?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 11:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96b7bf0b-6bcc-4d29-8424-a8f1fc3e8b92</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks for your great information.&amp;nbsp;We will implement it on our product&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390910?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 07:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bf13bf8-ee5c-4f56-9f40-2746d83266f0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;br /&gt;Your solution may work. But you may want to consider adding some extra security on top:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- After you check user account , you may want to have &lt;a href="https://en.wikipedia.org/wiki/Challenge%E2%80%93response_authentication"&gt;a challenge response scheme&lt;/a&gt;. For example the device provide a challenge and the app on the phone must&amp;nbsp;provide a response to the device so that the device are sure it&amp;#39;s connected to an authorized phone. You can choose to do this by the cloud (connect to server as you said) but then it will come to an issue that if the user doesn&amp;#39;t have internet he can&amp;#39;t unlock. There is a blog about this scheme &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/simple-application-level-authentication"&gt;here.&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- You may want to add a &amp;quot;add new user&amp;quot; mode. Instead of simply allow new bond when the bike is unlocked. For example if the attacker just get close to the bike when it&amp;#39;s not locked and not connected to the phone, the he can bond the new phone to it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390880?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 02:00:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1432f073-df78-4c0a-a26d-6e2e8840d714</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;According to our current plan, we will use the user&amp;#39;s account to check on the server to prevent.&lt;/p&gt;
&lt;p&gt;If My bike bonded the Phone A(User A account) and &amp;quot;Already Locked&amp;quot;.&amp;nbsp;Other users will not be able to bonded this bike. Until user A unlocks this bike&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390799?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 11:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:032f5b6f-4d4c-4c39-b513-1245b6925e70</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Then how can you avoid an attacker to steal the bike ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After you bonded the first phone A.&lt;/p&gt;
&lt;p&gt;Then an attacker with a phone C come and bond to the device, how do you avoid it being stolen by attacker with phone C ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390794?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 11:08:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccc32703-56ef-4f1a-94ac-98257f136828</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you say passkey, is it the bluetooth bonding passkey ?&amp;nbsp; &amp;nbsp;Yes&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Our current thinking as below.&lt;/p&gt;
&lt;p&gt;1. The device enter into pairing mode&lt;/p&gt;
&lt;p&gt;2. The device show passkey on display when phone A want to pair the device&lt;/p&gt;
&lt;p&gt;3. Enter the passkey by keyboard on Phone A. The phone A bonded the device.&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp;Make the device enter pairing mode again through a method&lt;/p&gt;
&lt;p&gt;5.&amp;nbsp;&lt;span&gt;The device show passkey on display when phone B want to pair the device&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;6.&amp;nbsp;Enter the passkey by keyboard on Phone B. The phone B bonded the device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;7. User can use phone A or Phone B to lock or unlock device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because a bike may be used by two people. Can two Keys be able to unlock or lock this bike?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390786?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 10:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7655134-6b0a-4513-9ec3-34830c097471</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say passkey, is it the bluetooth bonding passkey ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can have bond with two different phones. You don&amp;#39;t need to clear the first set of bond information.&lt;br /&gt;&lt;br /&gt;But the question is how you enable a new phone to connect and control the bike. It&amp;#39;s more about security question.&amp;nbsp;It&amp;#39;s similar to what I wrote in the last reply. You need to have a way of allowing a new bond. Either by using your phone that already bonded and give a command to allow a new bond. Or by using for example a physical NFC key to allow adding a new bond.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/390574?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 08:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cef8eb72-4cdf-403a-b853-37382d838e9b</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; After our deeper research, now there is a question&lt;/p&gt;
&lt;p&gt;If I already used passkey to connected between my phone and my bike。My transmission is encrypted。&lt;/p&gt;
&lt;p&gt;If I lend my bike to my friend，Is he able to establish other passkey secure connection?&amp;nbsp;Because my bike device already has my Key，Can there be two sets of keys? or the first&amp;nbsp;one will be cleared?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387790?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 02:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efb99179-06f7-4dc4-b38e-8cd4c0d32a50</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;I fully understand what you mean. After these questions I also know how I should design my system. Thank you very much. I need your help if I have any questions in the future.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387626?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 08:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ce8906d-23d1-48a9-bea1-f879145490d8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On most phones you wouldn&amp;#39;t be able to download a LTK and the ask the phone to update the bond with the new LTK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So in this case when the user loses their phone, it&amp;#39;s a security procedure that you need to define on your own. It&amp;#39;s the same with what happen when one loses their key.&amp;nbsp;&lt;br /&gt;Be very careful when defining those protocol to recover the key. We are not expert in this topic so you may want to do some study or get help from expert in security.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Usually if you have a secondary way of unlocking the device, then it&amp;#39;s easier. For example keypad or NFC tag. You can use the second way to unlock the device, and then can clear the bond information, set the device to bonding mode to allow new&amp;nbsp;bonding.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t have any secondary way then you would need to allow advertise with no white list. Allowing any device to connect to . Then in this case you would need another level of security on top of Bluetooth pairing.&amp;nbsp; You then can apply the feature suggested by Daniel in his&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/intro-to-application-level-security-using-the-ecb-"&gt; blog.&amp;nbsp;&lt;/a&gt;&amp;nbsp;The new device need to pass this security level&amp;nbsp;to unlock.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can have a key inside the lock and the phone can access the cloud to get the same key of the same log (scan QR code or login to user account etc).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387591?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 02:00:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f660935f-e301-4e4f-b645-d612cf1691c0</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Sorry for causing your doubts,but i see what you mean.&lt;/p&gt;
&lt;p&gt;Other question is&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I have already bounded and set up encryption and whitelist with Phone A. What should I do if I change or lost my phone A? Can I store LTK in SERVER?&amp;nbsp;When the user enters the account and password on my APP. I can download LTK from server to phone.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387409?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 07:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5346cc12-14a1-46ce-af14-29c1146cb023</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not really sure what you are asking about.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If you are not real buyer you can&amp;#39;t bond your phone to the lock. The lock will not allow any phone to bond to the device. Bonding is only allowed on the first time setting it up.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387379?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 03:05:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e2a272-1011-4a75-9089-d51a1d5906a0</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;Is it possible to increase security by hiding the passkey on the QR code that only each buyer has? If you are not real buyer, you don&amp;#39;t know&amp;nbsp;what are you going to enter during exchange passkey step.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387270?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 11:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd4e37f7-b856-4c4d-98a7-68ec0eeb3331</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;What exactly you are trying to achieve here ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;It&amp;#39;s not possible to customize the Bluetooth pairing on the phone. It&amp;#39;s handled by the system.&amp;nbsp;&lt;br /&gt;So what you can do is to make the app that can scan for the QR code and after scanning QR code it can tell the end user on the phone which passkey they should enter.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387265?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 10:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1be68b-1875-46ed-aee7-c476a1a6693d</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Can I use below flow to do all things.&lt;/p&gt;
&lt;p&gt;1. Set a passkey on device.&lt;/p&gt;
&lt;p&gt;2. When phone and device connected, send this passkey to phone. But the phone does not display the passkey code. Then user must use a qr code card to scan and automatically fill it in the blanks as like ******.&lt;/p&gt;
&lt;p&gt;3. Then reply to the device and complete the comparison&lt;/p&gt;
&lt;p&gt;Does that make sense for secure?&amp;nbsp;Does it help to improve safety?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387262?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 10:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ac3a41a-996b-4270-8dfc-aff2f1a2072a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes , it&amp;#39;s correct. If you can limit the access to bonding mode then it&amp;#39;s safer as the attacker need to try at least 20 times to guess the key and it&amp;#39;s not possible to&amp;nbsp;find the passkey even when they sniff the communication.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For static passkey, please have a look &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_p___p_e_r_i_p_h___b_o_n_d_i_n_g___s_t_a_t_i_c___p_k___m_s_c.html?cp=4_7_3_1_2_1_5_10_7_1"&gt;here.&lt;/a&gt;&amp;nbsp;It&amp;#39;s for legacy pairing but I believe you can use the same&amp;nbsp;&lt;span&gt;BLE_GAP_OPT_PASSKEY for LESC. You would need to configure your device capability to display (even though it doesn&amp;#39;t have a display) and the peer device should have keyboard.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regarding delete bonded information, you should implement the code on the lock that allow the authorized phone to delete bond. Or to have a failsafe button on the lock that allow it to reset the database and allow new bond.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387217?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 08:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02e3617d-3b13-43d6-a949-446ac9c48346</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Yes. I know.&amp;nbsp;My current thinking is as below.&lt;/p&gt;
&lt;p&gt;1. Use static passkey to bonded my device and phone.(QR code include my static passkey and mac address, My app will know when app scan QR code)&lt;/p&gt;
&lt;p&gt;2. Set whitelist. So another phone can&amp;#39;t scan and link my device.&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp;&lt;span&gt;encrypted data transfer between my phone and device. Then I can send lock or unlock command.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is it right?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;My question is if I use static passkey. What will be the flow of the mechanism for my phone and device to exchange passkeys with each other?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also,I&amp;#39;m thinking of a way to delete bonded mode.Back to the first pairing&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387212?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 08:06:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b7af7d-6f48-4fd9-bdc4-dcfb612047a0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;According to the spec, static passkey is not considered safe.&amp;nbsp;One can just retry bonding 20 times (LESC) to get the correct passkey.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please make it very clear that bonding and lock/unlock the doorlock are not the same.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;So the passkey to bond shouldn&amp;#39;t be used to lock or unlock the door&lt;/strong&gt; . Bonding is to encrypt the link for the first time the two device (phone and doorlock) talk to each other. After that they are secured to talk to each other. Then you can send your command to unlock/lock when the link is encrypted.&lt;/p&gt;
&lt;p&gt;Note that you can turn off bonding after you bond with the first device. After that, you can switch to the mode that the device doesn&amp;#39;t bond with any new device and only can be switch to bond mode when you open it or send a command from the phone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387190?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 01:53:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c0df491-8e9e-4a3d-b4d3-6232ffe19828</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you for your answer. Very clear.&lt;/p&gt;
&lt;p&gt;One more question. If my lock don&amp;#39;t have keyboard or display. Only have some hardware buttons.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only way I can do what you describe. Is there only a static passkey way?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It would work this way for me:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Step 3a. Lock device have a static passkey &amp;quot;123456&amp;quot;. I provided a QR code include my static passkey. phone scan this QR code to get and send passkey &amp;quot;123456&amp;quot; to lock device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Step 3a-1 Lock device get &amp;quot;123456&amp;quot; from phone to compare passkey in lock device side. If match. then bonded.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387050?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 10:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:622ce813-5cc2-4c57-ac92-0538fa8445e2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;It would work this way:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 1.&amp;nbsp;User&amp;nbsp;turns on the Lock&lt;/p&gt;
&lt;p&gt;Step 2. Customer open the app on the phone to connect to the lock for the first time and bonding&amp;nbsp;process starts&lt;/p&gt;
&lt;p&gt;Step 3a. If there is keyboard on the lock, the phone can display passkey and user need to type the same passkey on the lock . It&amp;#39;s the random passkey the phone generated.&lt;/p&gt;
&lt;p&gt;Step 3b. If there is display on the lock, the lock can display the passkey and user type the same passkey on the phone. It&amp;#39;s the random passkey the lock generated&lt;/p&gt;
&lt;p&gt;Step 4. Two device bonded . They now have generated and stored the same LTK (long term key). This is Bluetooth LTK.&lt;/p&gt;
&lt;p&gt;Here the set up process is done.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 5 when the user with the phone come close to the lock, the lock automatically connect to it&lt;/p&gt;
&lt;p&gt;Step 6 The phone and the lock encrypt the connection using the previously stored LTK. The lock now know for sure that it connect to the authenticated phone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 7 The link is now encrypted , and the phone can now send the command to lock or unlock the door.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 8 After the door is locked or unlocked, the phone can disconnect the encrypted connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;At step 7 you can implement your extra security protocol if you want.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387036?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 09:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66b66758-5e90-4824-a547-a459edc0def4</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Maybe I&amp;#39;ll describe as below what I understand, see if that&amp;#39;s right.&lt;/p&gt;
&lt;p&gt;Step 1: I use MITM function to bonding my device and phone.&lt;/p&gt;
&lt;p&gt;Step 2: Use key in passkey on phone to&amp;nbsp;confirm your own.&lt;/p&gt;
&lt;p&gt;Step 3: When I will lock device, the device will connect to my phone&lt;/p&gt;
&lt;p&gt;Step 4: AES encrypt and unencrypt some information transfer between device and phone&lt;/p&gt;
&lt;p&gt;Step 5: If authentication succeeded, device will lock&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I know, if I enable MITM function. The transfer data between device and phone will protected by AES. But AES need a key on device and phone side.&amp;nbsp;When will I get this key? I need burn in this key in my device during production in factory? and transfer this key to phone when user enable lock feature? -&amp;nbsp; I don&amp;#39;t understond.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have any user flow can refer it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/387032?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 09:14:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98aca5ba-bdcc-41f6-8d8f-d8a008ce8dd6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Yes it&amp;#39;s possible to do what described in Daniel&amp;#39;s blog for your application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But I want to make it clear that the bonding process (with passkey or NFC) only needed on the first time the phone connect to the lock. On the next connection the phone and the lock will use a common LTK to encrypt the link.&amp;nbsp;&lt;br /&gt;Imagine when a new user setting up his phone as the key, he would need to either read the NFC tag on the log or type the code that show on the log. After that the lock automatically open when the phone is close by (connect - encrypt - unlock command - disconnect)&lt;/p&gt;
&lt;p&gt;If you want to have an extra security layer you can also implement what Daniel described, on top of BLE encryption.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/386975?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 02:00:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:308de8b2-6702-402d-9d99-66011838a1d2</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Hung and Torsten,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you for your quickly answer.&lt;/p&gt;
&lt;p&gt;But for our design, we must auto lock or unlock our device. Don&amp;#39;t need to pick up the phone and enter the passkey. Do I have any way that I can use MITM without passkey(Maybe our key already save in our phone app)&lt;/p&gt;
&lt;p&gt;Also, I want to know that can I use below method(ECB) with softwaredevice to do our secure way?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/intro-to-application-level-security-using-the-ecb-"&gt;devzone.nordicsemi.com/.../intro-to-application-level-security-using-the-ecb-&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Have any issue or limit?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/386822?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 11:03:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb5ebd6-7171-497d-94bf-6905f4465537</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi John,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As Torsten already explained, you can have a secure way of transferring data between your device and the phone using the standard Bluetooth pairing. The link is considering secured if you use LESC with MITM (Man In The Middle) or legacy pairing with OOB (NFC for example) .&lt;/p&gt;
&lt;p&gt;Please have a look at the examples in our SDK:&amp;nbsp; ble_app_gls (MITM with passkey) or&amp;nbsp;ble_app_hrs_nfc_pairing,&amp;nbsp;ble_nfc_pairing_reference (for NFC OOB)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/386811?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 10:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c155f43-b3ac-4c15-b2d3-5bc6807bb508</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;The concrete implementation of MITM protection depends on the IO capabilities you can implement with your lock. Every version of the Nordic SDK will provide this very basic and very fundamental security concept. Think of a keyboard. It would be a nightmare, if not all keystrokes would be encrypted properly.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not using the Nordic SDK very much, so I&amp;#39;m not able to point you to a concrete example.&lt;/p&gt;
&lt;p&gt;There is an other method that might be interesting for your application OOB (out of band) data. This basically means, you provide the Key to both communication partners, so that they do not have to exchange the key over the air.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer use AES/CCM encryption and unencryption</title><link>https://devzone.nordicsemi.com/thread/386806?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 10:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:746f9fb2-d637-490e-8ceb-8489b718d9ff</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Robitzki,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;You mean I just need to enable&amp;nbsp;&lt;span&gt;MITM protected. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. My All data should&amp;nbsp;&lt;/span&gt;&lt;span&gt;encrypted&amp;nbsp;by AES.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Phone app can get a key from device when pairing boths.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. Is MITM a standard function on BLE?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any example that can refer it?&amp;nbsp; which Nordic SDK version can support it?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, we don&amp;#39;t want the user to have to enter the passkey by phone. In fact the user doesn&amp;#39;t need to pick up the phone to unlock my device(Like auto lock and unlock)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;John.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>