How to secure connection via BLE?

Posted on
  • Just reading all named possibilities name in https://www.espruino.com/BLE+Security

    Started testing the NRF.setSecurity() way.

    connect via WebIDE upload this line and disconnect WebIDE and lift battery for a reboot.

    
    onInit = function(){
            NRF.setSecurity({display : 1, keyboard : 1, mitm : 1, passkey : '654321'});
    };
    
    setTimeout(save,1E3);
    

    A connection via WebIDE is still possible, what am I missing.

  • Once the device is paired, it should remember the pairing details - so usually next time you connect from the same computer it'll go right through. That could be it? It's just new computers that need to enter the passkey.

    Or what happens if you try the actual code from that link? NRF.setSecurity({passkey:"123456", mitm:1, display:1});

    keyboard:1 does have a special meaning, and it's possible it is changing how the pairing is expected to work somehow - I think usually in that case you'd get a http://www.espruino.com/Reference#l_Blue­toothDevice_passkeyRequest when trying to connect to another device, but it's possible you get something similar (that isn't handled by Espruino) when another device tries to connect to you.

  • Or what happens if you try the actual code from that link?
    NRF.setSecurity({passkey:"123456", mitm:1, display:1});

    Tried from a different notebook and got a popup to enter the key - so it works like designed.

    Thanks.


    1 Attachment

    • Bildschirmfoto 2021-07-06 um 22.12.01.png
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

How to secure connection via BLE?

Posted by Avatar for MaBe @MaBe

Actions