<?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>Generating my own LTK/EDIV/RAND</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12188/generating-my-own-ltk-ediv-rand</link><description>Is there a hook anywhere in the SD (130/132) to let me generate my own LTKs, EDIV and RAND during the bonding process? I don&amp;#39;t think so, I&amp;#39;ve not found one, but perhaps I missed it. 
 I wanted to move to a security model which uses one private on-device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Feb 2016 12:46:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12188/generating-my-own-ltk-ediv-rand" /><item><title>RE: Generating my own LTK/EDIV/RAND</title><link>https://devzone.nordicsemi.com/thread/46124?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 12:46:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86816acf-f8e7-465c-82f4-b7d1720f8f4e</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Thanks - not a critical thing for me - it was a nice-to-have for a particular use case where it looks like a peripheral would end up with a lot of bonds to it, all of which I&amp;#39;d prefer to remember. Mostly because iOS does a cruddy bad job of dealing sanely with devices which have lost their bond information (or thrown it away), it just quietly fails, doesn&amp;#39;t ask if you want to re-bond, doesn&amp;#39;t even consider that perhaps you might want to re-bond and you have to go to settings and remove the device by hand. This would have been a good scheme for storing a huge number of bonds without actually storing a huge number of bonds.&lt;/p&gt;
&lt;p&gt;But you have plenty else more useful to work on that odd use cases like this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating my own LTK/EDIV/RAND</title><link>https://devzone.nordicsemi.com/thread/46123?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 12:17:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:516c2490-aa06-42b0-bd13-4a757b64afad</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;We actually used to do something like this in the older variants of S110, but the potential for collisions became such a big problem that we changed it. The SoftDevice would combine the ediv and rand into a diversifier, then encrypt it with a device-specific secret to get the LTK. On the s13x, the LTK is always set by the device, and cannot be overridden. If you feel that this is a must-have, then please contact the closes sales representative so we get the correct idea about interest. We already allow you to change IRK with an options API, so it&amp;#39;s not impossible that something like this could go into the same API - given interest.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating my own LTK/EDIV/RAND</title><link>https://devzone.nordicsemi.com/thread/46122?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 11:46:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8563657a-c91d-41e9-978b-7c2486c01f2d</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;unfortunately the central is an iOS device and I don&amp;#39;t get to control how it starts encryption so I don&amp;#39;t get to choose the EDIV and RAND it sends, it will only send back what was given to it from the original bonding with the peripheral. To do that I&amp;#39;d need to force the ediv/rand/ltk which the central received at the point it originally bonded so it sends me back them later.&lt;/p&gt;
&lt;p&gt;I got the idea from reading the BTLE spec actually, it envisages a peripheral with just a DSK on it which it can use to generate EDIVs and then reconstruct the DIV it used to then reconstruct the LTK.&lt;/p&gt;
&lt;p&gt;I agree if I had both sides of this, it would be easy. It&amp;#39;s ok I didn&amp;#39;t think it was possible, it would have been handy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating my own LTK/EDIV/RAND</title><link>https://devzone.nordicsemi.com/thread/46121?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 11:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:610a79ce-701c-462c-8cf6-cea6888b4c13</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not possible to override those yourself in the way you ask, but you shouldn&amp;#39;t need to. If you have the means to generate the LTK based on some EDIV and RAND, you do not need to bond at all. On the central side, simply call &lt;code&gt;sd_ble_gap_encrypt&lt;/code&gt; with the custom EDIV, RAND and LTK fields filled into the arguments. On the peripheral side, fetch the &lt;code&gt;BLE_GAP_EVT_SEC_INFO_REQUEST&lt;/code&gt; event, recalculate the custom LTK based on the EDIV/RAND in the event, then fill in the datatypes for the &lt;code&gt;sd_ble_gap_sec_info_reply&lt;/code&gt; call with the LTK.&lt;/p&gt;
&lt;p&gt;If the peer device is not one of your special devices, it should signal that it doesn&amp;#39;t have a bond, and you can then choose to bond normally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>