<?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>Wireshark can&amp;#39;t decrypt data when the connection is LE secure encrypted</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78668/wireshark-can-t-decrypt-data-when-the-connection-is-le-secure-encrypted</link><description>I am using nRF52840-DK as a BLE sniffer. I have set up Wireshark to sniff the packets. Between c entral and Peripheral, there is an authenticated LE secure encrypted BLE connection. 
 The central device scans the peripheral and establishes the connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Aug 2021 14:54:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78668/wireshark-can-t-decrypt-data-when-the-connection-is-le-secure-encrypted" /><item><title>RE: Wireshark can't decrypt data when the connection is LE secure encrypted</title><link>https://devzone.nordicsemi.com/thread/325554?ContentTypeID=1</link><pubDate>Wed, 18 Aug 2021 14:54:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2c16c68-d76d-4fdc-8ccc-6feed922b223</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no direct way to decrypt this data no, since the intention of LE secure connection is that this should not be possible. Not even Ellisys or Fronline can do this.&lt;/p&gt;
&lt;p&gt;Though I was under the impression it should be possible to set a debug key for LE secure connection, and it may be possible that (at least some sniffers will try to use the debug keys to decrypt the communication by default). How to do this depends slightly on whether you are using NCS or nRF5 SDK:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37078/lesc_debug_mode-define-in-ble_app_multirole_lesc-nrf5-sdk-15-0-0"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37078/lesc_debug_mode-define-in-ble_app_multirole_lesc-nrf5-sdk-15-0-0&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_BT_DEBUG_KEYS.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_BT_DEBUG_KEYS.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, if that does not work, then you would to output the LTK from either the peripheral or central (e.g. on UART), and insert the LTK in wireshark. This should be possible it seems from the latest release notes:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE/Download#infotabs"&gt;https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE/Download#infotabs&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Added support for key input for LESC paring and improved key support for legacy pairing.&amp;quot;&lt;/p&gt;
&lt;p&gt;I have not tested this myself, but hopefully the sniffer usage show this done:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/action_bonded.html"&gt;https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/action_bonded.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am never sure if it&amp;#39;s MSB or LSB first, so try both is my suggestion. The LTK can be entered in the input key field as shown in Figure 1 here:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/sniffer_usage.html"&gt;https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/sniffer_usage.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope that works,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>