<?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>nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82434/nrf52810-passkey-entry</link><description>Hi Sir/Miss, 
 
 I try to implement static passkey in my project. Which is using nRF52810. 
 The SDK version is 17.0.2. 
 Softdevice is S112. 
 My project is based to develop on NUS. 
 I want to use central device to enter passkey to do pairing and bonding</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Dec 2021 01:43:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82434/nrf52810-passkey-entry" /><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/343783?ContentTypeID=1</link><pubDate>Thu, 16 Dec 2021 01:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81508441-08dd-4d29-872c-94223fc57748</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Thank you for your provide that project. After I import my project, it solves my problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342914?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 12:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9c82cbe-614b-46ff-b487-033a355d6cf7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I sent you my modified version of your project to your email. Hope it helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342800?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 03:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:061c321d-460c-491d-96e0-a83d3421948c</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;&lt;span&gt;&amp;quot;Do you mean that you over a non-secured characteristic send the passkey to later be used?&amp;nbsp;&amp;quot; Y&lt;/span&gt;&lt;span&gt;es. But, it looks like useless.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That&amp;#39;s good suggestion to me in method of Apple Homekit. We can refer it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks your suggestion and github link.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342690?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 11:48:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55b3dda2-2c70-4616-9d21-1556fb6f8ff4</guid><dc:creator>Emil Lenngren</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;Maybe, I can add another open security service to show dynamic passkey in APP&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you mean that you over a non-secured characteristic send the passkey to later be used? That will not give you any higher security than the &amp;quot;Just Works&amp;quot; association model.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Unfortunately, what the Bluetooth standard can offer is not good enough for use cases when devices have no displays nor keypads, to establish all the security properties expected by modern security (secure against passive eavesdroppers, man-in-the-middle attacks and unauthorized bond attempts (i.e. being able to pair without knowing the passkey)).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is a wide issue among BLE device manufacturers and is in my opinion a design mistake in the spec. If the spec developers had just chosen a PAKE (password authenticated key exchange) algorithm instead, static passkeys would have been possible and&amp;nbsp;could have all the security properties mentioned above.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What people instead tend to do, that really want a static passkey, is to either accept the lower security and go with Legacy Pairing (which is still pretty good protecting from users only knowing the correct passkey to&amp;nbsp;&amp;quot;log in&amp;quot; to the device, assuming no attacker is nearby at the pair attempt), or implement their own PAKE protocol and security on top of unencrypted BLE and then skip BLE pairing. The later approach is&amp;nbsp;way more advanced but is chosen when the higher security is really needed, so this approach is chosen by for example Homekit. So you should really try to list down the different security properties you need, compare with the implementation efforts you would like to put into the project, and then choose the method that suits you best.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you would like to read more about why LESC with static passkey is not secure, I wrote a post some time ago here:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/36005."&gt;github.com/.../36005.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342685?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 11:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:814a2226-a13d-4512-94d9-4dd1ad40db53</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;After your suggestion, I see the content is in 7.2.3 and 2.3.5.6.3 of Core Spec 5.3.&lt;br /&gt;Because our product don&amp;#39;t have screen and display. There is only two color LED. I don&amp;#39;t know whether has other method to let our user to enter dynamic passkey? I don&amp;#39;t know if my idea is correct. Maybe, I can add another open security service to show dynamic passkey in APP. Then, user can have authority to access main service. Or, are there another suggestion?&lt;br /&gt;Thank you for your information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342641?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 08:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b303521-b974-4ac8-84e1-ec2b4d333750</guid><dc:creator>Emil Lenngren</dc:creator><description>&lt;p&gt;Static passkey with LESC is highly discouraged (&amp;quot;should not be used&amp;quot;) in the Bluetooth Specification. The reason is that the security model is only valid for a new random passkey on every attempt. A passive eavesdropper learns the passkey after a successful attempt (just like legacy pairing). But an active attacker trying to brute force the passkey learns what first bit was wrong and can hence on average crack the passkey in only ten attempts. This is not possible with legacy pairing, which requires up to a million attempts, so if the security goal is to make it possible for only people knowing the passkey to connect, then the legacy model is stronger than LESC. As you can see, static passkey with current BLE security has very bad security compared to real PAKE algorithms. Even for legacy pairing, the Bluetooth standard says static passkeys &amp;quot;should not be used&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342616?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 01:48:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6379acf-7ca2-470d-87ab-ca053dd171e6</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please download &lt;a href="https://drive.google.com/file/d/1fgW3Rg94IAiPfyhoWvPJunpxlmQyuXRu/view?usp=sharing"&gt;this &lt;/a&gt;file.&lt;/p&gt;
