RAK3172 Encryption / decryption

Firmware v4.0.6
General question.
With 16 byte [same] key loaded into RX and TX. And encryption turned on.
AES128 uses 16 byte blocks.
If the AT+PSEND = is not at 16 bytes even (bigger or smaller, will the encryption firmware load in stuffing bytes and remove them at the RX end?
So that no matter how many bytes are sent, the receiving end will always receive the correct number as transmitted?

Thank you

Hi @frank_r ,

Yes. The encryption shouldn’t have any impact on the actual payload. If you send 1234 as payload, you should be able to receive it as 1234 as well.

This is how it will look like on the RX side.

image

Thanks Carl,

That’s how I thought it should work. I presume it works up to the maximum payload of 250 bytes (500 characters)

I’m curious as to why you enabled the encryption before you entered the 16 byte key. Is this required? Can the key be entered before encryption is enabled?

Frank

Hi @frank_r ,

No. The sequence for encry activation and key doesn’t matter. However, there are sequences that is needed before you can activate some modes of operation. For example, you cannot set encryption if you are in RX mode. These limits will usually return descriptions or AT_BUSY_ERROR. Any issues you can find on your use of encryption, just let us know.