Installing and Utilizing the Cryptographic User
Keys using SCE9
Introduction
Cryptography is important becaus e it provides the tools to implement solutions for authenticity,
confidentiality, and integrity, which are vital aspects of any security solution. In modern cryptographic
systems, the security of the system no longer depends on the secrecy of the algorithm used but rather on the
secrecy of the keys. Renesas RA Family cryptographic key installation provides several options for
minimizing the exposure of the user keys and providing optimal production and field key management
support.
This application project explains these key installation methods and provides examples for the currently
available methods supported via the Renesas Flexible Software Package.
An AES plaintext key installation example is provided for the Renesas RA Family RA6M4 MCU group.
Required Resources
Development tools and software
• The e
• Renesas Flexible Software Package (FSP) v2.2.0 or later
• SEGGER J-link
The above three software components: the FSP, J-Link USB drivers and e2 studio are bundled in a
downloadable platform installer available on the FSP webpage at renesas.com/ra/fsp
2
studio ISDE v2020-10 or greater
®
USB driver
.
Hardware
• EK-RA6M4, Evaluation Kit for RA6M4 MCU Group (http://www.renesas.com/ra/ek-ra6m4
• Workstation running Windows® 10 and Tera Term console, or similar application
• Two USB device cables (type-A male to micro-B male)
)
Prerequisites and Intended Audience
This application note assumes you have some experience with the Renesas e2 studio IDE and Arm®
TrustZone® based development models with e
have some knowledge of RA Family MCU security features. See chapter 49, Security Features in the
Renesas RA6M4 Group MCU User’s Manual: Hardware for background knowledge preparation for the
cryptographic key installation.
The intended audience are product developers, product manufacturers, product support, or end users who
are involved with any stage of the MCU user key management of the RA Family MCUs with Arm TrustZone.
2
studio. In addition, the application note assumes that you
R11AN0473EU0110 Rev.1.10 Page 1 of 17
Dec.20.2020
Renesas RA Family Installing and Utilizing the Cryptographic User Keys using SCE9
Contents
1. Root of Trust and its Protection ............................................................................................... 3
1.1 What is Root of Trust ............................................................................................................................... 3
1.2 Protecting the Root of Trust .................................................................................................................... 3
2. Introduction to SCE9 and Associated Keys .............................................................................. 3
3. Cryptographic User Key Installation ......................................................................................... 4
3.1 Plaintext User Key Installation Features ................................................................................................. 4
3.2 Key Wrapping with SCE9 ........................................................................................................................ 5
3.3 Advantages of Key Wrapping .................................................................................................................. 5
3.3.1 Advantages of Key Wrapping over Key Encryption .............................................................................. 5
3.3.2 Advantages of Key Wrapping using MCU HUK .................................................................................... 6
3.4 Plaintext User Key Installation Use Cases .............................................................................................. 6
4. Example Project with AES User Key Handling ......................................................................... 8
4.1 Import and Compile the Example Project ................................................................................................ 9
4.2 Setting up the Hardware ........................................................................................................................ 10
4.3 Running the Example Project ................................................................................................................ 11
7. Website and Support ............................................................................................................. 16
Revision History ............................................................................................................................ 17
R11AN0473EU0110 Rev.1.10 Page 2 of 17
Dec.20.2020
Renesas RA Family Installing and Utilizing the Cryptographic User Keys using SCE9
1. Root of Trust and its Protection
1.1 What is Root of Trust
Roots of trust are highly-reliable hardware, firmware, and software components that perform specific, critical
security functions (https://csrc.nist.gov/projects/hardware-roots-of-trust
typically consists of identity and cryptographic keys rooted in the hardware of a device. It establishes a
unique, immutable, and unclonable identity to authorize a device in the IoT network.
•Secure boot is part of the services provided in the Root of Trust in many security systems. Authentication
of the application utilizes Public Key Encryption. The associated keys are part of the Root of Trust of the
system.
•Device Identity, which consists of Device Private Key and Device Certificate, is part of the Root of Trust
for many IoT devices.
). In an IoT system, a root of trust
1.2 Protecting the Root of Trust
From the above Root of Trust discussion, we can realize that leakage of the cryptographic user keys can
bring the secure system into a risky state. Protection of the Root of Trust involves key accessibility within the
cryptographic boundary only and keys that are unclonable. Root of Trust should be locked from read and
write access from unauthorized parties.
Renesas user key management system can provide all the above desired protection. In addition, Renesas
user key installation services provide several options from which user can pick and choose the installation
methods which fits their existing architecture.
2. Introduction to SCE9 and Associated Keys
Next generation RA Family MCUs expand Renesas’ strong security offerings with the new SCE9 secure
crypto engine and authenticated Device Lifecycle Management (DLM). This application project focuses on
the security feature brought by SEC9. For the security features brought by DLM, please reference the
application note Renesas Device Lifecycle Management Key Installation
for details.
2.1 Secure Crypto Engine (SCE9)
Figure 1. Secure Crypto Engine 9
The Secure Crypto Engine 9 is an isolated subsystem within the MCU.
•The crypto engine contains hardware accelerators for both symmetric and asymmetric cryptographic
algorithms, as well as various hashes and message authentication codes.
•It also contains a True Random Number Generator, providing an entropy source for the cryptographic
operations.
•The Secure Crypto Engine is protected by an Access Management Circuit, which shuts down the crypto
engine in the event of an illegal external access attempt.
R11AN0473EU0110 Rev.1.10 Page 3 of 17
Dec.20.2020
Renesas RA Family Installing and Utilizing the Cryptographic User Keys using SCE9
Lifecycle Transition Keys
AES
RSA
ECC
HMAC
2.2 SCE9 Associated Keys
Figure 2. Security Keys
RA Family MCUs with the SCE9 crypto engine is associated with two new types of keys compared with
SCE7.
•The first is an MCU-u niq ue Hardware Unique Key (HUK), a 256-bit random key that is preprogrammed in
the Renesas factory.
•This key is stored in unmapped flash, ass ess able only by the SCE9, not to application code. It is
further protected by being stored not in plaintext, but rather wrapped by the HRK (Hardware Root Key)
and MCU unique ID.
• The SCE9 can access this HUK to perform user key wrapping.
• Since the HUK is stored in an MCU-uniquely wrapped format, even if an attacker was able to extract
the stored key, another MCU won’t be able to use it.
• The second type of keys are associated with the Renesas Device Lifecycle Management (DLM) system.
• For the installation and usage of the DLM Keys, please reference application note
Renesas Device
Lifecycle Management Key Installation.
The HRK and HUK are used in the user key Installation process.
3. Cryptographic User Key Installation
The table below summarizes the key types that can be installed into Renesas RA MCUs with the SCE9
Secure Crypto Engine, for example, RA6M4 and RA4M3. Installed keys will be stored wrapped by the MCU’s
HUK.
Table 1 Supported Key Types
SECDBG_KEY, NONSECDBG_KEY, RMA_KEY
AES-128, AES-192, AES-256
RSA-1024, RSA-2048, RSA-3072, RSA-4096 (Public and Private)
NIST P-192, P-224, P-256, and P-384
Brainpool P256r1, P384r1, and P512r1 (Public and Private)
HMAC-SHA224, HMAC-SHA256
3.1 Plaintext User Key Installation Features
Plaintext user key refers to the fact that the user keys can be provided in plaintext format to SCE9. When the
plaintext key is installed, the SCE9 wraps the plaintext key with HUK and provides the wrapped key outside
SCE9 for storage.
R11AN0473EU0110 Rev.1.10 Page 4 of 17
Dec.20.2020
Renesas RA Family Installing and Utilizing the Cryptographic User Keys using SCE9
Figure 3. Plaintext Key Installation
This plaintext key installation process gives all security control of the keys to the product developer, which
enables the developer to benefit from any existing secure key provisioning infrastructure. However, we do
not recommend long-term storage of plaintext keys on the MCU. Therefore, the RA Family MCUs have the
capability to install and securely store a plaintext key in wrapped format by wrapping the key with the MCU
HUK.
Plaintext key installation is supported with FSP 2.0.0 or later. How to get the plaintext user key into the MCU
RAM or flash in preparation for installation is out of scope for this application project. Product developers can
use their existing infrastructure to interface to the MCU based on their specific environment.
Note: This plaintext key installation procedure is recommended to be performed in a secure environment.
3.2 Key Wrapping with SCE9
Key wrapping with SCE9 involves encryption using the MAC of the MCU unique ID and user key encrypted
with the HUK. The encryption aspect provides confidentiality of the key. Wrapping with MAC code adds
integrity and authenticity. Finally, wrappi ng with the MCU HUK adds clone protection. Advantages of Key
Wrapping
3.2.1 Advantages of Key Wrapping over Key Encryption
Figure 4. Key Wrapping vs. Key Encryption
It is important to understand the difference between wrapping and encrypting for secure asset storage. We
will use symmetric encryption here to demonstrate.
R11AN0473EU0110 Rev.1.10 Page 5 of 17
Dec.20.2020
Renesas RA Family Installing and Utilizing the Cryptographic User Keys using SCE9
•When data is encrypted and sent to another recipient, if that recipient has the same key, they can
decrypt the data. This results in a confidential exchange of information. However, what if there was a
problem with the transmission of the encrypted data? If the recipient unknowingly receives corrupted
information, the decryption algorithm will generate garbage data, with no indication that the original data
has been corrupted.
•Wrapping solves this problem for us by adding anintegrity checking mechanism to the encrypted output.
3.2.2 Advantages of Key Wrapping using MCU HUK
Figure 5. Key Wrapping using the HUK
Using the MCU Hardware Uniq ue Key to wrap the stored keys adds another protection feature – clone
protection.
•If the wrapped key is transmitted or copied to another MCU, that MCU’s HUK will not be able to unwrap
nor decrypt the information, maintaining the security of the key.
• MCU-wrapped keys can only be unwrapped by the MCU that wrapped them
• The MCU’s HUK is used as part of the wrapping algorithm
• Since the HUK is unique, no other MCU can unwrap the key
• Benefits
• Wrapped keys can be stored in non-secure memory
• Even if the entire MCU contents are copied onto another device, the keys cannot be utilized nor
exposed
3.3 Plaintext User Key Installation Use Cases
This section summaries several common use cases for key installation.
Case 1: Plaintext Key Installation During Production Provisioning/Programming
In this case, user keys are injected to the MCU based on customer’s existing or preferred method. The
injected plaintext key is then installed by MCU application-level code using the Renesas RA Family FSP.
This use case enables installation of pre-generated keys, which should be performed in a secure
environment. Solutions for this use case are supported by FSP 2.0.0 or later. The FSP APIs used are
demonstrated in the example project included in this application project.
R11AN0473EU0110 Rev.1.10 Page 6 of 17
Dec.20.2020
Loading...
+ 12 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.