&lt;p&gt;IDE: IAR 8.50.9&lt;/p&gt;
&lt;p&gt;Path: examples -&amp;gt; ble_peripheral -&amp;gt; ble_app_uart (pca10040e)&lt;/p&gt;
&lt;p&gt;HW: PCA10040 V1.2.4 2018.44&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342537?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 12:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a4bc7d3-9930-4ec3-8f97-f9e7402ca053</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you able to share the full project so I can try to debug it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342474?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 08:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ef00fc8-ad7b-44a5-8c76-346d1e05b44c</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. In my project, I add&amp;nbsp;#if !PEER_MANAGER_ENABLED and #endif between&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_SEC_PARAMS_REQUEST and&amp;nbsp;BLE_GATTS_EVT_SYS_ATTR_MISSING in main.c. The nRF connect still can&amp;#39;t pop up passkey entry window. I also import these files and modify on ble_app_uart example (PCA10040e). The result is same. Please help to solve it. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/71206.main.c"&gt;devzone.nordicsemi.com/.../71206.main.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/23271.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../23271.sdk_5F00_config.h&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7115.ble_5F00_nus.c"&gt;devzone.nordicsemi.com/.../7115.ble_5F00_nus.c&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342332?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46c1811d-f7d5-4c56-9544-e1d3794c708e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. Please make sure you are not handling the following events in main.c::ble_event_handler():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- BLE_GAP_EVT_SEC_PARAMS_REQUEST&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- BLE_GATTS_EVT_SYS_ATTR_MISSING&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    uint32_t err_code;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GAP_EVT_DISCONNECTED:
            NRF_LOG_INFO(&amp;quot;Disconnected&amp;quot;);
            // LED indication will be changed when advertising starts.
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break;

        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;
#if !PEER_MANAGER_ENABLED
        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break;
#endif // !PEER_MANAGER_ENABLED
        case BLE_GATTC_EVT_TIMEOUT:
            // Disconnect on GATT Client timeout event.
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_TIMEOUT:
            // Disconnect on GATT Server timeout event.
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;

        default:
            // No implementation needed.
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The peer manager is responsible for handling these events when enabled.&lt;/p&gt;
&lt;p&gt;2. Yes. The encryption keys are sent on-air in cleartext when you use legacy pairing. This means that a BT sniffer can fetch the encryption key if it&amp;#39;s listening during key exchange.&lt;/p&gt;
&lt;p&gt;3. Yes, it looks like you have run out of RAM. Maybe you are including the wrong crypto libraries. I suggest you use the ble_app_hrs/pca10040e project as a reference for which crypto related configuration settings and source files to use for this chip variant.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342262?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 08:57:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99e19f83-72e8-4267-a9a2-7b64d4bb61bc</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;There are still few questions about your tips.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;I changed access to SEC_MITM in your yellow remark. After using nRF connect, it can&amp;#39;t access these characteristics directly.&amp;nbsp;Because it doesn&amp;#39;t display passkey entry window. Does it not work in passkey?&lt;pre class="ui-code" data-mode="text"&gt;void gap_params_init(uint8_t *dev_name, uint8_t len)
{
    uint32_t                err_code;
    ble_gap_conn_params_t   gap_conn_params;
    ble_gap_conn_sec_mode_t sec_mode;

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);

    err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode,
                                          dev_name,
                                          len);
    APP_ERROR_CHECK(err_code);

    memset(&amp;amp;gap_conn_params, 0, sizeof(gap_conn_params));

    gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

    err_code = sd_ble_gap_ppcp_set(&amp;amp;gap_conn_params);
    APP_ERROR_CHECK(err_code);
    
    // static passkey
    ble_opt_t ble_opt;
    uint8_t passkey[] = &amp;quot;123456&amp;quot;;

    ble_opt.gap_opt.passkey.p_passkey = passkey;
    err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &amp;amp;ble_opt);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Do you mean&amp;nbsp;when device&amp;nbsp;enables MITM which&amp;nbsp;should&amp;nbsp;also enable&amp;nbsp;&lt;span&gt;crypto&amp;nbsp;function&amp;nbsp;to get full protection?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;I try to import below file to project which source is reference glucose example.&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;add nrf_rng.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2450.PNG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/37650.PNG" /&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/58666.PNG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; But, IDE displays two errors. Does it mean I import wrong file to cause RAM size not enough?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/issue-log.PNG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 passkey entry</title><link>https://devzone.nordicsemi.com/thread/342058?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 12:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:355ba26c-585c-4270-8af3-6e98c531e3e9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You should also increase the security level on your service characteristics to make pairing/bonding required. The NUS service characteristics are set to &amp;quot;SEC_OPEN&amp;quot; by default, which means the client can access them without securing the connecting first.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638794316203v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The security level can be set to &amp;#39;SEC_MITM&amp;#39; when passkey pairing is supported.&lt;/p&gt;
&lt;p&gt;For protection against passive eavesdropping (from a BT sniffer) you should also consider enabling the LESC bit. This require that you integrate the neccessary crypto libraries as in the ble_app_gls example and call the nrf_ble_lesc_request_handler() function from your main loop.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>