CYBERSECURITY IN AUTOMOTIVE

Cybersecurity of the Basic Software Layer in AUTOSAR Architecture

This article is part of a series dedicated to the topic of cybersecurity in the automotive industry, prepared by Krzysztof Labuda. 



Context of the BSW Layer in the Security Landscape

In this article, I aim to familiarize the reader with the Basic Software (BSW) layer, which I previously introduced in an earlier part of this series. This time, we will examine it through the lens of cybersecurity functionalities—such as confidentiality (achieved through mechanisms like encryption), integrity, and availability. The topics discussed here expand upon the thematic scope outlined previously, particularly in the fourth installment of the CS series.

The Role of the Basic Software Layer in AUTOSAR Architecture

The BSW layer plays a pivotal role in AUTOSAR’s multilayered architecture, serving as the bridge between hardware and the application layer. It provides essential system services, communication management, memory handling, and time management. Its placement within the system architecture is precisely defined in AUTOSAR documentation (e.g., AUTOSAR_EXP_LayeredSoftwareArchitecture).

From a cybersecurity perspective, this layer gains additional importance—especially due to its use of cryptographic services and integration with hardware-based data protection mechanisms

Defense in depth: Integration of the crypto stack and cryptoprocessors

In the world of cybersecurity, the term defense in depth refers to a layered approach to security. Originating in military doctrine, it aptly captures the idea of building systems resilient to multiple threat types by layering protection mechanisms.

In AUTOSAR, this is exemplified by the Crypto Stack, which—when combined with dedicated cryptoprocessors—enables robust protection against both physical and logical threats. While there is also a concept of defense in breadth, it is not applicable in this context.

This approach ensures not only security but also brings technical benefits: simplifying system development, enhancing performance, enabling scalability, and improving software portability.

The crypto stack and its key components

AUTOSAR documentation (e.g., Utilization of Crypto Services AUTOSAR CP R20-11) specifies how cryptographic functions should be used. The Crypto Stack consists of three primary components:

Crypto Service Manager (CSM)
Acts as an intermediary between the application software and the cryptographic hardware or software modules. It provides APIs for operations such as encryption, decryption, digital signatures, and hashing. It’s important to note that without so-called low-level cryptographic methods (avoiding the anglicism “cryptographic primitives”), it’s impossible to build systems supporting, for example, PKI (Public Key Infrastructure).

Hashing large datasets can be challenging, which is why incremental hashing is employed. This allows data to be hashed “in chunks,” eliminating the need to store the entire data stream in memory—an efficient and standard-compliant solution when using secure algorithms like SHA-2 or SHA-3.

Crypto Interfaces (CRYIF)
Provide standardized interfaces for applications and middleware. They facilitate integration and support common security mechanisms for communication (e.g., MAC, encryption), secure boot, and firmware updates.

Crypto Driver (CRYPTO)
Handles communication with cryptographic hardware, such as HSMs (Hardware Security Modules) or other dedicated chips. It introduces an abstraction layer that ensures a consistent interface for higher layers, regardless of the underlying hardware implementation.

Secure key storage and resistance to physical attacks

Key management plays a crucial role in automotive cybersecurity systems. Cryptoprocessors offer a solution here—these specialized chips protect cryptographic data against physical attacks, such as side-channel attacks, fault injections, or bus access attempts.

Examples include TrustAnchor100 (hardware encryption and secure communication), Infineon AURIX TC4x (integrated HSM for automotive systems), and NXP S32G (V2X communication support with embedded secure environment). These solutions enable automatic responses to tampering—such as erasing keys upon detecting an attack attempt.

A Crypto Stack working alongside such hardware ensures that sensitive data—including private keys—is never processed in plaintext form. Additionally, anomaly detection and safeguards against excessive failed access attempts are implemented.

Key exchange and secure communication

Secure key exchange is another pillar of an effective security system. AUTOSAR supports various protocols—both general-purpose, such as Diffie-Hellman, TLS, or IPSec, and those dedicated to vehicle-to-everything (V2X) communication.

These mechanisms enable secure key deployment and rotation—during both manufacturing and the vehicle’s operational lifetime (e.g., via OTA updates). As a result, they significantly hinder Man-in-the-Middle attacks or the interception of transmitted data..

Identity and access management (IAM) in AUTOSAR

Another essential security element is access management. Recent versions of the AUTOSAR standard (e.g., AP R23-11) have introduced advanced IAM (Identity and Access Management) mechanisms. These allow roles to be defined and permissions to be assigned for cryptographic operations and key usage.

As a result, only authorized software components can use specific functions. This significantly reduces the system’s attack surface and improves its overall security. Enforcing strict boundaries on cryptographic operations and access control has become the foundation of a resilient automotive environment.

Cybersecurity as an integral part of modern AUTOSAR systems

Ensuring security in today’s vehicles requires seamless cooperation between hardware and software components. The Basic Software layer within the AUTOSAR architecture, complemented by the Crypto Stack, cryptoprocessors, and IAM mechanisms, forms a coherent, modern response to the growing threats in the digital automotive environment.

Encryption, secure key exchange, access control, and resistance to both physical and logical tampering—all of these elements contribute to a robust, multilayered data and function protection strategy within the vehicle. This is not a glimpse of the future—it is the present reality of modern automotive technology.



Author: Krzysztof Labuda,
Security Testing Consultant

A participant in the Certified Ethical Hacker CEH v11 program, which teaches the latest commercial-grade hacking tools, techniques, and methodologies used by hackers and information security professionals.