Jump to content

Mag-stripe readers


coyotepedia
 Share

Recommended Posts

I've wrestled with this problem for a while. I'd like to build a mag-stripe reader for use on my PC. I know it's been done before, both by Acidus and Sephail, but neither of their projects is really workable for me. Acidus did some really clever stuff to get a reader to work through a game or parallel port, but those solutions aren't easily adapted to a world where the 'U' in USB is really starting to mean something. Sephail's method, running the input through the analog/digital converter already in his computer (aka the sound card) is probably easier to adapt to a newer computer, but the code he wrote depends on older, obsolete software on a linux box. I'm okay with linux, but not so good with it or coding that I can rewrite his software to work with Ubuntu 8.10. Anyone feel up to the challenge? I'd even like to see an episode to showcase the problem, if enough people share the interest.

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

I've wrestled with this problem for a while. I'd like to build a mag-stripe reader for use on my PC. I know it's been done before, both by Acidus and Sephail, but neither of their projects is really workable for me. Acidus did some really clever stuff to get a reader to work through a game or parallel port, but those solutions aren't easily adapted to a world where the 'U' in USB is really starting to mean something. Sephail's method, running the input through the analog/digital converter already in his computer (aka the sound card) is probably easier to adapt to a newer computer, but the code he wrote depends on older, obsolete software on a linux box. I'm okay with linux, but not so good with it or coding that I can rewrite his software to work with Ubuntu 8.10. Anyone feel up to the challenge? I'd even like to see an episode to showcase the problem, if enough people share the interest.

*THAT*, my friend, seems like a nice cheap hardware hack that Hak.5 could pull off!! And then they could expound on it by implementing it on something useful, like a reader on the door that only allows their credit cards or something (I say their credit cards, implying that they do have them, so there's no need get new ones, which lowers the cost, which is one of the main problems they're having with hardware hacks). Anyways... I think that would be pretty awesome

Link to comment
Share on other sites

Sephail's method, running the input through the analog/digital converter already in his computer (aka the sound card) is probably easier to adapt to a newer computer, but the code he wrote depends on older, obsolete software on a linux box. I'm okay with linux, but not so good with it or coding that I can rewrite his software to work with Ubuntu 8.10. Anyone feel up to the challenge?

Sephail's code compiles fine for me on Ubuntu 8.10. I had to install the libsndfile-dev package, then used the commands on Sephail's page and both programs compiled without problem.

I have to find a magnetic head to build a reader, so I haven't actually made the program do anything. I'll probably give it a try over the weekend.

Link to comment
Share on other sites

I have tried the $20US model of USB Universal Magnetic Stripe Credit/Debit Card Bidirectional 3-Track Swipe Reader

sku.17726 from DX

It is a reader, plugs in to the USB port, is picked up by windows as a USB keyboard (going to try it on linux later).

Reads Track 2 info.

With notepad open, it will display (type) the credit card number/exp plus some other data.

post-11868-1231530485_thumb.jpg

Link to comment
Share on other sites

I have tried the $20US model of USB Universal Magnetic Stripe Credit/Debit Card Bidirectional 3-Track Swipe Reader

sku.17726 from DX

It is a reader, plugs in to the USB port, is picked up by windows as a USB keyboard (going to try it on linux later).

Reads Track 2 info.

With notepad open, it will display (type) the credit card number/exp plus some other data.

You should try to change your login password to the output your credit card gives and see if it'll let you login with a simple swipe off the card!! Sounds logical and pretty sweet, right!? haha :lol: Try it on an extra account that you can just delete in case it doesn't work though lol

Link to comment
Share on other sites

You should try to change your login password to the output your credit card gives and see if it'll let you login with a simple swipe off the card!! Sounds logical and pretty sweet, right!? haha :lol: Try it on an extra account that you can just delete in case it doesn't work though lol

I am away for the weekend, but I will try next week.

Link to comment
Share on other sites

@iaxia: lol I have the exact same one, yes you can use it for PW and you can set one of the dip switches so that it sends an enter press too. I used it for a week before I went back to a normal PW...

Why'd you go back to a normal password?

Link to comment
Share on other sites

I've wrestled with this problem for a while. I'd like to build a mag-stripe reader for use on my PC. I know it's been done before, both by Acidus and Sephail, but neither of their projects is really workable for me. Acidus did some really clever stuff to get a reader to work through a game or parallel port, but those solutions aren't easily adapted to a world where the 'U' in USB is really starting to mean something. Sephail's method, running the input through the analog/digital converter already in his computer (aka the sound card) is probably easier to adapt to a newer computer, but the code he wrote depends on older, obsolete software on a linux box. I'm okay with linux, but not so good with it or coding that I can rewrite his software to work with Ubuntu 8.10. Anyone feel up to the challenge? I'd even like to see an episode to showcase the problem, if enough people share the interest.

why dont you just get an parallel to usb adapter?

Link to comment
Share on other sites

