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

nRF52 data Encryption

Hello Nordic team

I am working on nRF52832 dev board and I have a requirements to encrypt and decrypt data using AES-128 ECB. Could you please provide the example code or documentation how to encrypt and decrypt the data?

Any help will be appreciated.

Thanks

Raj

Parents Reply
  • Thanks for the reply. This make sense to me. Can I use following APIs for encryption and decryption:

    nonce_generate(nonce);
    ctr_init(nonce,m_ecb_key);

    ctr_encrypt(m_beacon_info);
    ctr_encrypt(&m_beacon_info[16]);

    /******************************************/

    ctr_decrypt(m_beacon_info);
    ctr_decrypt(&m_beacon_info[16]);

    As this is working and I tested. But this is just encrypting 16 bytes and I have to encrypt 20 bytes of data. Can I pass 32 bytes of KEY and encrypt 20 bytes and ignore rest of the bytes?

Children
Related