Skip to content
Back to overview
Knowledge Base
August 14, 2026

Secure Boot: ECU Firmware Integrity & ISO/SAE 21434 Cybersecurity

Secure Boot

Talk to engineers who’ve been here before

If you’re responsible for an EV program and want to reduce uncertainty before it becomes risk, let’s talk.

Reach us now

Share:

Download
Share
Copy to clipboard
JASPAR
Japan Automotive Software Platform and Architecture: an industry body whose SecOC configuration is standardized as AUTOSAR SecOC Profile 3.
UDS
Unified Diagnostic Services (ISO 14229): the diagnostic communication protocol used for ECU testing, configuration and key updates.
RTE
Runtime Environment: the AUTOSAR layer that connects application software components to the basic software (BSW).
SHE
Secure Hardware Extension: an automotive standard for a lightweight on-chip security module and key store, often used to hold the keys an HSM works with.
I-PDU
Interaction layer PDU: the application-level PDU that carries signals between ECUs in AUTOSAR communication. SecOC protects the Authentic I-PDU and produces the Secured I-PDU.
JTAG
Joint Test Action Group — Standardized hardware interface (IEEE 1149.1) for testing, debugging, and programming chips. Provides low-level access to internals, often targeted in security attacks.
AUTOSAR
AUTomotive Open System ARchitecture — Standardized automotive software architecture for scalable, reusable software across vehicle platforms. Defines layered components, communication mechanisms, and configuration methods.
ARXML
AUTOSAR XML — XML-based file format describing AUTOSAR software components, interfaces, and configurations. Standard data exchange format between AUTOSAR development tools.
AES
Advanced Encryption Standard — Symmetric block cipher standardized by NIST, encrypting data in 128-bit blocks with 128/192/256-bit keys. Core building block in automotive cybersecurity.
HSM
Hardware Security Module — Tamper-resistant hardware component securely storing cryptographic keys and performing crypto operations. Isolates security-critical functions from the main ECU processor.
FVM
Freshness Value Manager — AUTOSAR SecOC sub-module managing freshness values (counters) used to prevent replay attacks. Provides, tracks, and verifies freshness values for authenticated messages.
MAC
Message Authentication Code — Cryptographic checksum using a secret key to verify message integrity and authenticity. Confirms data is unaltered and from a legitimate sender.
CMAC
Cipher-based Message Authentication Code — MAC construction built from a block cipher, standardized as AES-CMAC. Widely used in SecOC to authenticate CAN/Ethernet messages.
ECU
Electronic Control Unit — Embedded computer controlling vehicle subsystems like engine, brakes, or infotainment. Modern cars contain dozens, networked via CAN, LIN, or Ethernet.
PDU
Protocol Data Unit — Data unit exchanged between network layers, containing payload plus protocol control info. Basic building block in AUTOSAR COM/PduR routing.
SecOC
Secure Onboard Communication — AUTOSAR module authenticating in-vehicle messages via freshness counter and truncated MAC. Protects against replay attacks without full encryption.
GB/T
Guobiao Tuijian. China's recommended national standards, including its EV charging connector and protocol.
Pt1000
A platinum resistance temperature sensor (1000 ohms at 0 degrees C) used to monitor contact temperature.
10BASE-T1S
A single-pair Ethernet variant for short, low-speed links, used by the Megawatt Charging System in place of powerline communication.
AFIR
Alternative Fuels Infrastructure Regulation. An EU regulation setting targets and requirements for alternative-fuel infrastructure, including EV charging.
BMS
Battery Management System. The electronics that monitor and protect a battery pack, managing its charge, voltage, temperature and safety.
CAN
Controller Area Network. A robust bus standard that lets controllers and devices communicate without a central computer, widely used in vehicles.
DIN
Deutsches Institut fuer Normung. Germany's national standards organization.
DTC
Diagnostic Trouble Code. A standardized code stored by a vehicle's electronics to record a detected fault.
EVSE
Electric Vehicle Supply Equipment. The equipment that supplies electrical energy to charge an electric vehicle; in everyday terms, the charging station.
IEC
International Electrotechnical Commission. The international body that prepares and publishes standards for electrical and electronic technologies.
ISO
International Organization for Standardization. An independent body that develops and publishes worldwide technical standards.
NRMM
Non-road mobile machinery. Mobile machines not intended for use on public roads, such as construction and agricultural equipment.
RFID
Radio Frequency Identification. Identifying and reading data from a tag wirelessly using radio waves.
SAE
SAE International. A standards organization for the automotive, commercial-vehicle and aerospace industries.
TLS
Transport Layer Security. A cryptographic protocol that encrypts and authenticates data sent over a network.
VCU
Vehicle Control Unit. The central electronic controller that coordinates a vehicle's subsystems.