If you want hardware level control

$3.50USD

http://www.allelectronics.com/make-a-store...READER/-/1.html

You'll need to build an interface. But this will give you the raw data out. So it will give you the most control. I.E. if you're reading a non-standard card (hotel key cards). Not difficult if you know assembly ;)

If you want to read standard cards (track 1,2,3/credit card, driver's license, etc)

http://www.sparkfun.com/commerce/product_i...roducts_id=8633

Singular a company based in Taiwan used to send free samples out if you asked nicely. That's how I got my serial reader.

You won't get a magstripe writer for less then about $140USD. It will only write the standard format and may only write tracks 1,2

Link to comment
Share on other sites

I bought a cheep track1&2 reader that connects with the ps2 port.

Planning on doing a little house security with it.

First is unlocking the front door using the reader.

Secondly, our fraternity house has been a target of theft during parties. Were thinking about requiring school ID's to swiped at the door (for private events we usually already require them). When the card is swiped a photo is taken along with a time stamp. This coupled with a new cctv were installing should really help us out finding who is stealing from us. (Or deter theft all together)

Also all of the data would be encrypted and destroyed the next day for security reasons.

Link to comment
Share on other sites

i have recorded the analog signal from the magnetic head on my mp3 player

i tryed the Sephail´s program, but cant decode the data.

plaese if someone knows how to convert the analog data to F2F wave form and then to decode or some program to really decode that data...

ssleeper@ymail.com

Link to comment
Share on other sites

I've wrestled with this problem for a while. I'd like to build a mag-stripe reader for use on my PC. I know it's been done before, both by Acidus and Sephail, but neither of their projects is really workable for me. Acidus did some really clever stuff to get a reader to work through a game or parallel port, but those solutions aren't easily adapted to a world where the 'U' in USB is really starting to mean something. Sephail's method, running the input through the analog/digital converter already in his computer (aka the sound card) is probably easier to adapt to a newer computer, but the code he wrote depends on older, obsolete software on a linux box. I'm okay with linux, but not so good with it or coding that I can rewrite his software to work with Ubuntu 8.10. Anyone feel up to the challenge? I'd even like to see an episode to showcase the problem, if enough people share the interest.

I think the program works with Ubuntu 8.10.

But also 'I think' you got to build an amplifier becouse the incoming signal from the head is not enough fro the sound card to detect all bits

I red this somewhere

Link to comment
Share on other sites

Okay, time for me to confess to a facepalm moment; since I started this thread, I've taken another stab at compiling sephail's software. It turns out the reason I couldn't get it to go before had to do with the dependancy, libsnd-dev. I had tried to install it onto my Ubuntu box from command line. It turns out that Ubuntu has a package available called libsndfile1-dev, and once I found that through a package manager gui, dab.c and dmsb.c both compiled just fine. I can't report any successful reads just yet, but that may have to do with what I'm using for a read head. I've tried scavving a head out of one of those MP3 through a cassette deck adapters, but since it's intended to be a write head, my confidence in the idea isn't huge. Said confidence has also dwindled in the failure to read a damn thing from it, even trying with audacity to just record the info and process it through the software after the fact.

Link to comment
Share on other sites

Okay, time for me to confess to a facepalm moment; since I started this thread, I've taken another stab at compiling sephail's software. It turns out the reason I couldn't get it to go before had to do with the dependancy, libsnd-dev. I had tried to install it onto my Ubuntu box from command line. It turns out that Ubuntu has a package available called libsndfile1-dev, and once I found that through a package manager gui, dab.c and dmsb.c both compiled just fine. I can't report any successful reads just yet, but that may have to do with what I'm using for a read head. I've tried scavving a head out of one of those MP3 through a cassette deck adapters, but since it's intended to be a write head, my confidence in the idea isn't huge. Said confidence has also dwindled in the failure to read a damn thing from it, even trying with audacity to just record the info and process it through the software after the fact.

ok

the head which you used is wrong head

you need a head from mono walkman,some old model, or buy some new micro cassette recorder.

the head is a little smaller but if you be careful you can find the rigth position.

i am here ....

on this stage ...

if you get some data out please let me know ssleeper@ymail.com

P.S.

i think this link will help you

http://lekernel.net/scrapbook/cardreader.html

Link to comment
Share on other sites

what you guys need is a microcontroller to listen to the magnetic head then convert to serial. I did alot of programming for an rfid reader in a college project then did a few of my own projects.... When RFID readers were introduced the goal was to replace magnetic strips, and the rfid readers were built for magnetic stripe emulation.

the programs for RFID readers would work with magnetic stripes with very little work.

here is one someone did with one of the easiest to use microcontrollers

http://www.instructables.com/id/SMBGT71FJBYZ4QP/

Link to comment
Share on other sites

ok

the head which you used is wrong head

you need a head from mono walkman,some old model, or buy some new micro cassette recorder.

the head is a little smaller but if you be careful you can find the rigth position.

i am here ....

on this stage ...

if you get some data out please let me know ssleeper@ymail.com

P.S.

i think this link will help you

http://lekernel.net/scrapbook/cardreader.html

Thanks _sleeper_, that link was actually very helpful. It looks like I'll be rummaging through thrift stores for a while, looking for something with a suitable head. Using iron filings to get a visual fix on the location of the stripe was something that never would have occurred to me. I can think of an improvement for the design shown at that cardreader site, though. How about three read head, each at a one of the track positions? A three way switch would allow for quick, easy selection of which track to read.

Link to comment
Share on other sites

  • 2 weeks later...

I have had success reading and decoding some data from magstripes using a head from a tape player. I used a head from an old car tape deck, so it is stereo and also able to read from both halves of the tape (so there are 4 coils total - l/r side 1 and l/r side 2). I connected one of the coils to a stereo jack, plugged it into the PC's microphone input and used Audacity to record .wav files.

I saw some significant differences between different PC's - some work and others do not. Using a multimeter, I measured the voltage from the microphone jack and found that sometimes the left channel (mic input) is 0v and the right channel is 5v, on another PC the left channel is 0v and right is 3.3v, on another left is 2.5v and right is 2.5v, on another left is 3.3v and right is 3.3v. Success varied between the different machines.

Usually the data is noisy - it takes several card swipes to record valid data. The amplitude of the signal is very low, so there is a lot of problems with noise. Also, on one of my PCs the signal was slightly offset, which combined with the low amplitude made it impossible for Sephail's decoder software to work. (but it does work with recordings from another PC)

I wrote my own version of a magstripe .wav decoder, it only understands track 2 data (BCD), and is not the cleanest code (but its purpose is just a learning tool for me, so that's ok). Download link: http://www.dakorb.com/files/mag-20090201.zip

The above RapidShare link also includes a sample.wav file that I recorded. (it's from track 2 of a Staples merchandise card)

So far I have only tried using one magnetic head - I suppose there is a difference in gain, etc, between different heads. I also haven't tried any kind of amplification circuit between the magnetic head and the sound card - a proper amp circuit would probably take care of a lot of the problems between recording on different PCs. (the only downside is that it is more complex - it is pretty cool that with only the magnetic head and a wire to go to a sound card, it's possible to read a magnetic stripe - it doesn't get much simpler than that)

A couple of things that may help others: the faster you swipe a card, the higher the amplitude of the signal (stronger signal). I have to do quite a fast swipe to get legible data. On the other hand, swiping very fast means there will be fewer samples of each bit - I set Audacity to record at 96 KHz (instead of 48) to double the sampling rate.

The 'Card-O-Rama' article from Phrack 37 seems to be THE reference on magstripes - most of the pages I read about magstripe decoding have referred to that document. It explains everything needed to decode magstripe data.

Photos of my magstripe reader, on flickr - I taped the magnetic head to the side of a piece of wood (or edge of desk) and then use a book as a straight edge to slide the card. It's not so easy to get a perfect swipe, but it is simple to setup and allows any track or unusal stripe placement to be read. (a little duct tape and it becomes a proper Red Green magstripe reader ;))

(edited 2009-02-27 to update expired rapidshare link)

(edited 2009-04-27 to update expired rapidshare link)

(edited 2009-05-25 to update expired rapidshare link)

(edited 2009-09-25 to update expired rapidshare link)

(edited 2009-12-13 to change link to direct download on dakorb.com)

Link to comment
Share on other sites

I wrote my own version of a magstripe .wav decoder, it only understands track 2 data (BCD), and is not the cleanest code (but its purpose is just a learning tool for me, so that's ok). RapidShare link: http://rapidshare.com/files/192690964/mag-20090201.zip.html

Thank you for including the source code. This could potentially be a big help once I track down a workable head.

Link to comment
Share on other sites

Thank you for including the source code. This could potentially be a big help once I track down a workable head.

I'm glad to hear that somebody plans to look at the source code - I would have been bummed out if I had tried to clean up the code for nothing. ;) (it's still not the cleanest code, but I assure you it's far nicer than I originally hacked it together) The program is still missing some features - it doesn't know how to decode track1 or track3 data (only the BCD data on track2), and it doesn't check the LRC (checksum) at the end of the data. It's just enough that I could determine that I'm able to read valid data from a card.

Sephail's code is more complete than mine, we implemented the algorithm to decode the data differently and I didn't use libsndfile (and don't have the option of reading directly from the sound card). Using Sephail's software you can decode data from tracks 1, 2 and 3.

If you have any questions about the source code, or if you want help implementing other features, I'd be happy to help.

Link to comment
Share on other sites

Track 1 and Tarack 3 are typically propriatary to the manufacturer. I.e. it's not going to be the same for every card. Sometimes it's just a repeat of what's on track 2. You'll also find the not everybody uses the standard protocol such as hotel door cards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...