This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Tutorial on Connection Encryption

Hello,

I have not found a lot of information on connection encryption. I want to use a preprogrammed Long Term Key in my mesh that is then used to establish subsequent connections. How would I start with this?

And very important: i can not use the device manager. (partly because it does not support peripheral and central at the same time and partly because I think it is too big for what I need it.)

The message sequence charts did not help me much and I have not found any example that explains security in detail. Neither did I find a tutorial or anything else. Where do I start?

Marius

Parents
  • Hello,

    Thanks, I'll read your response in detail tomorrow. In the meantime I've just managed to get something running. Here's what I do:

     - Central and Peripheral connect and start an unencrypted connection.
     - The Central calls sd_ble_gap_encrypt with an ediv(keyid?) of 0 and an 8 byte random number
     - The Peripheral receives the BLE_GAP_EVT_SEC_INFO_REQUEST and calls sd_ble_gap_sec_info_reply with its key (which is the same)
     - Both sides receive the BLE_GAP_EVT_CONN_SEC_UPDATE
    

    I've set the auth property of both keys to 1.

    Now, did I encrypt this connection successfully?

    (I've also implemented the method with the events and functions that you've mentioned but there were quite a few parameters in there that I was just guessing, so I tested this method instead)

    As for the tutorial, it would be nice to have an explanation of most of the parameters, the API documentation is not extensive enough. Most of that stuff is documented somewhere in the BLE spec, but it would be nice if you could provide references for how the procedures as a whole work. Just link to some other online resources.

Reply
  • Hello,

    Thanks, I'll read your response in detail tomorrow. In the meantime I've just managed to get something running. Here's what I do:

     - Central and Peripheral connect and start an unencrypted connection.
     - The Central calls sd_ble_gap_encrypt with an ediv(keyid?) of 0 and an 8 byte random number
     - The Peripheral receives the BLE_GAP_EVT_SEC_INFO_REQUEST and calls sd_ble_gap_sec_info_reply with its key (which is the same)
     - Both sides receive the BLE_GAP_EVT_CONN_SEC_UPDATE
    

    I've set the auth property of both keys to 1.

    Now, did I encrypt this connection successfully?

    (I've also implemented the method with the events and functions that you've mentioned but there were quite a few parameters in there that I was just guessing, so I tested this method instead)

    As for the tutorial, it would be nice to have an explanation of most of the parameters, the API documentation is not extensive enough. Most of that stuff is documented somewhere in the BLE spec, but it would be nice if you could provide references for how the procedures as a whole work. Just link to some other online resources.

Children
Related