Electronic – How difficult is it to build a device that can read credit card data from the mag-stripe…from scratch

audiomagneticssignalsignal processing

I was wondering about the feasibility and difficulty of building a device that could read the information the magnetic stripe on a credit card. I think I understand the basic principles, but I'm not clear on how the audio signal is transformed My understanding of the basic functionality of something like the card reader manufactured by Square:

https://www.google.com/patents/US8231055

My understanding of it is this:

The magnetic strip of a credit card is passed through a Tape Head, like those used on a tape deck.

This produces and audible signal, depending on the shape/encoded bits on the strip. There is a specific name for this effect, and I had a wikipedia page on it, but I've lost track of it (If anyone knows who discovered this, or what this is called, I would appreciate it. I think there was also a patent on it)

In the case of Square, the part of the peripheral which connects into the Headphone audio jack has a microphone that picks up the sound? Or is it the microphone on the mobile device? Either way, this signal is picked up, and somehow decrypted back into whatever raw data it encodes (Cardholder name, card #, expiration date, etc,etc)

This data goes into some software/API.

I've seen a few scattered resources on youtube/blogs, but nothing really comprehensive about building this from scratch. Is it even possible? I'm a hobbyist without too much knowledge of EE, so please tell me if I'm horribly wrong about anything I've said so far.

My main questions are this:

  1. How do the magnetic grooves within the Mag Strip get converted to an audible signal – is there a name for this effect?
  2. Where would someone source a Tape Head such as the ones used by Square in the first version of their Card-Reader? Anywhere that they can be purchased online, or do I have to pull apart old Tape Decks?
  3. How is the auditory signal transformed from a card swipe to digits? Is there a formula that is applied to parts of the waveform? Is there any software available? (I can't imagine there would be any legitimate third-party non-enterprise entities fofering this functionality…)

Would all of this be easier to do by just buying a generic Credit Card reader from Ebay? Does every card-read manufacturer have their own card-audio-signal transformation software bundled into their device somewhere?

Best Answer

How do the magnetic grooves within the Mag Strip get converted to an audible signal - is there a name for this effect?

Induction.

You move a magnetic field relative to a conductor, you induce a current in that conductor. So, that's plain school physics here.

Where would someone source a Tape Head such as the ones used by Square in the first version of their Card-Reader? Anywhere that they can be purchased online, or do I have to pull apart old Tape Decks?

Exactly where tape deck manufacturers source their tape heads. Online :)

No, seriously, there's giant electronic distributors out there, and they probably also have tape heads. If you need let's say a dozen tape heads, might still be cheaper to pull them out of junkyard stereos.

How is the auditory signal transformed from a card swipe to digits?

Let's get this straight: the audible signal is just a conversion of the electrical signal to an audible one. You wouldn't normally process the audio signal, but the electrical signal directly.

Is there a formula that is applied to parts of the waveform?

Yes. Would be impossible without.

Really, it's just different magnetizations. If you draw the strip across a coil, you can measure and amplify the induced current. From that waveform, you practically directly get the bits. It's pretty low-tech.

Is there any software available?

Probably. Usually, it would be done in simple hardware (all this technology is pretty old by now, more than 40 years!). But yeah, why not: You already noticed that you can amplify the signal and make it audible. So, maybe just feed a sound card with it. From there on, it's just a few steps of digital signal processing that you'd need to design in your PC.

(I can't imagine there would be any legitimate third-party non-enterprise entities fofering this functionality...)

what? Magnet stripe cards are used everywhere – in banking, in hotel room locks, in telephone cards, in public transport, in parking lots, in hospital access control systems, in time card systems …

So, that's a very ubiquitous application. There's a lot of card reader modules that you can simply go and buy. In single quantities, or thousands. Online. If you haven't found one, you haven't looked very intensely.

Would all of this be easier to do by just buying a generic Credit Card reader from Ebay?

Counterquestion: How competent are you at analog and digital signal processing, and how competent are you at buying?

(also: don't buy stuff at ebay. You've been warned.)

Does every card-read manufacturer have their own card-audio-signal transformation software bundled into their device somewhere?

That audio is really stuck in your head. There's no audio unless you convert your signal into audio. And there's no reason to do that.

But yeah, if you build a card reader, you take something that converts a changing magnetic field signal in to a current or voltage signal (something like a tape head), you take something that processes that current or voltage signal and converts it to a stream of bits, and then you take that bit sequence, and error-correct it and convert it to the "meaning" it has. That's your job as a card reader designer. You go and pick the components that do that for you, configure/design/program and test them, and integrate them into a product.