Contents

Symmetric encryption: AES and its modes

AES protects vehicle software and data with a shared secret key; its operating mode determines whether it also detects tampering.

Why it exists

A vehicle carries software, credentials and stored data that should remain confidential. An attacker might copy an update package, monitor a communication link or remove a storage device. Encryption makes the captured content unreadable without the correct key.

Confidentiality alone is often insufficient. A receiver also needs to detect changed commands, modified software or corrupted metadata before using them. Choosing “AES” does not settle this: the mode of operation determines how encryption handles complete messages and whether it detects tampering.

What it is

Symmetric encryption uses the same secret key to encrypt and decrypt. Both endpoints therefore need secure access to that key. Anyone holding it can generally create encrypted messages as well as read them.

The Advanced Encryption Standard (AES) is a block cipher defined in FIPS 197:

  • Its block size is always 128 bits.
  • Its supported key lengths are 128, 192 or 256 bits.
  • AES-256 means a longer key, not a larger block.

A block cipher transforms one fixed-size block under a key. A mode builds on that operation to protect messages or storage regions.

Encryption only provides confidentiality. Authenticated encryption also detects unauthorized changes. Authenticated encryption with associated data (AEAD) additionally protects metadata that remains readable, such as a message type or package identifier.

Authentication here proves possession of the shared key. It does not provide the separate publisher identity and verification model of a digital signature.

How it works

The sender passes a key, plaintext and mode-specific inputs to a cryptographic library or hardware service. The output is ciphertext. Authenticated modes also produce an authentication tag, which the receiver checks before accepting the plaintext.

Mode How it works Practical consequence
ECB — Electronic Codebook Encrypts each block independently. Identical plaintext blocks produce identical ciphertext blocks under the same key. Reveals patterns. Never choose it for application data.
CBC — Cipher Block Chaining Mixes each plaintext block with the previous ciphertext block; starts with an initialization vector. Requires an unpredictable initialization vector, usually padding, and separate authentication. Mainly a legacy integration concern.
CTR — Counter Encrypts counter values to create a stream that is combined with the plaintext. No padding, but counter blocks must never repeat under a key. Provides no authentication alone.
GCM — Galois/Counter Mode Combines counter-based encryption with authentication. Produces ciphertext and a tag; requires a unique nonce for each encryption under a key.
CCM — Counter with CBC-MAC Combines counter-based encryption with a cipher block chaining message authentication code. Provides authenticated encryption; needs unique nonces and knowledge of message length before processing.
XTS — XEX-based tweaked-codebook mode with ciphertext stealing Uses a storage-position-dependent value, called a tweak, when encrypting blocks. Suits block storage access, but provides no authentication.

For GCM, the nonce is a public value that must not repeat with the same key. It is often carried alongside the ciphertext. Never reuse a GCM nonce under the same key: reuse can expose relationships between plaintexts and enable forged tags. A longer AES key does not fix this.

Associated data is authenticated alongside the ciphertext. For example, an encrypted update chunk can bind its package identifier and chunk position to its contents. Changing either then causes verification to fail. The application must supply the expected metadata during verification.

Authentication does not itself prevent replay. A previously valid encrypted message still has a valid tag. The surrounding protocol must check freshness, sequence or software version as appropriate.

AES-GCM rejects tampered ciphertext
Alicesender; holds shared key K
Eveattacker; does not know K
Bobreceiver; holds shared key K
Encrypt with AES-GCMUse K and a unique nonce
Nonce, ciphertext, tagIntercepted in transit
Flip ciphertext bitsLeave nonce and tag unchanged
Forward altered message
Verify tag; rejectCheck fails; do not use plaintext

Alice and Bob already share K; changing ciphertext while retaining the original tag causes GCM authentication to fail.

When to use it — and when not

Encrypted over-the-air (OTA) packages protect software confidentiality during distribution or staging. Keep publisher signature verification and rollback protection: encryption does not establish whether a release is authorized or newer. Authenticate chunk ordering and package metadata when processing packages incrementally.

Media Access Control Security (MACsec) uses AES-GCM to protect Ethernet traffic between participating interfaces. Link protection terminates at those interfaces; gateways and applications may need additional protection.

