Enhancing Security in UDS Seed-Key Exchange: Best Practices and Implementation Strategies

Muhammet Kalaycı
3 min readApr 22, 2023

A series of network communications known as a seed-key exchange is used in the automobile sector to confirm that a diagnostic tool is in communication with an electronic control unit (ECU). When diagnostic software wishes to adjust safety or emissions-related elements of the ECU, the seed-key exchange procedure is employed.

UDS Service-27 seed-key exchange

This strategy will guarantee that the challenge is unique each time, making this procedure less susceptible to listening in. However, more serious security problems (such session hijacking) continue to exist and go unresolved.

The measures we take to demonstrate to the device we are speaking to that we should have some higher degree of access are what we truly mean when we talk about seeds and keys. There may be internal data that, although not being frequently accessed, we do occasionally wish to be able to access. We might wish to manually operate our device’s outputs to test basic operation, but this could circumvent safety measures. Perhaps we wish to modify the complete program that is now active on our device.

What is a Seed, What is a Key?

Service flow for security access: The client asks the server for the “seed” it needs to unlock anything. The “seed” is returned to the client as a response from the server. The client then uses the “seed” to create a “key” and transmits it to the server.

Seed: A response key is generated by the testing equipment (diagnostic tool) using a seed, which is a random challenge value supplied by the ECU. Typically, the Seed value is a 4-byte random number.

Key: The response value known as Key is produced by the testing apparatus using the seed value and a secret key that is kept inside the apparatus. The ECU receives the Key value and checks it before granting access to the requested service.

UDS Seed-Key exchanges commonly use OEM-specific values that are not publicly accessible. Accessing these values requires access to the manufacturer’s documentation or proprietary diagnostic tools. Attempting to bypass the security measures implemented by the ECU could be illegal and dangerous.

Ideally, UDS Seed-Key exchange could be made more secure by:

  1. Using longer and more complex keys to make guessing or brute-forcing the key harder. Strong cryptographic algorithms can make the Seed-Key exchange procedure more challenging to manipulate or reverse-engineer.
  2. Implementing rate-limiting and throttling to delay attempts and limit the number of Seed-Key exchanges. This can help thwart brute-force attacks.
  3. Implementing secure key storage and transmission. Diagnostic tools should store keys securely, guarding them against unauthorized access and disclosure. Keys should also be transmitted securely through the communication channel to prevent interception or tampering.
  4. Implementing authentication and authorization methods. Authentication and authorization mechanisms can provide an additional layer of security on top of Seed-Key exchange. Examples include access control lists, digital signatures, and certificates.
  5. Regularly updating and patching the system to address known vulnerabilities and improve overall security.

There is always a trade-off between security and usability, and it’s crucial to remember that no security mechanism is infallible. Therefore, it’s crucial to carry out a risk analysis and create a comprehensive security strategy with various levels of defense.

When implementing a UDS Seed-Key exchange, consider the following suggestions:

  • Use reliable cryptographic algorithms such as AES or SHA-256 to generate the key from the seed value. Avoid using obsolete or weak algorithms such as MD5 or DES.
  • Use longer keys with high entropy, ideally 128-bit or higher. Consider using a combination of random and non-random data to generate the seed value.
  • Implement rate-limiting and throttling to stop brute-force attacks. Lock out testers after a predetermined number of unsuccessful attempts.
  • Update the system regularly with the latest security updates and bug fixes to address known vulnerabilities.

Stay Secure!

Sources:
- ISO 14229–1 and 2 — Road vehicles — Unified diagnostic services (UDS)

--

--

Muhammet Kalaycı

Software Engineer. Automotive, software, cybersecurity, and philosophy. https://bio.link/muhammetk "You are destined to do great things."