Digi had just released the new BLE firmware for their new Xbee3 line. Nicest thing is, the BLE module has a +19dbm output which is a pretty good range. So I was thinking it would be ideal for what I do.
I was going to use the module in my App, but there is a problem. Digi has decided to make authentication to the module required in order to send/receive data to and from it. The authentication might as well be built like fort knox as its way above my level of understanding mathematics.
They call it the "BLE Unlock Frame 0x2C. The problem for me isnt the frame, I have worked with Digi Zigbee frames before. The trouble is the authentication math as outlined here:
https://www.digi.com/resources/documentation/digidocs/pdfs/90001539.pdf
So for me, this might as well be NASA level. I looked at the example python and C code shown in the documentation but I have no idea how to convert that into B4A code.
But not only does this have to take place, the derived "session key" has to be used to encrypt all traffic to and from the module, no matter what it is. Yikes! From the little I understand of what is going on here, almost feels like SSL or TLS over BLE. I remember hearing about SRP before but I cant remember where.
So I was wondering if someone could tackle this, or maybe even already has an implementation for B4A?
I was going to use the module in my App, but there is a problem. Digi has decided to make authentication to the module required in order to send/receive data to and from it. The authentication might as well be built like fort knox as its way above my level of understanding mathematics.
They call it the "BLE Unlock Frame 0x2C. The problem for me isnt the frame, I have worked with Digi Zigbee frames before. The trouble is the authentication math as outlined here:
https://www.digi.com/resources/documentation/digidocs/pdfs/90001539.pdf
The unlock process is an implementation of the SRP (Secure Remote Password) algorithm using the RFC5054 1024-bit group and the SHA-256 hash algorithm . The value of I is fixed to the username apiservice.
Upon completion, each side will have derived a shared session key which is used to communicate in an encrypted fashion with the peer. Additionally, a Modem Status frame - 0x8A with the status code 0x32 (Bluetooth Connected) is sent through the UART (if AP = 1 or 2). When an unlocked connection is terminated, a Modem Status frame with the status code 0x33 (Bluetooth Disconnected) is sent through the UART.
The following implementations are known to work with the BLE SRP implementation: n github.com/cncfanatics/SRP You need to modify the hashing algorithm to SAH256 and the values of N and g to use the RFC5054 1024-bit group. n github.com/cocagne/csrp n github.com/cocagne/pysrp
So for me, this might as well be NASA level. I looked at the example python and C code shown in the documentation but I have no idea how to convert that into B4A code.
But not only does this have to take place, the derived "session key" has to be used to encrypt all traffic to and from the module, no matter what it is. Yikes! From the little I understand of what is going on here, almost feels like SSL or TLS over BLE. I remember hearing about SRP before but I cant remember where.
So I was wondering if someone could tackle this, or maybe even already has an implementation for B4A?
Last edited: