4

My USB-RFID reader receives a 24 bit ID from the card. I can convert this ID into 8 bit/16bit format. But how can I convert it into 40 bit format?

Example for one tag:

  • 24 bit decimal format (as I get from the reader): 0005966009
  • 8,16 bit binary format (converted via Python): 01011011, 0000100010111001
  • 8,16 bit decimal format (converted via Python): 91, 2233
  • 40 bit decimal format (provided by the manufacturer): 455272499385

How can I get that 40 bit number from the 24 bit number?

Tag standard: unique, 125 kHz

Screenshot from manufacturer's system:

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
AvS
  • 161
  • 1
  • 2
  • 10
  • Why the decimal you get from *usb reader* and from *python* are not the same?..or are those two different values? – Iron Fist Jan 03 '16 at 17:54
  • they are the same but manufacturer divided them into two segments : 8bit : 91 (01011011bin) and 16bit : 2233 (0000100010111001bin). When you merge those two segments you have :010110110000100010111001bin what is 0005966009 in decimal – AvS Jan 03 '16 at 19:11
  • There is a stcker on the card from manufacturer and there are those numbers : 91,2233 and in next line : 455272499385. Database that i have to use store number 455272499385 and my usb reader recive 0005966009 so there must be a trick to convert this 24bit decimal to 40bit decimal... – AvS Jan 03 '16 at 19:23
  • What makes you think that `455272499385` is the 40bit equivalent to `0005966009` in 24bit format? – Iron Fist Jan 03 '16 at 21:55
  • Plus Can you clarify why `455272499385 ` is 40bit and `0005966009 ` is 24bit format? – Iron Fist Jan 03 '16 at 22:00
  • I added a screen shot from system provided by the manufacturer. There are all of those numbers (40bit, 24bit, 8,16bit). I think 40bit number is generated from 24bit number + some additional information ( I hope it is some kind of standard for RFID cards? ) – AvS Jan 04 '16 at 08:05
  • Read about these numbers [here](http://www.idautomation.com/barcode-faq/rfid/) – Iron Fist Jan 04 '16 at 13:57

1 Answers1

3

No, in general it's impossible to turn a 24 bit number into a 40 bit number. Such a conversion would imply that you add 16 bits of extra information to the 24 bit value. This extra information won't just magically appear out of nowhere.

In your case, the numbers are

  • 24 bit format: 0005966009dec = 5B08B9hex
  • 8+16 bit format: 091dec & 02233dec = 5Bhex & 08B9hex
  • 40 bit format: 455272499385dec = 6A005B08B9hex

Thus, all three numbers contain 24 common bits (5B08B9hex). The 40 bit number has an additional prefix value of 6A00hex.

Since you did not reveal what RFID system and what tags you are using (other than that they are operating on 125 khz), it's impossible to tell if that prefix is some standard prefix that is the same for all tags or if that prefix changes for every tag (or every manufacturer, customer, etc.)

If the prefix is the same for all your tags, you could easily use the value 6A00hex as the upper 16 bits of each tag serial number. However, if the prefix may be different for different tags, then there is no other way than to get a reader that reads that full 40 bit serial number.

Nevertheless, if all your readers only read the 24 bit value, I don't see why you would even want to use the whole 40 bit value. Even if you already have a database that contains the whole 40 bit value, you could easily trim that value to a 24 bit value (as long as the lower 24 bits are (sufficiently) unique across all your tags).

Michael Roland
  • 39,663
  • 10
  • 99
  • 206