This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Typo in documentation? ECB peripheral doesn't decrypt?

For the nRF51822, the documentation for ECB mentions it being used to

Encrypt/decrypt 16-byte data using current key.

But it doesn't offer any methods to decrypt, and a couple of other forums posts indicate that it only performs the forward AES transform, and there is no facility to decrypt. Just wanted to double check to make sure I'm not doing things the difficult way if I need AES decryption for my application level functionality.

devzone.nordicsemi.com/.../group__nrf__ecb.html

Thanks, Eric

Parents
  • Hi,

    Yes that's type, HW "accelerated" AES encryption on nRF51 doesn't implement inverse decryption function. This is because Bluetooth doesn't need it (it uses CRT mode where AES encrypt function is combined with XOR stream cypher to perform both encrypt and decrypt) so there was no need to have it in HW. Indeed it makes it harder for application developers if they need it but the workarounds are easy: either use some modern methods such as AES-CRT which don't need it or implement it in SW (few hundred bytes in resulting binary if you know what you are doing...) There are numerous Q&As on this forum about this as well as nice blog post.

    Cheers Jan

Reply
  • Hi,

    Yes that's type, HW "accelerated" AES encryption on nRF51 doesn't implement inverse decryption function. This is because Bluetooth doesn't need it (it uses CRT mode where AES encrypt function is combined with XOR stream cypher to perform both encrypt and decrypt) so there was no need to have it in HW. Indeed it makes it harder for application developers if they need it but the workarounds are easy: either use some modern methods such as AES-CRT which don't need it or implement it in SW (few hundred bytes in resulting binary if you know what you are doing...) There are numerous Q&As on this forum about this as well as nice blog post.

    Cheers Jan

Children
Related