Encryption on nRF52840 with CircuitPython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
smoothy
 
Posts: 4
Joined: Tue Mar 01, 2022 10:56 pm

Encryption on nRF52840 with CircuitPython

Post by smoothy »

Using a BLE characteristic on a CircuitPython peripheral with

Code: Select all

read_perm = Attribute.ENCRYPT_WITH_MITM, 
https://docs.circuitpython.org/projects ... _WITH_MITM

Reading that characteristic from the nRF Connect app after pairing, gives the following error
Error 137 (0x89): GATT AUTH FAIL
The nRF52840 has encryption hardware which I assume CircuitPython enables. Are there additional steps my code should take to make this encrypted characteristic work? Is there additional documentation or source code on using encrypted characteristics in CircuitPython?

Additional info:
  • The peripheral's code calls pair() on elements of ble.connections which results in a prompt to pair and bonding on the nRF Connect app
  • Everything works with Attribute.OPEN
  • The nRF Connect app is just for development, ultimately another CircuitPython device will act as the BLE controller

User avatar
smoothy
 
Posts: 4
Joined: Tue Mar 01, 2022 10:56 pm

Re: Encryption on nRF52840 with CircuitPython

Post by smoothy »

Is there a way to set a passkey, PIN or Out-of-Band data in adafruit_ble?

Encryption without MITM protection works on the nRF52840, but MITM protection requires a shared passkey or Out-of-Band data. How can this be configured in CircuitPython?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Encryption on nRF52840 with CircuitPython

Post by adafruit_support_mike »

[moved to the CircuitPython forum]

User avatar
danhalbert
 
Posts: 4687
Joined: Tue Aug 08, 2017 12:37 pm

Re: Encryption on nRF52840 with CircuitPython

Post by danhalbert »

We have not implemented this yet. We just have regular bonding/pairing, sorry.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”