Gerry's World

A glimpse into my life

Website screenshot


Summer, 2017 - Present


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.


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.

My DukeCard

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.

Top view of the MagSpoof Back view of the MagSpoof
Eagle Schematic Eagle PCB Layout


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:

So I have some work to do on that aux cord input, but I hope to finish it in the coming months whenever I get time. With things getting busier, this project has moved towards the back of my mind and will probably be "on hold" for a couple months.

Stay tuned for updates!!!