<?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>ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20257/ecb-key-transfer-during-pairing</link><description>Hi,
I have a central that is trying to pair with a peripheral. I want this connection to be secure and I want to use ECB for encryption of data. My peripheral does not have a display or a keyboard. What pairing mechanism should I use? I was thinking</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2017 16:29:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20257/ecb-key-transfer-during-pairing" /><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78914?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 16:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:446fc491-2e3e-4850-9892-1ef8507cab19</guid><dc:creator>SUK</dc:creator><description>&lt;p&gt;Hi Endnote,
Thank you for your inputs and your patience :). I have implemented a system with LE legacy pairing using Just Works and no MITM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78913?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 19:18:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87c8b2a2-9cdf-4f54-8457-40784f3ff5e8</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;.. and how Transport specific key(s) are generated in 3rd phase from LTK. You either understand it or not, that&amp;#39;s very hard to bypass. If you cannot follow all the details then don&amp;#39;t worry, that&amp;#39;s most of the world. Just study Nordic SDK examples and they will show you how all the steps are implemented. You don&amp;#39;t need to understand all the details just major use case (which you seems to get correctly: use LE Secure Connections without MITM protection with Just Works because you have no real option). Just make sure that all the peers you intend to use support this BT 4.2 pairing method, as far as I know many phones don&amp;#39;t support it so you might need to support the legacy LE pairing method as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78912?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 19:15:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:250936d2-6f9d-41f2-ba11-259c2ef35eee</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;That&amp;#39;s the part which confuses me: you say that you want to use LE Secure Connection and then you speak about AES ECB. If you want to use LE SC then stop speaking about AES ECB and stop even thinking about it because there is no option, just specification to follow. To the steps: If you see Security Manager description (BT SIG Core v4.2, Vol 3, Part H, Chapter 2) then you see that Pairing is 3-step process where in second step Long Term Key (LTK) is generated and in third step you use specific Transport Key(s) by using LTK. Once you are paired you always do only 3rd step, LTK stays the same on both sides (you need to keep some sort of database, that&amp;#39;s what &amp;quot;peer manager&amp;quot; module in Nordic SDK is for, obviously just one example of many ways how to manage these). Then in chapter 2.2 you see full &amp;quot;Cryptographic Toolbox&amp;quot; which tells you all the details about how LTK is generated in 2nd step..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78911?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 18:57:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97d5ec7f-0835-4712-a03c-cb4744cb31c2</guid><dc:creator>SUK</dc:creator><description>&lt;p&gt;Hi Endnode, Thank you for your patience :).
Can you please elaborate on &amp;quot; Again there are different ways how to solve it and some basic assumptions to be even able to do it.&amp;quot; and &amp;quot;The final AES key is generated (pretty complex process) so you don&amp;#39;t need to think about it.&amp;quot;? I read the SIG core specs but I am still confused about AES key exchange. When does this happen? After pairing or during pairing?
I am planning to use Just works with LE secure, no I/O, no MITM. I want to use AES ECB to encrypt data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78910?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 07:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b06894ac-ea73-4111-a188-403617e776b0</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi again, so you want to use nRF52 and LE Secure Connections. This is using proper ECC DH key exchange with static and ephemeral key pairs which is not possible to crack by passive listening. That&amp;#39;s good. However because there is no link or central certification authority in the ecosystem you need to &amp;quot;authenticate&amp;quot; that correct peers talk together. Again there are different ways how to solve it and some basic assumptions to be even able to do it. If you have no input or output interface on either device you need to settle with unauthenticated key exchange which is vulnerable to Men In The Middle attack (MITM) - but that would be active not passive. That&amp;#39;s quite OK. For more read BT SIG Core specification v4.2 (or v5.0) and study Vol. 3 Part H, Chapter 2 &amp;quot;Security Manager&amp;quot; where are all details. The final AES key is generated (pretty complex process) so you don&amp;#39;t need to think about it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78909?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 00:02:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f8a6e62-76c3-4410-9cd4-d8b17d035335</guid><dc:creator>SUK</dc:creator><description>&lt;p&gt;I think I understand now. Please confirm if my understanding is correct: When I use Just Works for pairing (as per &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v2.0.1%2Fgroup___b_l_e___g_a_p___p_e_r_i_p_h___l_e_s_c___p_a_i_r_i_n_g___j_w___m_s_c.html&amp;amp;cp=3_7_2_1_0_2_1_3_8_6_4"&gt;this&lt;/a&gt;), the p_pk_own key will be generated by the Soft device (which can be 000000). Then when the stage where the DHKey calculation is done (by the peripheral application), I can use any key I want and send that over to the Central. This key can then be used by the Peripheral and central for AES ECB encryption and decryption. Again, I understand that this is not secure and prone to interception.
This DHKey (which is generated as a long term key) can be stored by the central after bonding so that at every connection (after disconnection) key exchanges won&amp;#39;t have to be done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78908?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 22:37:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f8a7798-5f0b-4b3e-871a-45a1eb97c556</guid><dc:creator>SUK</dc:creator><description>&lt;p&gt;Thank you Endnode for your inputs. Let me summarize what you said: I can only use Just Works for pairing since I don&amp;#39;t have Keyboard or display on my peripheral. But I can still use AES CCM encryption and exchange the AES key over radio even if it is not secure. Is my understanding correct?
Also I did not understand the part where you said &amp;quot;or if you are OK with hard-coding some master key into the FW&amp;quot;. What key are you talking about? The AES CCM key?
Where can I find an example which is using AES CCM encryption using Just Works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78907?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 18:44:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7539400-fdc2-4d9b-93f2-49e1219a65d6</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi SUK,&lt;/p&gt;
&lt;p&gt;Not being expert on BT4.x Security Manager and pairing mechanism but I will try to answer. &amp;quot;Just Works&amp;quot; is really the only option for devices which have no input/output interface so you cannot verify that key you receive over radio interface during pairing is genuinely the same as the on on the other device. So generic &amp;quot;zero&amp;quot; string is used to validate that AES key (generated/exchanged during the process) is the one you should use from now on. If you think it through you will find out that this pairing is basically not secure at all, anyone can intercept it and get the actual AES key and then decrypt (or alter/fake) any communication between these two devices later on. In addition even if you are not listening to the pairing itself you can try to convince one of the devices that you have lost the AES key and if it permits such re-pairing it will allow you to do the same again which of course compromises all the future communication. So using this method for anything sensitive is not a good idea.&lt;/p&gt;
&lt;p&gt;Easy solution could be if your device is able to communicate by some other ways (e.g. NFC thanks to nRF52 in-built near-field communication capabilities) or if you are OK with hard-coding some master key into the FW (nRF5x have also something like on-time programmable registers but as they don&amp;#39;t have any specific HW protection it almost doesn&amp;#39;t matter if you store it there or in the code/data flash). In such case you can use OOB (Out Of Band) mode where AES key is derived/used from this &amp;quot;shared&amp;quot; secret and so you are not exchanging the key over the radio, you don&amp;#39;t need to &amp;quot;verify&amp;quot; that it is genuine (by anything like &amp;quot;Just Works&amp;quot; or &amp;quot;Numeric Comparison&amp;quot;) and you are set to go.&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78905?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 18:25:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f70ea77-c905-4ebf-adc3-eef3265f3998</guid><dc:creator>SUK</dc:creator><description>&lt;p&gt;Yes. I meant using AES ECB encryption using stream cipher as per &lt;a href="https://devzone.nordicsemi.com/blogs/721/intro-to-application-level-security-using-the-ecb-/"&gt;this&lt;/a&gt; blog. Can you answer my questions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ECB key transfer during pairing</title><link>https://devzone.nordicsemi.com/thread/78906?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 18:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74a64425-f210-48e4-aee8-daebbd3bec12</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Just a footnote: you definitely DON&amp;#39;T WANT TO USE ECB (Electronic Codebook) ENCRYPTION/DECRYPTION SCHEME FOR ANY COMMUNICATION PROTOCOL in 2017! But you probably mean AES crypto primitive with some more advanced method (like CCM aka Counter with CBC-MAC)...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>