Many diagnostic operations can change an ECU's configuration, behavior or software. Examples include writing protected data, executing restricted routines and programming ECU memory. These operations should not be available to every diagnostic client without authorization.

The UDS SecurityAccess service (SID 0x27) provides a standardized diagnostic exchange through which an ECU can grant a configured level of security access. A common implementation uses a seed-and-key challenge-response procedure.

This article explains the service structure, request sequence, security levels, negative responses, tester implementation and practical validation. It also explains what UDS does not define: the actual seed-to-key algorithm and the secret material remain specific to the vehicle manufacturer's security design.

1. Why is SecurityAccess required?

An ECU may expose diagnostic functions that are safe for ordinary service operations and other functions that require additional authorization.

Examples of operations that may be protected include:

  • ECU reprogramming.
  • Writing selected configuration or coding data.
  • Executing restricted routines.
  • Accessing selected memory areas.
  • Changing calibration values.

SecurityAccess helps an ECU decide whether a diagnostic tester has been granted a configured access level. It is only one part of a complete cybersecurity design. It does not replace secure boot, software integrity verification, secure communication, authorization policy, key management or other vehicle cybersecurity controls.

Important: A successful SecurityAccess exchange confirms that one configured diagnostic access procedure succeeded. It does not prove that the ECU or vehicle is secure as a whole.

2. What is the seed-key mechanism?

A common SecurityAccess procedure has two main stages:

  1. The tester requests a seed from the ECU for a configured security level.
  2. The tester calculates a key using an authorized, ECU-specific algorithm and submits it to the ECU.

The ECU validates the submitted key. If it is accepted, the ECU grants the configured security access level.

The seed is a challenge value. It is not itself the secret key. The key calculation algorithm and secret material are not one universal public formula defined for every ECU by UDS.

The actual implementation may also include:

  • A required diagnostic session.
  • Vehicle-state preconditions.
  • An attempt counter.
  • A delay or lockout policy.
  • Security-level-specific permissions.
  • Relocking behavior after reset, session changes or other configured events.

3. SecurityAccess request structure

The service identifier is 0x27. A sub-function identifies the requested operation and security level.

A common convention is:

  • An odd sub-function requests a seed.
  • The following even sub-function sends the corresponding key.

For example, an ECU project may configure sub-function 0x01 to request a seed and 0x02 to submit the corresponding key.

This odd/even pairing is a common pattern, not a substitute for the ECU diagnostic specification. The actual supported sub-functions, security-level mapping and request/response lengths must be obtained from the ECU definition.

Request format

A simplified seed request:

27 01

A simplified key-send request:

27 02 <key bytes...>

The bytes shown are illustrative. The key length and permitted sub-functions are ECU-specific.

4. Seed request and positive response

The tester sends a seed request:

Tester -> ECU: 27 01

A positive response begins with 0x67 and includes the echoed sub-function and seed data:

ECU -> Tester: 67 01 <seed bytes...>

Interpretation:

  • 0x67 — positive response SID for request 0x27.
  • 0x01 — echoed seed-request sub-function.
  • Remaining bytes — seed data, with length and interpretation defined by the ECU implementation.

The tester should:

  • Confirm the intended security level and request sub-function.
  • Validate the response SID and echoed sub-function.
  • Validate the seed length.
  • Preserve the specified byte order and data representation.
  • Use only the approved algorithm for that ECU and security level.
  • Observe the applicable timing and attempt policies.

Zero-seed behavior

Some UDS implementations use an all-zero seed to indicate that the requested security level is already unlocked. A tester must interpret this only according to the applicable ISO 14229 edition and ECU diagnostic profile. Do not assume that every zero-valued seed has the same meaning across all implementations.

5. Key calculation and submission

After receiving the seed, the tester's authorized security component calculates the key. The tester then sends the key using the paired sub-function.

Example:

Tester -> ECU: 27 02 <key bytes...>

A positive response begins with:

ECU -> Tester: 67 02

A positive response indicates that the requested SecurityAccess operation was accepted. The tester should then proceed only with the operation authorized by that access level and the ECU's other preconditions.

The key calculation must be implemented and controlled according to the vehicle manufacturer's security process. Do not use guessed formulas, publicly shared keys or generic seed-to-key assumptions on a production ECU.

What UDS standardizes — and what it does not