Introduction

With the rapid integration of software-driven features (Over-The-Air updates, Infotainment, Autonomous driving functions, etc.) into modern vehicles, the attack surface for cyber security threats has expanded significantly. Cyber-attacks can target a vehicle’s software at many points, and one of the most critical areas is the ECU’s startup phase.

Secure Boot is a security concept designed to validate the integrity and authenticity of the software running on the control unit. The primary objective of Secure Boot is to perform the cryptographic verification of every software component before execution on the ECU, ensuring that the software has not been tampered with by an attacker.

Secure Boot Procedure

Secure Boot establishes a Chain of Trust by sequentially verifying the integrity and authenticity of each software layer prior to execution. To achieve this, the boot sequence is anchored in an isolated Hardware Root of Trust, typically a Hardware Security Module (HSM) or a comparable secure hardware element. Cryptographic keys used for verification are stored and used exclusively inside this hardware boundary, and they are never exposed to the rest of the system, which makes it very difficult for an attacker to extract or misuse them.

A typical Secure Boot procedure is as follows:

ECU powered on HSM initializes first and validates the first-stage bootloader ROOT OF TRUST Bootloader forwards the boot stage and its signature/MAC to the HSM HSM performs the cryptographic check internally using the appropriate keys and returns the result KEYS NEVER LEAVE THE HSM Validation successful? NO ECU enters safe / fallback state REPROGRAMMING STATE YES Execute this boot stage Additional boot stages remain? YES: VERIFY NEXT STAGE NO ECU fully booted, software running
  1. 1HSM initializes and validates the first-stage bootloaderWhen the ECU is powered on, the Hardware Security Module is initialized first and validates the first-stage bootloader.
  2. 2HSM verifies the boot stageThe bootloader forwards the boot stage, such as the application software, along with its stored signature/MAC, to the HSM for verification. The HSM performs the cryptographic check internally using the appropriate keys and returns the result.
  3. 3Execute the stage, or enter a safe / fallback stateUpon successful validation, the application software starts running on the ECU. Otherwise, the ECU enters a safe/fallback state depending on the design choice, such as a reprogramming state. A failed software update can leave the ECU soft-bricked, since the reprogrammer no longer runs: no CAN communication is possible, and recovery is only possible via JTAG. With Secure Boot fully activated, testing is also impacted, since a compile-flash test is no longer possible; the official signing process has to be followed to prepare the software for execution on the ECU.
  4. 4Repeat for every remaining boot stageIf any additional boot stages remain, such as the operating system or further application software layers, each one goes through the same HSM verification before it is allowed to execute. Once every boot stage has been verified, the software starts running and the ECU is considered securely booted.

Secure Boot validates the firmware during the start-up phase. To safeguard applications during run-time, additional controls can be implemented, such as program flow monitoring, partial runtime integrity checks that reapply the same hash-based or MAC-based principles used in Secure Boot.

Software Authentication

To validate the integrity and authenticity of the software running on the ECU, the following cryptographic methods can be used.

1. MAC-Based Validation: Uses a symmetric key algorithm (AES-CMAC), where the same secret key is used to both generate and verify the MAC value. This secret key must be shared with the ECU to verify the software image and is stored securely inside the HSM. At every boot process, the HSM recomputes the MAC value over the desired input message and compares it against the reference MAC value.
This input message can originate from a cryptographic hash algorithm (e.g., SHA-256). At every boot process, a hash of the current software image is computed, fed into MAC calculation and the output is compared against a stored reference value, to detect any software tampering. This reference must be stored at a memory location that an attacker cannot modify, e.g. the HSM.

2. Signature-Based Validation: Uses a public/private key pair. The signature is generated once, at the time the OEM signs the software by computing a hash of the software image, signing it with the private key, and appending it to the software image. In practice, this check is performed once, during the software update, as verifying a signature requires more computation time. For every subsequent boot, the ECU recomputes the hash or MAC value over the current software image and compares it against the reference value stored in the HSM, which is faster than verifying the signature. The private key is the only element that must be kept secret, ideally in the OEM’s Key Management System (KMS). This per-boot check does not replace the signature as the trust anchor, it only reconfirms that the software still matches what the OEM originally signed. Unlike the shared secret key in MAC-based validation, the private key never has to be present on the ECU at all, which is what continues to set signature-based validation apart.

Secure Boot Implementation Concerns

There are several concerns that must be addressed during Secure Boot implementation.

