MagSpoof
Intro
I am often plagued with the dilemma of forgetting my DukeCard somewhere when going around campus and find myself locked out of buildings and humiliatedly paying for my food with credit card for the rest of the day until I retrieve my card from wherever I left it - if I can retrieve it at all. I was inspired by a project I had read about years ago by a guy named Samy Kamkar he coined "MagSpoof". Of course, he was applying his project to credit cards, but I am not quite as frivolous and decided to do it only for my DukeCard.
Investigation
I poked around a bit and found that there are typically 3 "tracks" or regions on a standard magnetic swipe card, though the third is rarely used. I also learned that all a magnetic card is is a bunch of magnetized bands in a certain pattern to send a bunch of 1's and 0's. Fortunately, Samy had already figured out all the hard stuff and I just had to apply it to my DukeCard.
I started out by aquiring a USB card reader and found my card had actually only contained data on track 2 - none on track 1. To confirm it wasn't just the card reader, I also scanned some of my credit cards and drivers license and did indeed read other track data on them. Great! Furthermore, the only thing on the magnetic stripe was my "DukeCard number" in plaintext! Note that my card number is also printed on the back of my card, so if I got a glimpse of someone else's card, I could theoretically replicate it. This gets to security issues I'll discuss later.
Building the MagSpoof
Samy provided some specs but I had a decent amount of electronics experience and had a random assortment of components on hand already, so I decided to modify his circuits a bit. I'll update this more later but I'm too lazy to do it right now.
*NOTE TO SELF: WRITE MORE STUFF*
could I have made this a comment? sure. But I never would have read it.
Current Design Stage
After fiddling for a long long time, I got things working! Only problem is that it's not super reliable and it's pretty clunky. I want to shrink it down by applying a few improvements which follow along two general paths:
- Smaller MCU (ATtiny10), one FET to replace the ULN motor driver, button cell batteries instead of AAA, and better board layout. Note that I have made quite a bit of progress on this and have implemented each of these things separately, but for some reason things fell apart when I tried to put them all together.
- Aux cable input with op-amp and/or FET to drive the electromagnetic coil. This is where I'm really interested because I won't have to go through a reprogramming to change the card number. This is good because it's not easy to reprogram an SMD chip soldered onto a populated board and without having programming pins/jumpers for space constaints. It's also just such an amazing idea that I don't know why I didn't think of it before. It's basically just like an anti-square card reader. So handy. I'm abandoning the first bullet point to pursue this one.
Stay tuned for updates!!!