A Universal RFID Key

 by drj113
Featured
MultiProxCard.jpg
RFID projects have been pretty prominent recently, ranging from projects here in Instructables, to our local Silicon Chip magazine in Australia publishing a RFID door lock project in their November issue.  Even I recently purchased a RFID door lock on eBay for $15 to lock my garage (so my front neighbor could get tools if he wanted to).

We have known that the cheaper RFID technologies were pretty insecure for a number of years.  Researchers have demonstrated cloners of all varieties, but simple RFID tags are still being used for access control.  Even my current employer uses them.

A while ago, I was looking at Hack A Day, and I saw an amazing project that somebody had made.  It was an RFID card with a keypad on it.  For the next couple of days, I couldn't get the image of the card out of my mind;  the project reminded me of how much I wanted to build a RFID spoofer myself.  The original author didn't release source code for their project, but they left enough clues that I could follow. 

So, in typical fashion,  I built my own reader hardware so I could have a look at the data from a card, and created my own version of the Universal RFID key.

The key I made works beautifully both on my garage door, as well as a number of other RFID readers I have tried!

I have decided to publish this, as more people should be aware of the design flaws that are inherent in older RFID implementations, and to allow others to make their own universal key.

Will this key let you into anybodies RFID protected office?  Yes it will, assuming a couple of things are true

  1)  The have to be using 125kHz RFID tags that use the same encoding standard as I have designed this project for, and,
  2)  You have to have access to the number printed on the back of the tag - with that number, you can simply key it into the Universal RFID key, and it will emulate that tag.

So there you go - I hope you enjoy making this project.  - And remember, with great power comes great responsibility!
 
Remove these adsRemove these ads by Signing Up

Step 1: How does RFID work?

Card TX Waveform-doco.bmp
RFID, or Radio Frequency IDentification is the term used to describe a wide variety of  standards that allow data stored within electronic 'tags' to be read by a reader without using wires.  There are a number of standards, encoding formats, and frequencies in common use.   I will describe the 125 kHz standard that is common for access control mechanisms.

125 kHz RFID tags are commonly encased in a business card sized piece of plastic, or a round disk.  The tag consists of a coil of wire, connected to a microchip.  When the tag is brought into close proximity to a reader, energy is coupled inductively from the reader to the microchip within the tag. 

The energy from the reader has dual use; firstly, it provides power to run the card, and secondly, it provides a communication medium for data to be transmitted.  Once powered up, the tag modulates the bit pattern that is programmed into the tag using a signal that the reader can detect.  The reader then reads this bit pattern, and passes it onto the door controller.  If the bit pattern matches one that is authorised, the door will be unlocked.  If the bit pattern does not match an authorised one, then the door won't unlock.

In the RFID system I was playing with, the bit pattern looked like this;

1111111110010111000000000000001111100010111110111101001111010000

I will describe what this pattern actually means in the next page.

One interesting feature of the data transfer between the card and the reader, is that data is encoded using Manchester Encoding, which is a way of encoding data so that it can be transmitted over a single wire ensuring that the clock information is able to be recovered easily.  With Manchester encoding, there is always a transition in the middle of a bit.  If you want to transmit a 1, the transition would be from low to high, and if you want to transmit a 0, the transition would from from high to low.  Because the transitions are in the middle of each bit, you can ensure that you have locked onto valid data.  For a detailed description, have a look a this page.

The actual data is transmitted by the card effectively shorting the coil out - this applies an additional load to the transmitter in the reader, which can be detected.
1-40 of 126Next »
usbg3rd says: Mar 7, 2013. 10:17 PM
hi, excellent project there... but i have a few questions
1- i have a card,with the number on the back , i can decode most of the portion of the number but how do i find the facility code? and the total number of bits including the starting bits and the ending bits.
2- i don't have the card reader so how can i see the bit pattern sent by that RFID card.
3- is there any way i can receive the whole bit stream sent by my rfid card?
drj113 (author) in reply to usbg3rdMar 8, 2013. 3:08 PM
Cool - Thanks for the questions.

The only way of getting the facility code is to read a card. It is rarely printed on the card itself

The only way to see the bit pattern is using a card reader. I built my own - there are lots of simple designs.

usbg3rd in reply to drj113Mar 9, 2013. 7:20 AM
Hey thanks for the reply , but i wanted to know how can i build a card reader (without using any module) using only micro controllers (pic AVR etc) and stuff.. can u give me a link to it
and just wandering if 8051 can be used in making the reader ?
usbg3rd in reply to usbg3rdMar 11, 2013. 12:42 AM
helo ? u there ?
drj113 (author) in reply to usbg3rdMar 11, 2013. 3:34 PM
Sorry for the late reply, I was away.

