Research, development and trades concerning the powerful Proxmark3 device!

You are not logged in.

- Topics: Active | Unanswered

- Index
- » Legic
- »
**Storage CRC**

Pages: **1**

**Szakalit****Member**- Registered: 2012-03-29
- Posts: 3

Hello

Does anybody know how to calculate "Storage CRC" for example CRC of UID ??

Thank You

Offline

**Szakalit****Member**- Registered: 2012-03-29
- Posts: 3

Hello

Ok i know how to calculate storage CRC8 and CRC16 i someone will need that pm me.

Bye

Offline

**rule****Administrator**- Registered: 2008-05-21
- Posts: 416

Can you paste the polynomial, or your example code that generates the correct CRC?

Or is this covered in this paper, which was published by Henryk and Karsten?

Offline

**Szakalit****Member**- Registered: 2012-03-29
- Posts: 3

Hello

Yes "Storage" CRC8 polynomial is correct in this document (0xC6 - in reverse) and initial value is 0x55

And for CRC16 polynomial is 0xB400 (in reverse) and initial value is word constructed from UIDCRC for example:

UIDCRC id 0x78 (in reverse) the initial will be 0x7878

I don't have Proxmark but I'm writing reader/writer/emulator on dsPIC30 and now code for calculating this CRC i have in Pascal (Delphi) if someone will need some help write me ill try to help.

Also im fixing Proxmark code because it have some bugs like in "legic_prng_forward":

now it is:

lfsr.a = lfsr.a >> 1 | (lfsr.a ^ lfsr.a >> 6) << 6;

but it have to be:

lfsr.a = (lfsr.a >> 1 | (lfsr.a ^ lfsr.a >> 6) << 6) & 0x7F;

So it will generate valid decode stream and it will work not only with 0x55 RAND value.

Offline

**michiww****Member**- Registered: 2012-04-11
- Posts: 1

Hi Szakalit,

and how do you calculate the storage CRC of the UID now?

Thanks and best regards!

Offline

Pages: **1**

- Index
- » Legic
- »
**Storage CRC**