Skip to main content
Associate II
Jul 14, 2025 5:42 AM UTC
Question

How to Get LTK (Long Term Key)

I am currently considering capturing and analyzing LE-Audio packets, but for that I need the LTK used for decryption.BLE Secure Connection pairing does not directly exchange LTK, so I do not know what it is, and I am having trouble.

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

-------------------------------------------------------------------------------------------------------------

[Srouce]

https://github.com/STMicroelectronics/STM32CubeWBA.git

[Project]

Projects\STM32WBA55G-DK1\Applications\BLE\BLE_Audio_TMAP_Peripheral

Projects\STM32WBA55G-DK1\Applications\BLE\BLE_Audio_TMAP_Central

This topic has been closed for replies.

2 replies

ST Employee
Jul 14, 2025 9:25 PM UTC

Hi All,

 

This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

 

Regards,
Jake

ST Support

ST Employee
Jul 15, 2025 10:31 AM UTC

Hello Jetson,

 

My first proposal is to 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,

Théo