Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
1  
Not knowing anything about those scanners - the description on the dealextreme site says the device supports 75bpi and 210bpi cards, which I understand as "bits per inch". The stripe is ~3" long, so it can store from 200 to 600 bits of info in a single track. Which more or less corresponds to "1303031110012015" string you're getting. I think that's what the card contains, the rest is in cinema's computer system. Besides, the question is not relevant to Ubuntu at all. –  Sergey Oct 24 '12 at 2:44
    
What about the info here? marker.to/bjAbN4 I thik it is actually possible to get the name and other data, what do you think? –  Jmlevick Oct 24 '12 at 3:18
2  
Your link shows that their device reads all 3 tracks. Yours only read track #2, which is recorded at 75bpi, so the string you're getting is pretty much what the track contains. It can't fit more than 20-30 characters. –  Sergey Oct 24 '12 at 3:44
add comment

1 Answer 1

Start by looking at the Wikipedia article on magstripe cards, which describes the common data layouts.

Your reader is designed for track 2, which means it reads a series of digits and special characters. From the product page, the device shows up on your system as a keyboard and enters the characters it sees. Thus, the information you see when you swipe the card is exactly the information stored on track 2 of the card. In this case, it looks like your customer ID number and nothing else.

To get more interesting bits such as names, you could try placing a physical shim inside the reader so that the head reads across track 1. However, this might not work if the hardware only knows how to decode track 2.

To read the device programmatically, you can use stdin just like you would for a full keyboard. The open-source StripeSnoop project is long dead, but you can probably glean some good tips from it nonetheless. Magstripe technology hasn't changed in a long time. Hack a Day also has some good links on credit cards.

share|improve this answer
    
Links: StripeSnoop and Hack a Day credit cards –  Steven Bell Oct 24 '12 at 2:36
    
What about the info here? marker.to/bjAbN4 I thik it is actually possible to get the name and other data, what do you think? –  Jmlevick Oct 24 '12 at 3:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.