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

Protect Peer Manager encryption keys from DFU

I have an application that bonds to mobile devices and encrypts the connection on both Android and iOS. What I am noticing though, is that after each time I use the DFU to update the application, all the encryption keys are lost.

On Android, this isn't an issue since the phone will immediately just reinitialize the encryption and new keys are exchanged. On iOS however, the phone will aggressively reconnect to the application and ignore any attempt to reinitialize encryption for a period of time. This is not a good situation since I also utilize the ANCS which requires an encrypted link.

The best solution for the integrity of the application as well as for the benefit of the users is that the keys are protected from being removed during an application update via DFU.

Is there a good method for protecting those keys?

This applications is running S132 v2 on an nRF52 and is built with Eclipse and GCC

Cheers!

Parents
  • Using the "fds" module which again utilizes the "fstorage" module in the nRF5 SDK (from version 11) you can store data in flash.

    Once this data is stored in flash you need to ensure that the bootloader does not use/erase/overwrite the flash pages where you have stored the encryption keys when performing a DFU.

    As far as I can remember you can do this by modifying the file "pstorage_platform.h" to not use the same address space as the "fstorage" module.

Reply
  • Using the "fds" module which again utilizes the "fstorage" module in the nRF5 SDK (from version 11) you can store data in flash.

    Once this data is stored in flash you need to ensure that the bootloader does not use/erase/overwrite the flash pages where you have stored the encryption keys when performing a DFU.

    As far as I can remember you can do this by modifying the file "pstorage_platform.h" to not use the same address space as the "fstorage" module.

Children
No Data
Related