Learning objectives

After reading this guide, you should be able to:

  • Explain the security goals and limitations of AUTOSAR Secure Onboard Communication (SecOC).
  • Distinguish the authentic I-PDU, secured I-PDU, freshness value and authenticator.
  • Locate SecOC in a typical AUTOSAR Classic communication path.
  • Describe sender and receiver processing, including freshness handling and cryptographic-service integration.
  • Identify configuration items that must match across communicating ECUs.
  • Plan positive, negative, boundary and recovery tests.
  • Investigate authentication failures without exposing secret key material.

Scope note: SecOC parameters, interfaces, supported profiles, generated APIs and module boundaries vary by AUTOSAR release, platform configuration and OEM security architecture. The diagrams and examples below are conceptual. Use the exact AUTOSAR release, supplier implementation documentation and project security baseline as the authority for implementation details.

1. What is AUTOSAR SecOC?

Secure Onboard Communication (SecOC) is an AUTOSAR mechanism for protecting communication between electronic control units (ECUs). It is designed to provide:

  1. Authenticity: evidence that a message was generated by an entity possessing the appropriate cryptographic key.
  2. Integrity: detection of unauthorized modification to the protected message data.
  3. Freshness / replay protection: a means for the receiver to distinguish current communication from previously valid messages that are replayed.

SecOC associates the authentic data with freshness-related information and a message authenticator. The receiver validates the security information before the authentic data is accepted by the configured communication path.

SecOC does not inherently encrypt the application payload. A captured secured PDU may still reveal its authentic data. If confidentiality is required, it must be addressed by a separately designed and approved mechanism.

1.1 Threats addressed and limitations

Threat or requirementSecOC contributionImportant limitation
Payload modification in transitAuthentication detects changes to protected dataOnly the configured authenticated data and inputs are covered
Forged message injectionA valid authenticator requires the appropriate keyKey compromise can undermine this protection
Replay of an old valid messageFreshness checks help reject stale messagesCorrect state management and recovery are essential
Payload confidentialityNot provided by SecOC itselfUse a separate confidentiality design if required
Availability / denial of serviceNot solved by message authenticationNetwork and system-level protections are still required

SecOC is one part of a vehicle cybersecurity architecture. It does not replace secure boot, secure diagnostics, access control, key lifecycle management, network segmentation or system-level threat analysis.

2. SecOC architecture in AUTOSAR Classic

SecOC is commonly integrated into the communication stack so that application software can continue to exchange its configured I-PDUs while the communication infrastructure performs protection and verification.

A simplified transmit path is:

SWC → RTE → COM → PduR → SecOC → PduR / lower communication modules → bus

A corresponding receive path is conceptually:

bus → lower communication modules → PduR → SecOC → PduR → COM → RTE → SWC

The exact placement, routing and API relationships depend on the ECU configuration and AUTOSAR release. Some architectures use different routing arrangements, including gateway or protection-termination designs.

Rendering diagram...

Important: This diagram is a functional overview, not a mandatory module-call sequence. For a real ECU, confirm the configured PDU paths, direction-specific routing and generated interfaces.

2.1 Main responsibilities

ElementTypical responsibility in the communication design
COMPacks and unpacks configured signals into I-PDUs
PduRRoutes I-PDUs between configured communication modules
SecOCCreates or verifies secured I-PDUs and applies configured freshness checks
Communication interface / driverTransfers the PDU through the selected network hardware and protocol stack
Freshness managementProvides or reconstructs freshness information according to the configured design
Cryptographic service pathPerforms the configured cryptographic operation using approved key references

The freshness and cryptographic functions may be integrated through configured interfaces and services. Do not assume that every vendor implementation exposes identical module boundaries or API names.

3. Core SecOC data elements