You can certainly use an 8051 to read a card - You have to build all of the electroinics yourself though.

Here is a link to a project that I found helpful.

http://www.proxclone.com/reader_cloner.html

Soirry, but my reader is not a completed project that is at the stage where it can be released as an Instructable.

prayalone says: Feb 10, 2013. 10:28 AM
I'm experimenting with the RFID.
with my little knowledge ^ ^'.

Please help me comparing your design using diode bridge and some other design using a transistor. (like this one : http://www.instructables.com/id/Stupid-Simple-Arduino-LF-RFID-Tag-Spoofer/?ALLSTEPS). what the difference (pros/cons)?

I'm see that using transistor is more simpler but I don't know if there is any trade of?

Thanks for your contribute :D
drj113 (author) in reply to prayaloneFeb 10, 2013. 12:33 PM
That is an interesting way of doing it.

The thing to consider is that the output of the micro already has a transistor anyway... So this is simply duplication.
tomroth says: Feb 9, 2013. 6:58 PM
Should the windings and diodes alone be read by the reader or does it need to be connected to the arduino for anything to happen? I built the 100 windings with the diodes and resitstor and nothing is happening. I'm pretty sure that is to be expected, but I just wanted to be sure.
Thanks!!!
tomroth says: Feb 8, 2013. 6:31 PM
OK, got the program opened and verified. I made an arduino device that reads #bits, facility code, and card number from any weigand card. I'm going to use your instructions to prove to my boss (I'm in the security installation business) that weigand can be hacked and copied very easily. This will get our customers to move to newer and more advanced technologies.
drj113 (author) in reply to tomrothFeb 8, 2013. 11:22 PM
Hit enter far too soon.

Well done, it works beautifully against the Chinese card systems that are prevalent.
tomroth says: Feb 7, 2013. 7:16 PM
I tried that. The Arduino IDE just opens it with one REALLY long line. Would you be willing to email it to me? t.c.roth@sbcglobal.net. If not, I will try to enter it manually.
drj113 (author) in reply to tomrothFeb 8, 2013. 11:20 PM
done :-)
tomroth says: Feb 6, 2013. 7:19 PM
This is an awesome project! But I can't download the Arduino sketch, it just opens as a text document. Any reason why?
drj113 (author) in reply to tomrothFeb 6, 2013. 11:02 PM
It is a problem with instructables - Just save the text document as a .pde file
lazerek says: Jan 29, 2013. 2:25 PM
RFIDSpoofer_Instructables:3: error: expected constructor, destructor, or type conversion before '<' token
RFIDSpoofer_Instructables:90: error: 'ROWS' was not declared in this scope
RFIDSpoofer_Instructables:108: error: 'ROWS' was not declared in this scope
RFIDSpoofer_Instructables:123: error: 'Keypad' does not name a type
RFIDSpoofer_Instructables.pde: In function 'void setup()':
RFIDSpoofer_Instructables:147: error: 'EEPROM' was not declared in this scope
RFIDSpoofer_Instructables.pde: In function 'void PowerDown()':
RFIDSpoofer_Instructables:375: error: 'SLEEP_MODE_PWR_DOWN' was not declared in this scope
RFIDSpoofer_Instructables:375: error: 'set_sleep_mode' was not declared in this scope
RFIDSpoofer_Instructables:376: error: 'sleep_enable' was not declared in this scope
RFIDSpoofer_Instructables:377: error: 'sleep_mode' was not declared in this scope
RFIDSpoofer_Instructables.pde: In function 'void LoadFacility()':
RFIDSpoofer_Instructables:431: error: 'NO_KEY' was not declared in this scope
RFIDSpoofer_Instructables:434: error: 'keypad' was not declared in this scope
RFIDSpoofer_Instructables:470: error: 'EEPROM' was not declared in this scope
RFIDSpoofer_Instructables.pde: In function 'void LoadCardID()':
RFIDSpoofer_Instructables:491: error: 'NO_KEY' was not declared in this scope
RFIDSpoofer_Instructables:494: error: 'keypad' was not declared in this scope
RFIDSpoofer_Instructables:533: error: 'EEPROM' was not declared in this scope
RFIDSpoofer_Instructables.pde: In function 'void loop()':
RFIDSpoofer_Instructables:571: error: 'keypad' was not declared in this scope
RFIDSpoofer_Instructables:573: error: 'NO_KEY' was not declared in this scope
drj113 (author) in reply to lazerekJan 30, 2013. 8:36 PM
it looks like you have not loaded the keypad or eeprom library.

