Display LTK of BLE after pairing

rowman007
Posts: 1
Joined: Wed Dec 15, 2021 1:31 pm

Display LTK of BLE after pairing

Postby rowman007 » Wed Dec 15, 2021 1:49 pm

  1.  
  2. case ESP_GAP_BLE_AUTH_CMPL_EVT: {
  3.  
  4. char str_key[50];
  5. sprintf(str_key, "%x", param->ble_security.auth_cmpl.key)
  6. printf("LTK is %s\n", str_key);
  7.  
  8. .......
  9. }
  10.  

Hello. I would like to decrypt the BLE packet that implements Secure LE Connection. Based on the BLE specs,
I need the LTK(Long term Key) to decrypt the packets. After searching on ESP32 BLE API, I found the struct that holds the LTK.
Kindly see the code for the said struct. I placed the code that displays the LTK on ESP_GAP_BLE_AUTH_CMPL_EVT.

But after flashing the code, the LTK displayed was all zeroes. I would like to ask the way to display the LTK. Thank you.

Who is online

Users browsing this forum: No registered users and 116 guests