Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is this data from a magnetic card encoded?

I have some information about magnetic cards that control the building access, and need to reverse engineer the way the software stores data on the cards to make something with more features. (We have lost contact with the original programmer.)

I have no idea how writing the order is done; I'm no magnetic card expert. I know a few things:

  • Data is on the third track.
  • all readers are standalone and have batteries.
  • There is a master card that can add or remove some cards for a reader(currently, you need to go through all the doors to add or remove a card from the system).
  • Each card is different, and must have a unique identifier.
  • There is a expiration date, but I have no idea if it's a date format or just a number incrementing in the door readers.
  • There is a "flag" which gives access to special places (parking) and it isn't affected by the expiration date... weird.

I've got a reader and some software to read it. It gives me hexadecimal numbers. As example here is a few cards I've got.

  1. BAC716863B8CB32832BABAB40E1739BAB677563B3AF8BA3ABABABEBABABABABABAC0 (card with parking)

  2. BDC011813CB9B4CBB53DBDB21FD2BCBDBEEA3EBDBDFFBD3DBDBDB1BDBDBDBDBDBDC0 (card with parking)

  3. 9DE031A11CA9912E951D9D9225369D1D9FCE6C9D1DDF9D1D9D9D9D9D9D9D9D9D9DC0 (normal card, no special access)

I just hope it's not secured by anything that could make this impossible to reverse-engineer.

like image 263
Frederic Avatar asked Nov 14 '22 00:11

Frederic


1 Answers

This question comes up high on google, i experienced a similar issue and solved it.

Data on magnetic card encoded in ANSI/ISO ALPHA Data Format (on Track 1) and ANSI/ISO BCD Data Format (on Track 2 and 3). Most magnetic card readers decode this data before returning so you don't have to but some reader don't and here we are.

You can find encoding table and more information here: http://www.abacus21.com/Magnetic-Strip-Encoding-1586.html

like image 157
Fatih Avatar answered Jan 30 '23 09:01

Fatih