Environment:
- nRF Connect SDK 2.1.0
- nRF5340DK (build config: nrf5340dk_nrf5340_cpuapp)
We are implementing asymmetric security for a connected device using the nRF5340 and are looking to determine the best approach for storing the device’s own private identity key.
The intention is to have the device generate its own random key internally during initial provisioning.
We need to protect the key from exposure/extraction including by parties with physical access. Ideally not relying only on APPROTECT.
These are the approaches we have identified so far:
1. PSA Key Storage API using NVS backend.
This stores private key unencrypted in flash with ASCII header ‘PSA KEY’, which is not ideal.
Possible work-around to use encrypted internal trusted storage (requires TF-M / build with _ns config) [thread] – not out of the question, but adds complexity as we are currently not building with TF-M.
2. KMU–CryptoCell Push (seems like ideal option)
The KMU can store ECC private keys using multiple slots, however, according to this thread it is not possible to push an asymmetric key directly to the CryptoCell. I am trying to understand this limitation. According to documentation:
Note: A key value distributed over multiple key slots should use the same key slot configuration in its key headers, but the secure destination address for each key slot instance must be incremented by 4 words (128 bits) for each key slot instance spanned.
Note: If a key value is distributed over multiple key slots due to its key size, exceeding the maximum 128-bit key value limitation, then each distributed key slot must be pushed individually in order to transfer the entire key value over secure APB.
Given the key size is well within the max DMA transaction limit, and 256 bit AES keys can be pushed directly, why is it not possible for a 256 bit ECC key to be pushed for signing and verification operations?
3. KMU storage-only (seems like next best solution and easier than encrypted internal trusted storage, since we are not currently building with TF-M)
a. Readable key (e.g., KMU_IDENTITY_KEY_PERMISSIONS)
Will the key be exposed in UICR or FLASH dump?
Is there any protection of the key data at rest, or could it easily be extracted by someone with physical access and a debug probe?
b. Readable key encrypted w/ Hardware Unique Key
My assumption is that both HUK and Identity Key are stored in the UICR key storage region, with the HUK being push-only, and the encrypted Identity Key being readable.
[Identity key generation — nRF Connect SDK 2.1.0 documentation (nordicsemi.com)]
It seems this can be used without TF-M / secure boot.
Where are the keys actually stored?
In summary – my two main questions are:
- Is option 2 possible?
- If not, is option 3 the next best solution – assuming no external secure element is added, and am I understanding the protections offered by option 3 correctly?
Thanks