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

Enable Encryption

Hi,
I am working on a project to send commands from mobile to device and vice versa.
I am using nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_template.
I have made a custom service and characteristics and made secured like this.

    BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&cus_init.custom_value_char_attr_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&cus_init.custom_value_char_attr_md.write_perm);


Now is there is built-in enabled encryption or I have to enable? If I have to enable can you please guide how can I do that?
My main purpose is to secure my firmware.
Thanks!

Parents Reply
  • Hi Muqarrab, 

    Please describe what exactly you meant by "Secure firmware" or "Secure my firmware". What kind of protection you want to your firmware ? 
    Regarding encrypting data communication, the ble_app_template uses peer manager library so most of the security procedures are handled by the library. 
    When you configure the characteristic with BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(), the central/client will receive a Insufficient Authorization when it tries to read/write to the characteristic. After that the default behavior is that the central will initiate the pairing/bonding process. And the link will be encrypted after that. 
    You don't need to trigger pairing from the server/peripheral side. 

Children
Related