0

I have the following problem. Besides CAN itself having a full checksum and stuff in the protocol, I have data sets where the first byte of the CAN message is some checksum generated in some unknown way and the second byte is some kind of counter. I have some examples and I am trying to find out how to calculate that first byte if I modify any data in the payload (bytes 3 through 8 of the CAN message).

How to read the data:

timestamp canid length byte1 byte2 byte3 byte4... byte8

I already verified that both the CAN ID and the length (total number of bytes) have an influence on the checksum, the time does not, so you can ignore the leading number (50.533 for example)

DATA SET 1:

50.533 492      3 39 00 00                
50.633 492      3 37 01 00                
50.732 492      3 25 02 00                
50.831 492      3 2B 03 00                
50.931 492      3 01 04 00                
51.030 492      3 0F 05 00                
51.130 492      3 1D 06 00                
51.229 492      3 13 07 00                
51.329 492      3 49 08 00                
51.428 492      3 47 09 00                
51.527 492      3 55 0A 00                
51.627 492      3 5B 0B 00                
51.726 492      3 71 0C 00                
51.826 492      3 7F 0D 00                
51.925 492      3 6D 0E 00                
52.025 492      3 63 0F 00                

DATA SET 2:

11.270 3C0      4 66 00 00 00             
11.369 3C0      4 D3 01 00 00             
11.469 3C0      4 23 02 00 00             
11.568 3C0      4 96 03 00 00             
11.668 3C0      4 EC 04 00 00             
11.767 3C0      4 59 05 00 00             
11.867 3C0      4 A9 06 00 00             
11.966 3C0      4 1C 07 00 00             
12.066 3C0      4 5D 08 00 00             
12.166 3C0      4 E8 09 00 00             
12.266 3C0      4 18 0A 00 00             
12.365 3C0      4 AD 0B 00 00             
12.465 3C0      4 D7 0C 00 00             
12.564 3C0      4 62 0D 00 00             
12.664 3C0      4 92 0E 00 00             
12.763 3C0      4 27 0F 00 00             

DATA SET 3:

25.462 3C0      4 9B 00 23 00             
25.561 3C0      4 2E 01 23 00             
25.661 3C0      4 DE 02 23 00             
25.760 3C0      4 6B 03 23 00             
25.860 3C0      4 11 04 23 00             
25.960 3C0      4 A4 05 23 00             
26.059 3C0      4 54 06 23 00             
26.159 3C0      4 E1 07 23 00             
26.258 3C0      4 A0 08 23 00             
26.358 3C0      4 15 09 23 00             
26.458 3C0      4 E5 0A 23 00             
26.557 3C0      4 50 0B 23 00             
26.657 3C0      4 2A 0C 23 00             
26.756 3C0      4 9F 0D 23 00             
26.856 3C0      4 6F 0E 23 00             
26.955 3C0      4 DA 0F 23 00          

As you can see, data sets 2 and 3 only differ by that 0x23 byte in data spot 3 and the checksum is completely different for all 16 counter positions.

Anyone got a hint? I already tried reveng but could't come up with anything :(

4
  • Please post the entirety of the messages, as many as you can. Apr 25 at 3:08
  • That's all I have. After that they repeat. Like the counter restarts after 0F goes back to 00 and the checksums repeat. So I only posted unique messages, not any repeats.
    – Stefan
    Apr 26 at 8:09
  • Your messages are 5 or 6 bytes, what are the missing bytes for each? The 5 byte messages, for example? Zeros? Apr 26 at 15:12
  • No there aren't any other bytes. In CAN BUS there can be a 4 byte message like this: 3C0 4 9B 00 23 00 it means time ID 3C0, 4 bytes length and then there are the 4 bytes. I did not omit any data :)
    – Stefan
    Apr 28 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.