SDK:nRF5 SDK 15.3.0
SoftDevice:s132_nrf52_6.1.1
SDK:nRF5 SDK 15.3.0
SoftDevice:s132_nrf52_6.1.1
I don't know why you want this; it is explicitly discouraged by the specification, since you can brute force it in 20 attempts, see https://insinuator.net/2021/10/change-your-ble-passkey-like-you-change-your-underwear/ for an explanation. The protocol is only designed for and secure if a new randomly generated key is used for each new attempt.
I don't know why you want this; it is explicitly discouraged by the specification, since you can brute force it in 20 attempts, see https://insinuator.net/2021/10/change-your-ble-passkey-like-you-change-your-underwear/ for an explanation. The protocol is only designed for and secure if a new randomly generated key is used for each new attempt.
ble_gap_sec_params_t and what values should be set?sd_ble_gap_sec_params_reply() during the BLE_GAP_EVT_SEC_PARAMS_REQUEST event?Hi,
If what you want is a serial number, then it would be better to either use the device address or let the device advertise with its serial number using manufacturer specific data in the advertising packet. That way you would find the device (based on the serial number) before you connect to it. With using passkey for this, you will have to connect first, then figure out whether or not you are connected to the correct device.
Regards,
Terje
Thank you for your response.
We will refer to the information you provided regarding the concept of passkey and serial number.
As for the fixed passkey, we were able to implement it as follows, so we will close this inquiry:
1.Set the passkey at startup using sd_ble_opt_set.
2.When the BLE_GAP_EVT_SEC_PARAMS_REQUEST event occurs, respond with the following parameters using sd_ble_gap_sec_params_reply:
ble_gap_sec_params_t sec_param;
sec_param.bond = 0;
sec_param.mitm = 1;
sec_param.lesc = 0;
sec_param.keypress = 0;
sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
sec_param.oob = 0;
sec_param.min_key_size = 7;
sec_param.max_key_size = 16;