Jump to content

Mag-stripe readers


coyotepedia

Recommended Posts

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

  • 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). RapidShare link: http://rapidshare.com/files/284934800/mag-20090201.zip.html

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)

Can you upload the project once again? I want to take a look at the source code and work on my own program(I'm rookee programmer).

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
is the process reverseable, so one could also write onto a card?

I think that in theory at least it should be possible to write onto a card using homebrew equipment, but I haven't seen any projects or websites describing it exactly. Also I think that depending on if the card is high-coercivity or low-coercivity will make a difference (the wikipedia entry for Magnetic_stripe_card explains a bit about different types of magstripes).

Maybe a record head from a tape recorder could work, I am not sure - I haven't seen a definitive answer to that question yet.

Another issue to deal with for writing cards would be timing - maybe it will be difficult to accurately write to a card when it is hand-swiped (a motorized writing mechanism to move the write head over the stripe at a steady speed could solve this issue).

A homebrew magstripe writer would be an interesting project, but probably quite complex to get it working successfully and reliably.

Link to comment
Share on other sites

  • 2 weeks later...

I much prefer the reader/writer combo although the magnetic strip spoofer

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

is cool, although I personally like to go to www.dealextreme.com and grab some magnetic cards they look much less incriminating when in real world applications.

dealsextream.com has some readers and reader/writers but they are not worth buying I have had some bad experience with items I have bought on the website so I wouldn't take the risk you might have better luck on sparkfun.com

In conclusion you should go with a expensive modal if you are looking to get some good use out of it

An interesting project might be it may teach you more about the whole process of reading and writing magnetic cards

http://www.instructables.com/id/Arduino-magnetic-stripe-decoder/

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 2 years later...

I realize this is a very old thread but I came across this today and thought I would share:

http://web.archive.org/web/20070214070116/http://www.timmatheson.com/91/

"In this project, the software does all the heavy lifting. The “dab” utility included in this article takes the raw DSP data from your sound card, decodes the FSK (frequency shift keying - a.k.a. Atkin Biphase) modulation from the magnetic stripe, and outputs the binary data. Additionally, you can decode the binary data using the “dmsb” utility to output the ASCII characters and perform an LRC check to verify the integrity of the data, provided that the stripe conforms to the specifications described in ISO 7811, 7813, and optionally ISO 4909 (for the uncommon Track 3). Becoming familiar with these specifications will help you understand the contents of the magnetic stripe when viewing the decoded data.

The provided software is more proof-of-concept than production code, and should be treated as such. That said, it does its job well. It is open source and released under the MIT license. Feel free to contribute.
Requirements
- Linux (or the desire to port to another operating system)
- A configured 16-bit sound card
- Access to the /dev/dsp device
- libsndfile
Note that “dab” can also take input from any audio file supported by libsndfile. However, it must be a clean sample that starts at the beginning of the file. This is useful to eliminate the requirement of a sound card and allow samples to be recorded from another device (e.g., an MP3 player/recorder) and decoded at another time.
Download
dab.c (v0.7)- Decode Atkin Biphase
dmsb.c (v0.1)- Decode (standard) Magnetic Stripe Binary
Compiling
Edit any configuration #defines near the top of the dab.c file and proceed to compile the source with the following commands:
cc dab.c -o dab -lsndfile
cc dmsb.c -o dmsb
Usage
Usage: dab [OPTIONS]

-a, –auto-thres Set auto-thres percentage
(default: 30)
-d, –device Device to read audio data from
(default: /dev/dsp)
-f, –file File to read audio data from
(use instead of -d)
-h, –help Print help information
-m, –max-level Shows the maximum level
(use to determine threshold)
-s, –silent No verbose messages
-t, –threshold Set silence threshold
(default: automatic detect)
-v, –version Print version information

Usage: dmsb [OPTIONS]

-V, –verbose Verbose messages

-h, –help Print help information
-v, –version Print version information

dmsb will wait on stdin for raw magnetic stripe data (string of 0s and 1s
followed by a newline) and print the decoded data to stdout.
Be sure that the mic is set as the recording device for your sound card (using a utility such as aumix or your preferred mixer). Standard usage on the command line with the hardware interfaced directly to the sound card (mic in) will be as follows with standard cards:
./dab | ./dmsb "

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...