Re: BLE encryption : Which AES 128 decryptor to be used?

Johan Hedberg

Hi Frank,

On 31 Jan 2019, at 16.20, frv <> wrote:

I also see that the encrypted data done with both functions: bt_encrypt_le and AES_ECB_encrypt are not the same.
Any idea?
The “_le” in bt_encrypt_le stands for “little endian”. Most Bluetooth protocols are little endian, which is why this convenience API exists. Generic crypto APIs OTOH are usually big endian, which might be why you’re getting different results. Try to byte-swap before and after, or use bt_encrypt_be() and my guess would be that you get the same results.


Join to automatically receive all group messages.