Author Topic: Unable to figure Checksum algo!  (Read 1811 times)

0 Members and 1 Guest are viewing this topic.

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Unable to figure Checksum algo!
« on: March 07, 2018, 01:38:25 am »
Hi,

This is the array: {0x0A, 0x41, 0x31, 0x36, 0x34, 0x40, 0x40, 0x35, 0x30, 0x45, 0x68}
The last byte is the checksum.
The first byte is is the length of the payload including the checksum.

I cannot find the checksum algorithm that is used here... Anyone got a clue?
 

Offline oskugbg

  • Newbie
  • Posts: 1
  • Country: se
Re: Unable to figure Checksum algo!
« Reply #1 on: March 07, 2018, 01:56:04 am »
Do you have another example?
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Unable to figure Checksum algo!
« Reply #2 on: March 07, 2018, 02:08:47 am »
If you're reverse engineering, you need a few examples.

Some are as simple as "make the checksum such that summing the whole buffer and ignoring carry ends up at <some constant>". Others transpose bits or do some other operation.

If you can force a known "plaintext", it's easier, just change a single bit at a time and see what changes in the checksum. Otherwise, hope for a simple sum-and-mod.
 

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Re: Unable to figure Checksum algo!
« Reply #3 on: March 07, 2018, 02:30:39 am »
I tried the usual ones, but none of them worked. I can make some more examples, it's a bit annoying since I have to to some bit manipulations first...

First I need to make all 00 to 0 and 11 to 1 since my spectrum analyzer won't allow me enlarge the IF BW so I must double sample all symbols.
Then I must do manchester decoding.
I just used some online tools, but I must write this into a script to get some more data.

What I am trying to do is to reverse engineering ER400TS from LPRS used in an old product so I can use my newer cc1101 as the transmitter.
So far I have found the OTA preamble pattern, sync word, symbol rate and freq. deviation.
 

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Re: Unable to figure Checksum algo!
« Reply #4 on: March 07, 2018, 03:03:41 am »
Having a further look into the datasheet, they added a new CRC16 and also saying it could replace their normal crc8.
So I assume if all the bytes are put into a CRC8 calculator it would produce 0 as the result, this could be the starting point for finding the
initial values etc. Perhaps there is some tool that will try all combinations and search for 0 result...
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2417
  • Country: us
Re: Unable to figure Checksum algo!
« Reply #5 on: March 07, 2018, 03:45:57 am »
Assume is a bad word when dealing with unknowns. Try 1 byte and 2 byte payloads and see what comes out. Try payload values of 0x00 or 0xFF. If you get it to work for simple cases, THEN try longer examples to verify you got it right.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Unable to figure Checksum algo!
« Reply #6 on: March 07, 2018, 08:29:49 am »
It doesn't appear to match any normal CRC8,

I find it very odd that the datasheet doesnt actually specify the exact CRC used.
 

Offline nfmax

  • Super Contributor
  • ***
  • Posts: 1604
  • Country: gb
Re: Unable to figure Checksum algo!
« Reply #7 on: March 07, 2018, 09:02:10 am »
Perhaps there is some tool that will try all combinations and search for 0 result...

There is: http://reveng.sourceforge.net

And a wonderful tool it is too. I found it while I was trying to reverse-engineer a wireless energy monitor radio packet format, just the other day.
 

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Re: Unable to figure Checksum algo!
« Reply #8 on: March 07, 2018, 02:59:28 pm »
I will look into it. Anyway, I asked the LPRS directly, and they said it was proprietary - their CRC8 calculation...
If they do some extra bit manipulations I guess it will be hard to figure it out.
 

Offline nfmax

  • Super Contributor
  • ***
  • Posts: 1604
  • Country: gb
Re: Unable to figure Checksum algo!
« Reply #9 on: March 07, 2018, 06:04:32 pm »
The reveng tool can also exhaustively search all possible polynomials if you know the size of the CRC data. It checks the big/little endianness and the initial value & final XOR values too.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf