This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to decrypt AES-ECB-Nopadding data?

Hi Team,

Can anyone help me on this?

How to decrypt AES-ECB-Nopadding Encrypted frame?

I am not getting desired output. In fact, I am not getting how to proceed in this case.

Parents Reply Children
  • I read following in the documentation:

    bool nrf_ecb_crypt ( uint8_t * dst, const uint8_t * src )

    Encrypt/decrypt 16-byte data using current key.

    The function avoids unnecessary copying of data if the point to the correct locations in the ECB data structure.

    Parameters dst Result of encryption/decryption. 16 bytes will be written. src Source with 16-byte data to be encrypted/decrypted.

    Return values true If the encryption operation completed. false If the encryption operation did not complete.

    if I set key using " nrf_ecb_set_key" function, provide AES ECB encrypted data in "src", will "nrf_ecb_crypt" function decrypt it in "dst"?

  • I second this question

  • Hi both, I've thought it's crystal clear in provided link but in case it's not: NO, there is no AES decryption function in Nordic SDK (because there is no HW acceleration for it on nRF51 chip). The SDK documentation is confusing when mentioning word "decrypt" but if you go deeper you see that there is actually no way how call this decrypt functionality.

    Cheers Jan

  • So if I call nrf_ecb_crypt ( uint8_t * dst, const uint8_t * src ) with cleantext it will encrypt.

    If I call this function again with the same Key and using the encrypted data, it should return the original cleantext data no?

  • Hi Dave, hitting limit for simple comment so I'm amending my answer above. Please read it. Cheers Jan