<?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 encryption - passkey</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57419/ble-encryption---passkey</link><description>Hi, 
 
 Some questions regarding passkey and Diffie Hellman. 
 When a device connects to a mobile - the mobile user should insert a passkey. 
 Does this passkey used as a public key? How does that connected to public key, private key and Diffie Hellman</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Feb 2020 07:42:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57419/ble-encryption---passkey" /><item><title>RE: BLE encryption - passkey</title><link>https://devzone.nordicsemi.com/thread/233638?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2020 07:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae81126a-f296-4506-a9c6-9dc6425aa1ed</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Thank you, Simon! You helped me a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE encryption - passkey</title><link>https://devzone.nordicsemi.com/thread/233546?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 13:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a9d0c17-8f66-4394-8e54-7cc232b2e71f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The passkey is not&amp;nbsp;needed for Diffie Hellman, the Diffie Hellman method is used in order for two devices to agree upon a shared secret key, without ever needing to send that key over the air, check out &lt;a href="https://www.youtube.com/watch?v=YEBfamv-_do"&gt;this video&lt;/a&gt; for a nice visual illustration.&lt;/p&gt;
&lt;p&gt;The passkey is used to authenticate the connection and make sure you&amp;#39;re not connected to a MITM. Let&amp;#39;s say you, device A, want to connect to device B, and you are not using a passkey. Then a device C can act like device B and relay the message: |Device A|⇔|Device C (MITM)|&lt;span&gt;⇔|Device B|. Device A now thinks it is connected to device B. Read &lt;a href="https://www.digikey.com/eewiki/display/Wireless/A+Basic+Introduction+to+BLE+Security#ABasicIntroductiontoBLESecurity-PairingMethodsforLESecureConnections(4.2devicesonly):"&gt;this article&lt;/a&gt; (Pairing Methods for Le S..--&amp;gt;Passkey&lt;/span&gt;&lt;span&gt;) for more detailed information. So MITM attacks can still happen when using LESC, Diffie Hellman and Just works, even though it&amp;#39;s much more resilient than Legacy connections.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In order to avoid this MITM attacks, devices A and B can agree upon a secret Passkey. In that case, device C has to guess the passkey, and the probability of succeeding is close to zero.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So in short:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;The Diffie Hellman method is used to generate a shared secret key between two devices&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;The passkey is used to authenticate the device trying to connect&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE encryption - passkey</title><link>https://devzone.nordicsemi.com/thread/232901?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 16:26:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdd0c790-9dec-49d8-a487-83488f1c91a9</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Thanks for your response, Simon!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Actually, I still have some questions:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) What is the purpose of the passkey? After the user enter the correct passkey - do we need it for Diffie Hellman?&lt;/p&gt;
&lt;p&gt;2) I noticed that Diffie Hellman calculation occurs before the user insert the passkey. The chart states that first the passkey should be insert. How does it possible?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE encryption - passkey</title><link>https://devzone.nordicsemi.com/thread/232897?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 16:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a346652-4591-4191-b895-e5a9c171d9be</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I think&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/emil"&gt;Emil Lenngren&lt;/a&gt;&amp;#39;s&amp;nbsp;answer in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35856/questions-about-lesc-mitm-and-passkey"&gt;this link&lt;/a&gt;&amp;nbsp;explains it quite well. It is also worth taking a look at the Message Sequence Chart for &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___p_e_r_i_p_h___l_e_s_c___b_o_n_d_i_n_g___p_k_e___c_d___m_s_c.html?cp=4_5_2_1_2_1_5_10_6_3"&gt;Bonding: Passkey Entry, User Inputs on Peripheral&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you still have questions, please ask and I will try to answer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>