Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the easiest way to get track data off a simple USB HID magnetic card reader?

I need to get Track 1 and Track 2 data off magnetic cards and send them over the network to a waiting server. What is an easy way to get the track data from a USB HID magnetic card reader?

In case it helps, I have a MAGTEK Mini Swipe Magnetic Strip Reader (part no. 21040140)

I'm OS agnostic -- a solution for Windows, Mac or Linux would be great. Preferably no .NET, but if that's the easiest way I'll go for it.

What do you all think?

Thanks!

like image 553
BuyTheBid Avatar asked Oct 12 '10 18:10

BuyTheBid


People also ask

How do you read magnetic stripe data?

A magnetic stripe card is a type of card capable of storing data by modifying the magnetism of tiny iron-based magnetic particles on a band of magnetic material on the card. The magnetic stripe, sometimes called swipe card or magstripe, is read by swiping past a magnetic reading head.

How do you use MSR swiper?

In order to use the USB MSR Swiper, ensure that 'Enable Swipe' is toggled to 'Yes' in Control Panel > Settings. Click Swipe and the screen will dim while it's waiting for your card info to populate. Upon swiping, the Cardholder's name, card number, and expiration date will populate automatically.

What is MSR card reader?

A magnetic stripe reader, also called a magstripe reader, is a hardware device that reads the information encoded in the magnetic stripe located on the back of a plastic badge.


1 Answers

Every card reader I've seen has had a keyboard emulator, so you swipe the card and it sends characters through the keyboard buffer. Looks like this one also does that (documentation : http://www.magtek.com/documentation/public/99875206-16.01.pdf)

Page 14 describes the data sent after a swipe, which is again, fairly standard across card readers:
[Tk1 SS] [Tk1 Data] [ES] [Tk2 SS] [Tk2 Data] [ES] [Tk3 SS] [Tk3 Data] [ES] [CR]

So your track one data starts with % and ends with ?
Track two data starts with ; and ends with ?

I noticed the question was tagged credit-card though, so it would be worth making sure you know the consequences of sending raw card-data across a network (even an internal network). Take a look at the Payment Card Industry Data Security Standards (PCI-DSS) : https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml


There is a demo program for that specific reader that comes with VB source.
http://www.magtek.com/support/software/demo_programs/usb_swipe_insert.asp

like image 142
PaulG Avatar answered Oct 03 '22 21:10

PaulG