I am attempting to design a seed and key algorithm for an Engine Control Unit. This is used to secure resources such as the ability to reprogram the ECU. The idea is that I request a seed from the ECU, which it gives as a string of bytes. Both the ECU and I perform some secret calculation to transform the seed value into a key value. I then submit my calculated key to the ECU, and if it matches the ECU's calculation the resource is unlocked.

I have been looking around for an example calculation to derive my own from, but so far I have just come up with resources merely describing the concept as above. Does anyone have any concrete examples I could use?


This is done a number of different ways, and no way is perfect. Usually it involves a pre-shared key one way or another.

Here's an example from General Motors that uses a remote database (assumed secure) to match two values, an ECU ID and a challenge, to a corresponding key value or algorithm (a non-reversible algorithm like a modulus operator).

  1. The diagnostic PC sends a level 3 security access request
  2. The ECU responds with an ID and a pseudorandom challenge
  3. The diagnostic PC references the ID against a (remote?) database of ECUs and their security keys.
  4. The diagnostic PC (or server, as in the GM implementation) calculates and sends a response (e.g. key mod challenge)
  5. The ECU compares this to its own key mod challenge calculation and enters the desired run level if there is a match.

This approach will ensure that the challenge is different every time, which makes this process less vulnerable to eavesdropping. However, larger security issues remain that aren't addressed (such as session hijacking).

| improve this answer | |
  • Could you elaborate on the session hijacking security issue in this context? – Natto_Jihen Feb 3 at 14:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.