I am developing a React Native app (Javascript) that connects to an XBee3 over Bluetooth. I have successfully authenticated using SRP and now I need to send an AT Command request.
First: I assume that I encrypt the entire frame (including start byte and checksum). Is that correct?
Second: I have the Tx nonce value and I'm trying to understand the correct way to use it in the AES CTR mode encryptor. My current understanding is that it's a 16-length byte array where the first 12 bytes are the nonce and the remaining 4 bytes are the zero-padded integer, i.e.
Nonce (12 bytes) Counter (4 bytes)
3b cf 74 55 d4 37 27 6c 0e 13 ce 60 00 00 00 01
Is this correct?