Defined by the UDS serviceDefined by the ECU/OEM security implementation
Service identifier and request/response frameworkSeed-to-key algorithm
Sub-function-based service operationSecret key material and provisioning
Positive and negative response structureSecurity-level permissions
Diagnostic exchange behaviorAttempt limits and configured delay policy
Applicable protocol timing behaviorProject-specific preconditions and recovery process

This separation is essential when developing a tester. A generic UDS stack can implement the service exchange, but it cannot legitimately invent the ECU's key algorithm or credentials.

6. Security levels and diagnostic sessions

An ECU can define multiple security levels for different groups of protected functions.

For example, a project may use one level for a restricted diagnostic routine and another for programming operations. The actual meaning of each level is defined by the ECU diagnostic specification.

Security level is not the same as diagnostic session:

  • Diagnostic session: determines the diagnostic operating context and which services or behaviors are available.
  • Security access level: determines whether a configured protected access permission has been granted.

An ECU may require a specific session before it accepts a SecurityAccess request. It may also require additional vehicle-state conditions.

A typical sequence could be:

10 03        Enter Extended Diagnostic Session
27 01        Request seed for configured level
67 01 ...    ECU returns seed
27 02 ...    Submit calculated key
67 02        ECU accepts the key

This is an illustrative sequence. The required session and sub-functions must be verified for the target ECU.

7. Negative responses and lockout behavior

Common negative response codes relevant to SecurityAccess include:

NRCNameGeneral meaning
0x12subFunctionNotSupportedRequested sub-function is not supported
0x13incorrectMessageLengthOrInvalidFormatRequest length or format is invalid
0x22conditionsNotCorrectRequired ECU or vehicle conditions are not met
0x24requestSequenceErrorRequest is not valid in the current sequence
0x33securityAccessDeniedSecurity access is denied
0x35invalidKeySubmitted key is invalid
0x36exceedNumberOfAttemptsConfigured attempt limit has been exceeded
0x37requiredTimeDelayNotExpiredRequired delay has not elapsed

The exact response depends on the failure condition, standard edition and ECU implementation.

Example: invalid key

Tester -> ECU: 27 02 <incorrect key>
ECU -> Tester: 7F 27 35

Interpretation:

  • 0x7F — negative response.
  • 0x27 — original request service.
  • 0x35 — invalidKey.

Attempt counters and delay behavior

An ECU may implement attempt counters and delay periods to limit repeated guessing. After a configured number of invalid attempts, it may reject further attempts or require a delay before another attempt is accepted.

A tester should not repeatedly retry keys without understanding the ECU's attempt counter and lockout behavior. Doing so may trigger a delay or temporary denial of access.

The attempt policy, persistence across resets and recovery procedure are project-specific. Validate them only with an approved test plan and an agreed recovery procedure.

8. Tester-side SecurityAccess state machine

A robust tester should model SecurityAccess as a stateful sequence rather than sending isolated requests without tracking context.

Rendering diagram...

The diagram is conceptual. The exact state transitions, persistence and relocking rules must match the ECU specification.

Recommended tester sequence

  1. Select the configured security level for the intended operation.
  2. Confirm the required diagnostic session and ECU preconditions.
  3. Send the seed request using the configured sub-function.
  4. Validate the response SID, echoed sub-function and seed length.
  5. Interpret a zero seed only according to the applicable standard and ECU profile.
  6. Obtain the key only through the authorized project security component.
  7. Send the key using the paired sub-function and correct length.
  8. Validate the positive response or classify the NRC.
  9. Do not retry blindly after a failed attempt; apply the ECU's delay and attempt policy.
  10. Record the result without exposing secret key material.

Tester implementation checks

  • Validate the response SID and sub-function before using the seed.
  • Handle transport errors separately from UDS negative responses.
  • Apply the correct request/response timing.
  • Prevent a stale seed from being reused outside the allowed sequence.
  • Associate each seed request and key submission with the intended ECU and security level.
  • Avoid concurrent SecurityAccess sequences to the same ECU unless the implementation explicitly supports them.
  • Track session changes, ECU resets and configured relocking behavior.

9. SecurityAccess testing considerations

Validate more than the successful path. A useful test plan includes:

