Ask Your Question
0

How to build an USB driver and data extractor (Magnetic Card Reader)? [Python, Ruby]

asked 2012-10-23 20:58:10 -0500

Jmlevick gravatar image

updated 2014-09-28 17:10:22 -0500

mether gravatar image

So I have this magnetic card reader (generic) I bought from the internet (it's chinesse) the problem is it has a manual but it is in chinesse (hahhaha) So I don't understand it... I have two Linux Machines (one Ubuntu and one Fedora) and if you plug it via USB, it powers on and if you pass a card (with a text editor open) You get a code/string somewhat like this one:

1303031110012015¿999999999999999

Obviously there is the Card info somewhere (that's a cinema affiliation card) and what I want to do is to extract the info (like owner's name and other data for example) from that number, if I run lsusb I get something like this:

Reader Unplugged:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b293 Chicony Electronics Co., Ltd 
Bus 007 Device 003: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth

Reader Plugged:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b293 Chicony Electronics Co., Ltd 
Bus 007 Device 003: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth
Bus 005 Device 005: ID 05fe:1010 Chic Technology Corp. Optical Wireless

And I know some Python and Ruby (More ruby than python), but I don't know where to start... It would be great if some one can point me in the right direction.. ¿Can you? (it would be great to have a cross-platform driver for Windows, Linux and Mac).

Thanks.

P.S. This is the Card Reader I bought: http://dx.com/p/usb-universal-magnetic-stripe-credit-debit-card-bidirectional-track-2-swipe-reader-75-210bpi-25053

edit retag flag offensive close merge delete

Comments

The data is decoded by the system you feed the characters to; I'd guess that's really all that is stored on that card. Magnetic stripe cards don't hold very much data, it's computers that find the numbers meaningful.

randomuser gravatar imagerandomuser ( 2014-10-10 01:27:11 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-10-10 01:17:34 -0500

dnozay gravatar image

updated 2014-10-10 01:20:50 -0500

It is very much possible that what you are seeing is just an account number - some kind of database lookup may happen on the computer the cinema staff is using.

Per se, unless you are also hooked to their system, you won't know anything else other than an ID.

  • the card holds some identifying information (= a key that doesn't change),
  • the information that changes is stored in a database / some kind of ERP,
  • storing information that changes on the card means you would need to re-magnetize.

Obviously ...

  • protecting personal information would be a bigger hassle if it was stored on the card,
  • changing your balance would be way too easy if it was stored on the card and you could write to the card.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-23 20:58:10 -0500

Seen: 1,233 times

Last updated: Oct 10 '14