Hello everybody, I am using Zephyr with the nrf52840-dk device. I would like to store the DTLS credentials with a secure way. I don't want to be part of the code and thus to be written raw in flash. Any proposals?
Hello everybody, I am using Zephyr with the nrf52840-dk device. I would like to store the DTLS credentials with a secure way. I don't want to be part of the code and thus to be written raw in flash. Any proposals?
Thank you for the detailed answer again. I understood. Therefore, the derived key will be always the some given the same root key? How can I create the root and thus the derived key? (any examples). Finally, the bootloader is it secure in order to handle all this process? (e.g MCUboot)
Hi,
Nikos Karamolegkos said:Therefore, the derived key will be always the some given the same root key?
Yes, that is correct.
Nikos Karamolegkos said:How can I create the root and thus the derived key?
How to create the key is up to you. You could create it on the nRF using the CC310 RND during production. Then load that key into CC310 and derive a key, which you use to encrypt your secret data. As mentioned you must keep the root key in normal flash and should protect it early during boot to prevent application code from reading it.,
There are currently no code examples for this, but the functionality you need was introduced in NCS 1.4. Specifically:
nrf_cc3xx_platform_kdr_load_key()
to load the root key in CC310 at every boot.mbedtls_shadow_key_derive()
to obtain the derived key that you use to encrypt/decrypt the data
Nikos Karamolegkos said:Finally, the bootloader is it secure in order to handle all this process? (e.g MCUboot)
You could use an tiny immutable bootloader that runs before MCUBoot to handle this (this example immutable bootloader does not do this, but you can use it and add this part). That is the same approach that is used in secure boot. Then you can keep the key in the bootloader page. This B0 bootloader would then essentially do nothing other than loading the KDR key to CC310, preventing read access to itself and starting MCUBoot.
Nice, therefore after statring the MCUboot using mbedtls_shadow_key_derive
I can take the derived key and decrypt the DTLS credentials. Correct? Also, I assume that I can do the same procedure from to derive the key from the APP partition in order to use the dtls credentials from this section. Is that true?
Yes, that is correct.
Hello, again. One more question. This scheme is secure because nobody knows the root key so he can not do the same procedure in order to find the derived key. Correct?