ElementPurposeEngineering consideration
Authentic I-PDUOriginal communication PDU whose data is protectedDefine exactly which PDU and bits are covered
Freshness value (FV)Provides freshness context for replay protectionSender and receiver need compatible state and interpretation
Data identifier / profile inputsBind authentication to the configured message context where requiredUse consistent profile inputs at both endpoints
AuthenticatorCryptographic value used to verify authenticity and integrityAlgorithm, input construction, output length and truncation must match
Secured I-PDUTransmitted representation containing authentic data and configured security informationField placement, bit lengths and total length are configuration-dependent

A project may transmit only part of the full freshness value and a truncated authenticator to fit network payload constraints. The receiver uses the received freshness information and its local state according to the configured freshness-management scheme.

Do not assume a universal field order, byte layout, bit length, algorithm or freshness reconstruction method.

3.1 Authentic data versus secured representation

The authentic I-PDU is the communication data that the project intends to protect. The secured I-PDU is the representation sent over the configured communication path after the security information has been added.

Conceptually:

Authentic I-PDU
      |
      +---- Freshness information
      |
      +---- Configured profile inputs
      |
      v
Cryptographic authentication
      |
      v
Authenticator
      |
      v
Secured I-PDU = authentic data + configured security fields

This is a conceptual relationship only. Actual serialization and field placement are determined by the configured SecOC profile and PDU layout.

4. Sender-side processing

At a functional level, the sender performs the following operations:

  1. Receives the authentic I-PDU from the configured communication path.
  2. Obtains the freshness information required for this transmission.
  3. Forms the authentication input from the configured authentic data and profile-defined inputs.
  4. Requests the configured cryptographic processing to calculate the authenticator.
  5. Constructs the secured I-PDU using the configured layout and transmitted freshness representation.
  6. Passes the secured PDU to the configured lower communication path.

4.1 Sender engineering checks

During integration, verify:

  • The authentic PDU selected for protection is the intended PDU and has the expected length.
  • The freshness source returns a valid value at the time the PDU is protected.
  • The configured profile inputs are stable and consistent with the receiver.
  • The cryptographic operation completes successfully and uses the intended key reference.
  • The authenticator is inserted at the correct configured position and with the configured truncation.
  • The secured PDU length and routing configuration match the receiving endpoint.

A sender-side success indication does not by itself prove that the receiver will accept the PDU. End-to-end interoperability must be verified.

5. Receiver-side processing

The receiver performs the corresponding verification:

  1. Receives the secured I-PDU through the configured communication path.
  2. Separates authentic data and received security fields according to the configured layout.
  3. Obtains or reconstructs a candidate freshness value using receiver state and the received freshness information.
  4. Forms the expected authentication input.
  5. Calculates or verifies the expected authenticator using the matching profile and key reference.
  6. Applies the configured authentication and freshness acceptance rules.
  7. Delivers the authentic data only when the required checks succeed; otherwise rejects the PDU or reports the failure according to the integration design.
Rendering diagram...

The receiver's decision may depend on both cryptographic verification and freshness acceptance. The exact order and internal implementation are release- and vendor-dependent.

6. Freshness management and replay protection

A valid authenticator on an old message does not prove that the message is current. Freshness is therefore a central part of SecOC.

Depending on the system design, freshness may use counters or another configured mechanism. The secured PDU can carry a shortened freshness representation rather than the complete value. The receiver may reconstruct a candidate full value using stored state and the received freshness bits.

6.1 Sender and receiver state

The sender and receiver must maintain compatible interpretations of freshness. The design needs to define:

  • How the sender obtains and advances freshness.
  • Which part of the freshness information is transmitted.
  • How the receiver reconstructs or validates the candidate value.
  • What freshness window or acceptance policy is configured.
  • How state is initialized and retained across resets.
  • How message loss, rollover and resynchronization are handled.

Do not assume that the sender and receiver simply increment a counter once for every application update. The configured mechanism, transmission behavior and system requirements determine the actual progression rules.

6.2 Important boundary conditions

