cancel
Showing results for 
Search instead for 
Did you mean: 

How to get LTK

Henry_BLE
Associate II

Hello community, 
I am currently considering capturing and analyzing BLE packets by using BLE sniffer, but for that I need the LTK used for decryption.BLE Secure Connection pairing does not directly exchange LTK, so I do not know where to find it exactly in BLE Stack.

Could you please tell me how to output an LTK log by modifying the user source code?
-------------------------------------------------------------------------------------------------------------------

[Srouce]

STM32CubeWBA/Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_SerialCom_Peripheral at main · STMicroelectronics/STM32CubeWBA

 

1 ACCEPTED SOLUTION

Accepted Solutions
CorentinS
ST Employee

Hello,

You can use debug keys that are known by sniffer tools. For that, you can add at the end of Ble_Hci_Gap_Gatt_Init() function:

uint8_t a_sc_key_type[1];
a_sc_key_type[0] = 1;
aci_hal_write_config_data(CONFIG_DATA_SC_KEY_TYPE_OFFSET,1,a_sc_key_type);

Best Regards,

Corentin

View solution in original post

1 REPLY 1
CorentinS
ST Employee

Hello,

You can use debug keys that are known by sniffer tools. For that, you can add at the end of Ble_Hci_Gap_Gatt_Init() function:

uint8_t a_sc_key_type[1];
a_sc_key_type[0] = 1;
aci_hal_write_config_data(CONFIG_DATA_SC_KEY_TYPE_OFFSET,1,a_sc_key_type);

Best Regards,

Corentin