<?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>How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30532/how-to-acquire-mesh-keys-api</link><description>I would like to use a Bluetooth protocol analyzer for sniffing traffic in my Mesh network. I need to input the devkey(s), netkey, and appkey to the protocol analyzer software so it can decode the mesh messages. What is the best way to acquire the keys</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Feb 2018 20:37:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30532/how-to-acquire-mesh-keys-api" /><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121737?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 20:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b1cf5d8-1646-4a41-a229-96b761538e59</guid><dc:creator>leonwj</dc:creator><description>&lt;p&gt;Thanks Dash... It would be interesting to get your&amp;nbsp;initial take on the product if you ever get the time. We attended a webinar on its features a few months ago when it was a work-in-progress just so we could gauge how it went about decoding mesh messages etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121650?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 12:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4a4bebd-7a39-405a-b261-85f476d74b66</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;There is no API for the root key, so if you need that one you will have to add that functionality yourself.&lt;/p&gt;
&lt;p&gt;Yes, derivation of the keys is deterministic. All encryption functions are described in chapter &lt;em&gt;3.8.2 Security toolbox&lt;/em&gt; of the Bluetooth Mesh specification, and the keys are described in details in chapter &lt;em&gt;3.8.6 Keys&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The encryption functions are part of internal mesh APIs which are not documented on Infocenter, but the source is part of the mesh SDK. (You find them in mesh/core/include/enc.h and mesh/core/src/enc.c.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121574?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 18:16:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c859395d-6523-46ec-9407-d9e0d07d9994</guid><dc:creator>Dash</dc:creator><description>&lt;p&gt;The call&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v1.0.1%2Fgroup__DEVICE__STATE__MANAGER.html&amp;amp;anchor=ga0d29faacbe714f9a75d42aa500abc3d2"&gt;dsm_net_secmat_from_keyindex_get()&lt;/a&gt;&amp;nbsp;returns a structure that has two keys in it (encryption and privacy). According to bluetooth.com&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;quot;&lt;span&gt;All nodes in a Bluetooth mesh network possess one or more&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.bluetooth.com/what-is-bluetooth-technology/how-it-works/le-mesh/mesh-glossary#security_keys" rel="noopener noreferrer" target="_blank"&gt;Network Keys&lt;/a&gt;&lt;span&gt;&amp;nbsp;(NetKey), each corresponding to a subnet which may be the primary subnet. It&amp;rsquo;s possession of a network key which makes a node a member of the network. Network Encryption Keys and Privacy Keys are derived directly from the NetKey.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We are using the Sodera Frontline which looks like it wants the root netkey in its INI file. Is there a way to get the&amp;nbsp;root net key that&amp;nbsp;the Network Encryption Keys and Privacy Keys are derived from?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is the derivation of the&amp;nbsp;Network Encryption Keys and Privacy Keys standardized where anyone with the root netkey will always be able to derive the same&amp;nbsp;Network Encryption Keys and Privacy Keys?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121568?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 17:43:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df95d457-8ee6-4c06-bf1f-8d5ec66092c4</guid><dc:creator>Dash</dc:creator><description>&lt;p&gt;We are using the Sodera/Frontline&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121557?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 15:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ccf7642-f50a-4f3b-b578-259efc8eb682</guid><dc:creator>leonwj</dc:creator><description>&lt;p&gt;Thanks tesc,&lt;/p&gt;
&lt;p&gt;I somehow completely missed the&amp;nbsp;dsm_devkey_handle_get() API function call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121506?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 11:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5b39235-12f0-44e2-8491-504d853f3f87</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Yes. The DevKey is stored with the AppKeys.&lt;/p&gt;
&lt;p&gt;You can use &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v1.0.1%2Fgroup__DEVICE__STATE__MANAGER__DEV__KEYS.html&amp;amp;anchor=ga574563994d88a55a66b3a1bc9c0b04bd"&gt;dsm_devkey_handle_get()&lt;/a&gt; for getting the handle, then fetch the DevKey using &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v1.0.1%2Fgroup__DEVICE__STATE__MANAGER.html&amp;amp;anchor=ga1cce1d07fa5ca409ac9075bf8c1bf6b0"&gt;dsm_tx_secmat_get()&lt;/a&gt;. No need to traverse on your own.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121438?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 18:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0038cd9-722e-49a8-8190-0bffc8436750</guid><dc:creator>leonwj</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;My understanding is that the devkey (device key) is simply a special form of appkey (application key) known only between&amp;nbsp;each specific node and the provisioner.&lt;/p&gt;
&lt;p&gt;I believe that the&amp;nbsp;&lt;em&gt;nrf_mesh_application_secmat_t&lt;/em&gt; struct has a &lt;em&gt;boolean&lt;/em&gt; indicating whether the stored key in that index is an appkey or devkey. So traversing through should yield the correct devkey (either on the node and/or provisioner)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Application security material structure.
 *
 * This structure is required for the encryption of the application data.
 *
 * @note This is intended to be managed by the device_state_manager.c, and the setters and getters
 * in that module should be used and no direct accesses should be made to this structure.
 */
typedef struct
{
    /** Indicates whether the device key or the application is used. */
    bool is_device_key;
    /** Application ID. Calculated and used internally. */
    uint8_t aid;
    /** Application or device key storage. */
    uint8_t key[NRF_MESH_KEY_SIZE];
} nrf_mesh_application_secmat_t;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Notwithstanding the above,&amp;nbsp;it would be good for confirmation of this from Nordic to ascertain whether there is/they plan a direct API to obtain the devkey.&lt;/p&gt;
&lt;p&gt;(&lt;em&gt;Also, as a matter of interest, do you mind mentioning which Bluetooth protocol analyzer you are using, we&amp;#39;re looking at one from Sodera/Frontline but haven&amp;#39;t decided as yet, Thanks in advance&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121434?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 16:51:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee90636a-ec82-4335-87e2-ba9ea5c921ac</guid><dc:creator>Dash</dc:creator><description>&lt;p&gt;The calls provided above get the netkey and appkey. The protocol analyzer also needs the devkey. I have found calls to get the devkey &lt;em&gt;handle&lt;/em&gt; but nothing for the actual devkey. Please let me know how I can obtain the devkey.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to acquire Mesh keys API</title><link>https://devzone.nordicsemi.com/thread/121229?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 11:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3df5abc-224c-47fb-afb4-8b5d75c3b06d</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Keys are stored by the Device State Manager, and can be read using the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v1.0.1%2Fgroup__DEVICE__STATE__MANAGER.html&amp;amp;anchor=ga1cce1d07fa5ca409ac9075bf8c1bf6b0"&gt;dsm_tx_secmat_get()&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v1.0.1%2Fgroup__DEVICE__STATE__MANAGER.html&amp;amp;anchor=ga0d29faacbe714f9a75d42aa500abc3d2"&gt;dsm_net_secmat_from_keyindex_get()&lt;/a&gt; API calls.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>