Page 1 of 1

the passkez in BLE security

Posted: Fri Aug 24, 2018 3:46 pm
by awaisahmed
Hi all
i am working with esp/idf example "gatt_security_server"

i have got the feature of pass key which is required to access the BLE device. following are mz questions

1. who is generating this passkey ? sometime it is 5 digit sometime 6 ? can i have my own passkey ? for paring the device ?
2, what is exactly happening in encryption of BLE ? SMP ?
3, to see the passkey i always need to monitor my device which is not good option for all the time. it is possible to define the passkey once for parring ?

thanks

Re: the passkez in BLE security

Posted: Sat Aug 25, 2018 5:16 pm
by chegewara
1. SMP stack (usually on server) is generating passkey; when i studied bt specs some time ago ive read it should be 6 digit passkey, but it seems to be 5-6 digits; when server is keypad only and client device is display then client device SMP is generating passkey; but to be honest im not 100% certain
3. https://esp32.com/viewtopic.php?f=13&t=6877

or you can use bonding/pairing without passkey and during pairing add device to whitelisted, finally you can allow to connect only whitelisted devices. For example you will need just one gpio/button, when its high on esp32 startup then you will allow to connect and pair new device and when its low - connect only whitelisted.

Re: the passkez in BLE security

Posted: Mon May 06, 2019 1:12 pm
by bpfeiffer
chegewara wrote: or you can use bonding/pairing without passkey and during pairing add device to whitelisted, finally you can allow to connect only whitelisted devices. For example you will need just one gpio/button, when its high on esp32 startup then you will allow to connect and pair new device and when its low - connect only whitelisted.
Hi chegewara,

do you have an example for this? I'm trying something similar like this but on arduino platform.

greetz