1. Rollback Protection: Secure Boot shall prevent older, potentially less secure software versions from being executed on the ECU. This can be achieved by using monotonic counters and freshness values, stored in protected memory as well as in the software image, which can only increase. However, there is an exception: a rollback is feasible in the special case where older software is re-compiled and re-signed, and the counter is increased correctly. As signing requires the private key, the most important secret in the system, whoever performs it must already possess that key, so the rollback is assumed to be intentional rather than malicious.

2. Key Management System (KMS): The KMS itself must be secured against cyber-attacks. A weak implementation, for example, poor key generation, reusing the same key across ECUs in a vehicle network, or insufficient access control, can expose the secret or private keys that Secure Boot depends on and also impacts the security of every ECU that relies on them. It is also important to be aware of, or be able to read, the key version stored on the unit. If this is unknown, the software may end up being signed with the wrong key version, leading to failed signature verification due to a key mismatch and leaving the ECU stuck on its current software or even more fatal in a soft-bricked state.

3. Debug Protection: OEMs shall ensure that JTAG and other debug interfaces are locked in production units, to prevent sensitive information from being extracted using debugger tools.

4. Boot-Up Time: OEMs shall ensure that the Secure Boot process is completed within an acceptable time window. If it takes too long, it can trigger unexpected behavior, for example a watchdog reset if the watchdog is not serviced in time.

Conclusion

Secure Boot is not an optional security enhancement. UN Regulation No. 155 requires a cybersecurity management system for vehicle type approval, and ISO/SAE 21434 sets the cybersecurity engineering process behind it, which makes boot-time integrity verification a practical necessity for any modern vehicle that depends on software-defined functionality. By verifying the integrity and authenticity of all software before it executes on the system, Secure Boot prevents compromised or malicious software from being executed on the ECU, closing off one of the most fundamental attack vectors in automotive cybersecurity.

However, Secure Boot is only as strong as its supporting implementation. Implemented correctly, alongside the concerns outlined above, Secure Boot forms a foundational layer that helps prevent cyber-attacks and protects the safety of everyone who depends on it.

Frequently Asked Questions

What is Secure Boot?

Secure Boot is a security concept that validates the integrity and authenticity of the software running on an ECU before it is allowed to execute. It establishes a Chain of Trust anchored in an isolated Hardware Root of Trust, typically a Hardware Security Module (HSM), and verifies each software layer in sequence at every startup.

Why does Secure Boot rely on a Hardware Security Module (HSM)?

Cryptographic keys used for verification are stored and used exclusively inside the HSM and never exposed to the rest of the system. This makes it very difficult for an attacker to extract or misuse the keys, which is why the HSM, or a comparable secure hardware element, forms the hardware root of trust the entire boot chain depends on.

What is the difference between Secure Boot and secure flashing?

Secure Boot verifies the software already resident on the ECU at every startup. Secure flashing verifies a new software image once, at the point it is written to the ECU during an update. The two are complementary: secure flashing controls what gets installed, Secure Boot controls what is allowed to run afterward.

What happens if Secure Boot validation fails?

Depending on the design choice, the ECU enters a safe or fallback state, such as a reprogramming state that waits for a new image over CAN. If the failure stems from a corrupted update that leaves the reprogrammer itself unable to run, the ECU can become soft-bricked, with no CAN communication possible and recovery only via JTAG.

Why does Secure Boot need rollback protection?

Without it, an attacker could reinstall an older, previously valid but less secure software version to reintroduce a known vulnerability. Rollback protection is typically implemented with a monotonic counter, stored in protected memory, whose value can only increase, so software tied to an older counter value is rejected.

Can a locally compiled test build still be flashed once Secure Boot is fully enabled?

No. Once Secure Boot is fully activated, an ad hoc compile-and-flash test is no longer possible, since unsigned software fails verification. The software has to go through the official signing process before it can execute on the ECU, which is a real workflow change for test teams to plan around.

Which cryptographic methods can Secure Boot use to validate software?

Three are commonly used: MAC-based validation with a shared symmetric key (AES-CMAC), hash-based validation with a cryptographic hash such as SHA-256 compared against a stored reference, and signature-based validation with a public/private key pair, where the expensive signature check runs once at the software update and faster hash or MAC checks run at every subsequent boot.

Is Secure Boot mandatory for automotive ECUs?

Regulations do not name Secure Boot directly, but UN Regulation No. 155 requires a cybersecurity management system for vehicle type approval, and ISO/SAE 21434 sets the cybersecurity engineering process this kind of boot-time integrity control is built to satisfy. In practice, this makes Secure Boot close to essential for any ECU in a type-approved vehicle with software-defined functionality.

Subscribe to our newsletter

System-level insights on EV integration, control software, and validation. Written by engineers who've been building electric vehicles since 2009.

[!] Incorrect Format
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.