BLE Characteristic Encryption

sankharay
Posts: 4
Joined: Wed Oct 24, 2018 7:02 am

BLE Characteristic Encryption

Postby sankharay » Fri Feb 08, 2019 8:55 am

Hi,

we are trying to encrypt BLE characteristic in esp32 platform which works like a peripheral.
Passing ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED in esp_ble_gatts_add_char.
Before this Pairing and bonding is happening.
How to test that characteristic data is getting encrypted?
Please let us know the way to check this.

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: BLE Characteristic Encryption

Postby chegewara » Tue Feb 12, 2019 9:00 am

Hi,
when you are using ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED flags in characteristics permissions then, as you could see, at least pairing needs to be performed. In case encrypted connection cant be established you will be disconnected with GATT_INSUF_AUTHENTICATION error.

Remember to protect descriptors with ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED too.
ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED does not protect against MITM attack.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 201 guests