ConditionEngineering question
Message lossHow many missed transmissions can be tolerated by the configured receiver policy?
Out-of-order deliveryIs reordering possible on this path, and how is it handled?
Counter rolloverHow is the boundary represented and reconstructed?
ECU resetIs freshness state restored, reinitialized or resynchronized?
Power interruptionCan persistent state be corrupted or rolled back?
ResynchronizationWhat controlled recovery process is permitted?
Multiple transmittersIs freshness state correctly separated for each protected communication context?

Freshness behavior is system- and profile-dependent. Treat freshness as security state, not as an ordinary application signal.

7. Cryptographic service integration and key handling

SecOC relies on configured cryptographic processing. It must not be treated as an ordinary checksum calculation.

In many AUTOSAR Classic designs, cryptographic operations are integrated through a configured cryptographic service path. The architecture may involve:

  • CSM (Crypto Service Manager): provides configured cryptographic service access to software modules.
  • CryIf (Crypto Interface): abstracts access to configured cryptographic drivers.
  • Crypto Driver: connects the service request to the selected software or hardware cryptographic implementation.

These names describe common AUTOSAR Classic architectural roles. The exact interfaces, job configuration, supported algorithms and integration details must be checked against the selected AUTOSAR release and supplier implementation.

Rendering diagram...

7.1 Key-management requirements

The ECU security design should establish:

  • Which cryptographic service path is used.
  • Which key reference or key slot is associated with each protected communication.
  • How keys are provisioned, activated, updated, revoked and retired.
  • How key availability and lifecycle state are reported.
  • How development and production environments differ.
  • Which diagnostic information may be logged.

Never place secret keys in source control, ordinary logs, screenshots, unsecured diagnostic traces or test reports. Use approved key-management and test procedures. A key identifier or slot reference may help troubleshooting, but it is not a substitute for secure key handling.

8. Configuration alignment between ECUs

SecOC interoperability depends on compatible configuration at both endpoints. A payload can look correct in a bus trace and still fail verification because the authentication inputs or freshness interpretation differ.

Configuration areaSender/receiver alignment to verify
Authentic and secured PDU mappingCorrect PDU relationship and routing at both endpoints
Protected dataSame data and bit range are authenticated
Profile inputs / data identifierMatching configured context where required
Algorithm and profileCompatible cryptographic algorithm and profile selection
AuthenticatorMatching input construction, output length and truncation
FreshnessCompatible length, transmitted portion, reconstruction and state policy
Key referenceIntended key identity, valid lifecycle state and correct environment
PDU layoutMatching field offsets, bit ordering, byte ordering and total length
Routing and gatewaysProtected fields are preserved or protection is deliberately terminated and re-established
Error handlingRejection, reporting and recovery behavior are defined

8.1 Illustrative configuration comparison

The following table is a review aid, not a vendor-specific ARXML schema or a universal parameter set.

Review itemSender ECUReceiver ECUExpected review
Authentic PDUVehicleSpeed_AVehicleSpeed_ASame protected communication
Secured PDU layoutProject profile AProject profile ACompatible field layout
Authenticator profileProject profile AProject profile ASame algorithm/profile inputs
Authenticator lengthConfigured valueConfigured valueMust match
Freshness representationConfigured transmitted portionMatching interpretationMust be compatible
Key referenceApproved key slot referenceCorresponding approved key slot referenceSame intended key material and lifecycle
Receiver policyNot applicableProject-defined freshness acceptanceMeets system security requirements

Use actual project values in the ECU configuration review. Do not copy illustrative labels or guessed bit lengths into production configuration.

9. Worked example: protecting a vehicle-speed PDU

Consider a sender ECU publishing a vehicle-speed PDU that is consumed by another ECU.

The project configures SecOC protection for the authentic PDU. The sender obtains its freshness input and uses the configured cryptographic profile to calculate an authenticator over the required data and profile-defined inputs. The secured PDU is assembled using the configured field layout. It may contain the authentic data, a transmitted portion of the freshness value and a truncated authenticator.

