BLE data transfer use AES/CCM encryption and unencryption

Hi,

      I development a elock device to use nordic 52832 chip. I want to transfer some information between phone app and my device. Like UUID / user account / user password.

for against BLE sniffer, we need use AES method to protect our information.

Can I follow  \examples\crypto\nrf_cc310\aes example to do it? Or any suggest for us? Our data transfer flow as below

 - phone app sent unlock command to our device

 - our device sent a random number to phone app

 - phone app response

- our device check response to unlock

Thank you.

John.

Parents
  • Why do you not just rely on the security features of BLE? When you use LE Secure Connections with some kind of MITM prevention, then the connection uses AES/CCM. Just make sure, that your lock makes sure, the connection is actually encrypted with a key that was obtained by the proper pairing.

  • Hi Robitzki,

           You mean I just need to enable MITM protected.

    1. My All data should encrypted by AES.

    2. Phone app can get a key from device when pairing boths.

    3. Is MITM a standard function on BLE?

    Do you have any example that can refer it?  which Nordic SDK version can support it?  

    Also, we don't want the user to have to enter the passkey by phone. In fact the user doesn't need to pick up the phone to unlock my device(Like auto lock and unlock)

    Thank you.

    John.

  • Hi John,

     
    What exactly you are trying to achieve here ? 


    It's not possible to customize the Bluetooth pairing on the phone. It's handled by the system. 
    So what you can do is to make the app that can scan for the QR code and after scanning QR code it can tell the end user on the phone which passkey they should enter. 

  • Hi Hung,

        Is it possible to increase security by hiding the passkey on the QR code that only each buyer has? If you are not real buyer, you don't know what are you going to enter during exchange passkey step.

    Thank you.

    John

  • Hi John, 

    I'm not really sure what you are asking about. 


    If you are not real buyer you can't bond your phone to the lock. The lock will not allow any phone to bond to the device. Bonding is only allowed on the first time setting it up. 

  • Hi Hung,

            Sorry for causing your doubts,but i see what you mean.

    Other question is

    If I have already bounded and set up encryption and whitelist with Phone A. What should I do if I change or lost my phone A? Can I store LTK in SERVER? When the user enters the account and password on my APP. I can download LTK from server to phone.

    Thank you.

    John.,

  • Hi John, 

    On most phones you wouldn't be able to download a LTK and the ask the phone to update the bond with the new LTK. 

    So in this case when the user loses their phone, it's a security procedure that you need to define on your own. It's the same with what happen when one loses their key. 
    Be very careful when defining those protocol to recover the key. We are not expert in this topic so you may want to do some study or get help from expert in security. 

    Usually if you have a secondary way of unlocking the device, then it's easier. For example keypad or NFC tag. You can use the second way to unlock the device, and then can clear the bond information, set the device to bonding mode to allow new bonding. 

    If you don't have any secondary way then you would need to allow advertise with no white list. Allowing any device to connect to . Then in this case you would need another level of security on top of Bluetooth pairing.  You then can apply the feature suggested by Daniel in his blog.  The new device need to pass this security level to unlock.  

    You can have a key inside the lock and the phone can access the cloud to get the same key of the same log (scan QR code or login to user account etc). 

Reply
  • Hi John, 

    On most phones you wouldn't be able to download a LTK and the ask the phone to update the bond with the new LTK. 

    So in this case when the user loses their phone, it's a security procedure that you need to define on your own. It's the same with what happen when one loses their key. 
    Be very careful when defining those protocol to recover the key. We are not expert in this topic so you may want to do some study or get help from expert in security. 

    Usually if you have a secondary way of unlocking the device, then it's easier. For example keypad or NFC tag. You can use the second way to unlock the device, and then can clear the bond information, set the device to bonding mode to allow new bonding. 

    If you don't have any secondary way then you would need to allow advertise with no white list. Allowing any device to connect to . Then in this case you would need another level of security on top of Bluetooth pairing.  You then can apply the feature suggested by Daniel in his blog.  The new device need to pass this security level to unlock.  

    You can have a key inside the lock and the phone can access the cloud to get the same key of the same log (scan QR code or login to user account etc). 

Children
  • Hi Hung,

            I fully understand what you mean. After these questions I also know how I should design my system. Thank you very much. I need your help if I have any questions in the future.

    John.

  • Hi Hung,

        After our deeper research, now there is a question

    If I already used passkey to connected between my phone and my bike。My transmission is encrypted。

    If I lend my bike to my friend,Is he able to establish other passkey secure connection? Because my bike device already has my Key,Can there be two sets of keys? or the first one will be cleared?

    Thank you.

    John.

  • Hi John, 

    When you say passkey, is it the bluetooth bonding passkey ? 

    You can have bond with two different phones. You don't need to clear the first set of bond information.

    But the question is how you enable a new phone to connect and control the bike. It's more about security question. It's similar to what I wrote in the last reply. You need to have a way of allowing a new bond. Either by using your phone that already bonded and give a command to allow a new bond. Or by using for example a physical NFC key to allow adding a new bond. 

  • Hi Hung,

    When you say passkey, is it the bluetooth bonding passkey ?   Yes

          Our current thinking as below.

    1. The device enter into pairing mode

    2. The device show passkey on display when phone A want to pair the device

    3. Enter the passkey by keyboard on Phone A. The phone A bonded the device.

    4. Make the device enter pairing mode again through a method

    5. The device show passkey on display when phone B want to pair the device

    6. Enter the passkey by keyboard on Phone B. The phone B bonded the device.

    7. User can use phone A or Phone B to lock or unlock device.

    Because a bike may be used by two people. Can two Keys be able to unlock or lock this bike?

    Thank you.

    John.

  • Hi John, 


    Then how can you avoid an attacker to steal the bike ? 

    After you bonded the first phone A.

    Then an attacker with a phone C come and bond to the device, how do you avoid it being stolen by attacker with phone C ? 

Related