Transport Layer Security (TLS) uses symmetric algorithms for record protection after establishing traffic keys. RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3, specifies AEAD record protection, including AES-GCM and ChaCha20-Poly1305. Use the TLS stack’s record handling rather than adding custom nonce logic.

Flash and data-at-rest encryption protect stored content against offline reading. XTS fits block-oriented storage when confidentiality is the requirement. Records needing tamper detection require an authenticated storage design, including safe handling of rewrites and power loss.

ChaCha20-Poly1305, specified in RFC 8439, combines a stream cipher with an authenticator. It is a useful TLS alternative on processors without efficient AES acceleration. Benchmark the available implementations; the fastest choice depends on the platform.

Do not use encryption merely to detect changes when confidentiality is unnecessary. A message authentication code may meet that requirement. Do not treat encrypted storage as protection against software already authorized to read the decrypted content.

Best practices

  • Choose an established authenticated protocol or AEAD API. Use CBC or CTR only within a reviewed construction that supplies authentication correctly.
  • Design nonce allocation around the complete key lifetime. Include resets, power loss, concurrent senders, cloned devices and restored backups. Rekey before the protocol’s usage limits are reached.
  • Keep keys behind hardware security module (HSM) interfaces where supported. Applications should use key handles instead of exporting raw secrets. Restrict which software can request decryption.
  • Measure the complete data path. Microcontrollers (MCUs) may accelerate AES while performing authentication in software. HSM queues, memory transfers and driver calls can dominate small-message latency.
  • Check hardware capabilities explicitly. AES support does not guarantee support for GCM, CCM, protected key use or every required key length. Validate fallback behavior and use implementations designed to resist timing leakage.
  • Verify before use. Buffer unauthenticated plaintext or keep it isolated until tag verification succeeds. Reject failures without exposing plaintext or detailed padding errors.
  • Separate purposes. Use distinct keys or approved key derivation for communication, update packages and storage. Define provisioning, rotation and recovery before deployment.

Common pitfalls

  • Selecting AES-256 while leaving the mode, authentication and nonce lifecycle unspecified.
  • Resetting a nonce counter after reboot while retaining the same encryption key.
  • Assuming a random nonce generator automatically guarantees uniqueness across a fleet.
  • Treating CBC or CTR ciphertext as tamper-proof, or treating XTS as authenticated storage.
  • Parsing, executing or installing plaintext before its authentication tag has passed verification.
  • Assuming an HSM prevents misuse by compromised software that still has permission to invoke its keys.
  • Assuming a valid tag proves freshness, publisher identity or authorization to install an update.

What it means for your discipline

  • Cybersecurity Core

    Selects encryption modes, defines nonce and key lifetimes, and reviews how authentication failures are handled.

  • Base software Partial

    Integrates cryptographic drivers and hardware security module services; checks supported modes, key handles and asynchronous job handling.

  • HPC & application software Partial

    Uses authenticated-encryption APIs, supplies the correct metadata and prevents unverified plaintext from reaching application logic.

  • Hardware & silicon Partial

    Checks AES acceleration, protected key storage and memory access paths when selecting microcontrollers and processors.

  • Networks & communication Partial

    Configures MACsec encryption and accounts for security overhead, key changes and packet-number exhaustion.

  • Software update & OTA Partial

    Defines encrypted package handling, authenticates package metadata and ensures interrupted installations cannot cause nonce reuse.

No direct stake: E/E architecture · Functional safety · Diagnostics & lifecycle

Where it sits in the software stack

Generic layered software of a central HPC (application processor with hypervisor, plus a safety island) and of a classic MCU-based ECU (AUTOSAR Classic). Highlighted modules matter for this topic. Click any module to open its page.

HPC · application processor (MPU) and safety island (MCU)
  • Security services — Provides AES encryption and authenticated decryption with protected keys, enforcing mode-specific nonce and authentication requirements.
  • OTA client · UCM — Decrypts encrypted update content and authenticates chunk metadata before accepting plaintext for installation.
MCU-based ECU · AUTOSAR Classic
  • Memory · crypto · WdgM — Exposes configured AES modes through crypto services and manages key handles and asynchronous cryptographic jobs.
  • Microcontroller · HSM — Provides hardware AES acceleration and protected key storage where supported by the microcontroller or HSM.