During integration, capture a representative transmission and create a controlled comparison record containing:

  • Exact secured-PDU bytes as transmitted.
  • Sender and receiver PDU identifiers and configuration versions.
  • Protection profile and configured field layout.
  • Freshness state information captured through an approved test interface.
  • Receiver's reconstructed freshness result and acceptance decision.
  • Relevant key identifier or key-slot reference, never the secret key.

9.1 Example investigation

Assume the sender reports successful protection and the receiver rejects every received PDU.

A disciplined investigation would proceed as follows:

  1. Confirm that both ECUs use the same intended software and configuration baseline.
  2. Compare the authentic PDU length and protected bit range.
  3. Compare the configured security-field positions and secured-PDU length.
  4. Confirm that both endpoints use compatible profile inputs and authenticator truncation.
  5. Inspect freshness state and reconstruction using approved diagnostic instrumentation.
  6. Confirm that the intended key references are active in the correct test environment.
  7. Check whether a gateway or routing transformation changes any protected field.

This order helps isolate configuration and data-path problems before changing cryptographic settings. Do not attempt to solve a mismatch by weakening authentication or freshness acceptance criteria.

This example describes a debugging method, not a universal AUTOSAR PDU format. Confirm the actual data model and generated configuration for the selected release and project.

10. Practical debugging workflow

When SecOC authentication fails, use a repeatable process rather than changing multiple configuration parameters at once.

  1. Capture the secured PDU: record exact bytes, timestamp, channel and communication context.
  2. Confirm endpoint configuration: compare software versions, PDU mapping and protection-profile configuration.
  3. Check protected-data definition: verify authentic PDU, length, bit positions and profile-defined inputs.
  4. Inspect freshness behavior: compare sender progression, receiver state, reconstruction and reset handling.
  5. Verify cryptographic configuration: check algorithm/profile selection, key reference and lifecycle state without exposing secret material.
  6. Check routing and gateways: confirm protected fields are not modified, truncated or incorrectly repacked.
  7. Review rejection reporting: correlate configured receiver status/error reporting with the captured PDU.
  8. Change one variable at a time: repeat the same controlled test after each correction.

10.1 Symptoms and likely investigation areas

SymptomInvestigation area
Every message is rejectedProfile mismatch, key reference, PDU mapping or field-layout error
Failure begins after ECU resetFreshness persistence, initialization or resynchronization
Intermittent rejection under bus loadMessage loss, counter progression or receiver synchronization policy
Works in one software build but not anotherGenerated configuration, profile or key-lifecycle change
Payload looks correct but verification failsAuthenticated bit range, freshness input, byte ordering or authenticator truncation
Failure occurs only through a gatewayRouting, repacking or transformation of protected fields
Cryptographic request fails before verificationService configuration, driver availability, key access or job/resource handling

These are diagnostic starting points, not definitive root-cause mappings.

10.2 Example fault-isolation record

For each failed test, record a traceable evidence set:

EvidenceRecord
Test identifierUnique test-case ID and software baseline
CommunicationChannel, PDU identity and timestamp
Received dataSecured-PDU bytes from an approved trace
ConfigurationSender/receiver configuration versions
FreshnessApproved state snapshot and receiver decision
Cryptographic serviceJob/result status and key reference, without secret values
OutcomeAccepted/rejected and associated diagnostic status
Change madeOne controlled configuration or software change

This makes failures reproducible and prevents sensitive cryptographic information from entering ordinary reports.

11. Verification and test cases

A useful SecOC test plan should cover normal operation, negative cases, state transitions and recovery.

Test caseStimulusExpected result
Valid secured PDUCorrect data, authenticator and expected freshnessAccepted and authentic data delivered
Protected payload modifiedChange a protected payload bitAuthentication fails; data is not accepted as authentic
Authenticator modifiedChange an authenticator bitVerification fails
ReplayRe-send a previously valid secured PDURejected according to configured freshness policy
Stale freshnessProvide freshness outside permitted acceptance policyRejected or handled according to defined synchronization policy
Message gapDrop one or more transmissionsReceiver follows specified gap-handling behavior
Sender/receiver restartRestart one or both endpointsFreshness recovery follows defined reset strategy
Profile mismatchUse intentionally incompatible test configurationVerification fails safely
Key unavailableUse a controlled test setup with unavailable/invalid key stateDefined error handling occurs; no insecure fallback
Gateway forwardingForward a protected message through configured gatewayProtected fields remain valid, or protection is terminated and re-established by design
Rollover boundaryExercise configured freshness boundary in a controlled testSender and receiver handle rollover as specified
Key updatePerform approved key lifecycle transitionCommunication follows defined activation and transition behavior