Also - what version of the Arduino software are you using?
curlydude93 says: Sep 11, 2012. 10:22 PM
How could the range of this spoofer be increased? I'm interested in using this to gain access to my college dorm without having to scan my ID right next to the reader.
Klaudiuszm in reply to curlydude93Jan 13, 2013. 7:17 PM
I'm curious about that too.
drj113 (author) in reply to KlaudiuszmJan 14, 2013. 12:08 PM
The only think I could think of is increasing the antenna size, or making the project be an active transmitter - That's an area that I had not experimented with.

kylerwinters says: Nov 18, 2012. 8:58 PM
Hi my key has the numbers:
20307 1196689-1
I don't know what the code would be for it. Could you please help me?
ninthlife says: Sep 5, 2012. 3:55 AM
seen this?

no credit given :(

http://www.instructables.com/id/A-Universal-RFID-Key-1/
drj113 (author) in reply to ninthlifeSep 5, 2012. 6:36 AM
Hey,

Thanks for that - From the links, it looks like he made it as a present for a friend.

It is sad that he didn't attribute the original project.

But while it is irritating that he took my name off the board we have a big mish-mash of cultures that should be respected here on Instructables, and I am stoked that at least he had a go at the project.

Doug


Laserman595 says: Oct 9, 2011. 1:14 PM
:D
How-do-we-emulate-a-card.jpg
drj113 (author) in reply to Laserman595Jul 22, 2012. 4:31 PM
Ahhhhh - it took a while for me to see this..... C4 was not chosen intentionally :-)
techxpert in reply to Laserman595Jul 21, 2012. 8:55 PM
wow, just wow. : )
drj113 (author) in reply to techxpertJul 22, 2012. 4:30 PM
Why Thank you :-) This was a fun project.
darkhack says: Jun 20, 2012. 7:54 AM
Hello,
How your antenna measures wide and long? your image is not accurate and how did turn you do ?
Thanks.
ljfa321 says: May 8, 2012. 10:19 PM
Still acting weird :/
Sorry about so many question.
1) The two small circle labeled as vcc connect directly to the positive of the battery which is also the connection 1 on P1.

2) I got caps that have polarity or C3 and C5, C3's positive toward the vcc circle, and C5's positive toward connection 1 on P2.

Are both of them sound right?

Thanks!
ljfa321 in reply to ljfa321May 9, 2012. 6:46 PM
Oh and can you also tell me in each mode, which LED should be on to indicate the mode? Thanks
ljfa321 in reply to ljfa321May 9, 2012. 7:13 PM
so far my sequence look like this:

Power ON
Pin3 LED ON
Push Mode
>>Pin3 LED ON
Push Mode
Pin2 and Pin3 LED ON
Push Mode
Pin3 and Pin4 LED ON
Push Mode
Pin2, Pin3, and Pin4 LED ON
Push Mode
Pin2 and Pin3 LED ON
Push Mode
Back to >>



As you can see, Pin3 is always on, I'm guessing that is some to do with the fact that its TX pin.
Also for some reason, Pin2 LED only light up faintly, probably because I'm using a really bright LED so the Atmega don't have enough juice to power that?
(I'm using the same LED through out the board)
Last, Pin5 LED never light up :/
drj113 (author) in reply to ljfa321May 9, 2012. 8:29 PM
The mode is displayed in binary - 0001 = 1, while 0101 = 5

And - you are right with serial enabled then you will have the TX pin on all the time - I normally disable the serial interface.

Doug
ljfa321 in reply to ljfa321May 9, 2012. 12:59 AM
Oops, I mean the positive after the Voltage regulator
ljfa321 in reply to ljfa321May 8, 2012. 10:51 PM
BTW, I'm using Atmega328 with UNO boot loader. Will that make a difference?
(I actually just upload the sketch to my UNO, unplug the atmega and use it directly)
ljfa321 says: May 7, 2012. 8:33 PM
Question, shouldn't R6 be a 10k resistor instead of 100k one @@?
drj113 (author) in reply to ljfa321May 7, 2012. 9:37 PM
Either will work fine - It is just a pull up resistor on the reset signal.
ljfa321 in reply to drj113May 8, 2012. 9:01 AM
(removed by author or community request)
ljfa321 in reply to drj113May 7, 2012. 11:21 PM
OK thanks, still trying to find out which part I did wrong since mine don't even blink a LED when powered, and only the receiving led stay on when attach to FDTI. So far all the wiring seem to be fine, so probably the bootloader is not in burned correctly...
lis.tesla says: Jan 30, 2012. 3:10 PM
what kind of arduino do you need
diwib says: Jan 28, 2011. 7:22 PM
Do you know how would I turn this into a 13.56 Mhz card emulator?
kwadwo00 in reply to diwibJan 8, 2012. 7:35 PM
Have you heard anything on how to turn this into a 13.56 Mhz card emulator? i.e. Could you swap out the coil for a 13.56 Mhz antenna?
1-40 of 126Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!