Test caseExpected validation
Supported seed requestCorrect positive response and seed length
Unsupported security sub-functionAppropriate negative response
Incorrect request lengthRequest format rejected
Invalid keyAccess not granted; expected NRC behavior
Key without preceding seed requestSequence handling verified
Key for the wrong security levelCorrect level/sequence behavior
Repeated invalid attemptsAttempt counter and delay policy verified
Request in unsupported sessionSession dependency enforced
Required vehicle conditions not metPreconditions enforced
ECU reset during or after accessState and relocking behavior verified
Session timeout/changeAccess state behaves as specified
Zero seed responseTester interprets it according to the ECU profile

Test lockout and attempt-counter behavior carefully. Use an approved development ECU, test credentials and recovery process. Avoid running brute-force or uncontrolled retry tests against production vehicles.

10. Security engineering best practices

A seed-key exchange should not be treated as a complete cybersecurity solution.

A robust ECU security design should also consider:

  • Strong, appropriately designed cryptographic mechanisms.
  • Secure generation and handling of challenge values.
  • Protection of secret keys and provisioning processes.
  • Rate limiting and attempt monitoring.
  • Secure diagnostic access over external interfaces.
  • Authentication and authorization policy.
  • Secure boot and software integrity.
  • Security event logging where required.
  • Lifecycle management of credentials and keys.

For tester and tool developers:

  • Never hard-code production keys in test scripts or source repositories.
  • Do not print seed/key material into ordinary test reports or logs.
  • Separate development credentials from production credentials.
  • Protect the key-derivation component and its inputs.
  • Restrict access to security plug-ins, libraries and configuration.
  • Define credential rotation, revocation and lifecycle handling with the OEM.
  • Test reset, power-loss and session-transition behavior.

The design should be assessed against the vehicle's cybersecurity requirements and applicable standards and processes, including the relevant ISO/SAE 21434 engineering activities.

11. Common misconceptions

UDS defines one standard seed-key algorithm for every ECU.
No. The service defines the diagnostic exchange; the ECU/OEM security implementation defines the algorithm and secret material.

Entering Extended Session unlocks all protected functions.
No. Session selection and security access are separate controls.

A positive SecurityAccess response means the whole ECU is secure.
No. It confirms a particular configured access procedure, not the security of the entire ECU.

A failed key can be retried indefinitely.
Not necessarily. The ECU may enforce attempt limits and delay behavior.

Every odd sub-function can be paired with the next even value on every ECU.
Do not assume this. The supported sub-functions and their mapping must be taken from the ECU diagnostic specification.

12. Key takeaways

  • SecurityAccess uses SID 0x27.
  • A common procedure requests a seed and submits a calculated key.
  • Odd/even sub-function pairing is common, but exact support is ECU-specific.
  • The key algorithm and secret are not universal UDS values.
  • Diagnostic session and security access level are separate controls.
  • Attempt counters, delays and lockout behavior must be handled correctly.
  • SecurityAccess is only one element of ECU cybersecurity.
  • Tester implementations should protect credentials and avoid exposing seed/key material in logs.

13. Check your understanding

  1. Which SID is used for SecurityAccess?
  2. What does the ECU provide when a seed is requested successfully?
  3. Does ISO 14229 define one universal seed-key algorithm for all ECUs?
  4. What is the difference between a diagnostic session and a security level?
  5. What does NRC 0x35 indicate?
  6. What may happen after repeated invalid key attempts?
  7. Why should a tester avoid logging production key material?
  8. Why must the tester validate the seed response before calculating a key?

Answers

  1. 0x27.
  2. A seed value for the requested supported security level, subject to the ECU's response definition.
  3. No. The algorithm and secret material are defined by the ECU/OEM security implementation.
  4. A session controls the diagnostic operating context; a security level controls configured protected access.
  5. invalidKey.
  6. The ECU may reject further attempts or enforce a delay, according to its implementation.
  7. Logs can expose sensitive credentials or security-related material and should follow the project's information-protection policy.
  8. To confirm the response belongs to the expected service and level and that the seed length and format are valid.

Related UDS articles

References and further reading

Standards note: ISO 14229-1:2026 (Edition 4, published June 2026) is the current published application-layer edition at the time this article was reviewed. Existing ECU programs may be contractually based on earlier editions. Always follow the project/OEM diagnostic specification and identify the exact edition used for conformance.