Define acceptance criteria before executing tests. A rejection is not necessarily a defect: it may be the intended security response.

11.1 Test execution precautions

  • Use approved test keys and a controlled bench or simulation environment.
  • Never use production secret keys in ordinary development scripts or reports.
  • Keep sender, receiver and test-tool configuration baselines traceable.
  • Preserve raw traces securely and redact sensitive information before sharing.
  • Verify both the security decision and the application-visible behavior.
  • Include startup, message-loss, rollover and recovery scenarios, not only nominal cyclic traffic.

12. Common engineering mistakes

  • Treating the freshness field as an ordinary application signal.
  • Assuming that SecOC encrypts the application payload.
  • Using different protection-profile settings at sender and receiver.
  • Ignoring the effect of truncated freshness or authenticator fields.
  • Failing to define behavior for ECU reset, message loss and resynchronization.
  • Assuming a gateway can modify a protected PDU without invalidating its authenticator.
  • Logging secret keys or sensitive cryptographic intermediate values.
  • Treating a successful nominal test as sufficient evidence of replay protection.
  • Copying configuration or API assumptions from a different AUTOSAR release without checking compatibility.
  • Weakening freshness or authentication checks to make an integration test pass instead of finding the underlying mismatch.

13. Integration review checklist

Before releasing a SecOC-protected communication path, confirm that:

  • Authentic and secured PDU mappings are consistent at both endpoints.
  • Protected data and profile-defined authentication inputs are identical.
  • Algorithm, authenticator length and truncation settings match.
  • Freshness transmission, reconstruction, persistence and reset behavior are defined.
  • Key references and key lifecycle procedures are validated.
  • Cryptographic service integration and error handling are verified.
  • Gateway behavior preserves or correctly re-establishes protection.
  • Negative tests cover modified payloads, modified authenticators and replay attempts.
  • Startup, rollover, message-loss and recovery scenarios are tested.
  • Logs and test reports do not expose secret key material.
  • Implementation is checked against the project's selected AUTOSAR release and OEM security requirements.

14. Frequently asked questions

Does SecOC provide encryption?

No. SecOC's primary purpose is message authenticity, integrity and freshness protection. Confidentiality requires a separate mechanism where it is needed.

Why can a correct application payload be rejected?

Verification depends on more than the visible payload. Freshness state, protected-data boundaries, profile inputs, key reference, authenticator length and field layout must also match.

Does SecOC always transmit the complete freshness counter?

No. A configured representation may transmit only part of the freshness information. The receiver may reconstruct the full value using its state and the received bits.

Can a gateway forward a SecOC-protected PDU?

It can forward protected data if the architecture preserves the authenticated fields and end-to-end protection remains valid. If a gateway modifies protected data, the original authenticator will generally no longer validate. The architecture must define where protection is terminated and re-established.

What is the role of CSM, CryIf and the Crypto Driver?

They are commonly used elements of the AUTOSAR Classic cryptographic service architecture. Their exact interfaces and configuration must be checked against the selected release and supplier implementation.

Are SecOC APIs and configuration identical across AUTOSAR releases?

No. Consult the exact release's SecOC and cryptographic-service specifications, generated configuration documentation and OEM requirements.

Related articles

References and further study

For implementation work, consult the AUTOSAR SecOC specification for the project's selected release, together with the relevant cryptographic-service specifications, generated configuration documentation and OEM security profile. Use the project baseline as the authority for exact field sizes, interfaces, algorithms, freshness handling and error behavior.