{"id":1487,"date":"2015-06-21T01:00:13","date_gmt":"2015-06-21T05:00:13","guid":{"rendered":"http:\/\/pappp.net\/?p=1487"},"modified":"2015-06-21T01:00:13","modified_gmt":"2015-06-21T05:00:13","slug":"rfid-exploration","status":"publish","type":"post","link":"https:\/\/pappp.net\/?p=1487","title":{"rendered":"RFID Exploration"},"content":{"rendered":"<p>I recently picked up a USB RFID reader\/writer pod to play with, partly to learn enough to be dangerous about the tech, and partly hoping to tamper with the RFIDs in the current university ID cards.  I&#8217;m pretty sure I failed on the latter point, but am succeeding at the former in the process. <\/p>\n<p><a href=\"http:\/\/pappp.net\/?attachment_id=1490\" rel=\"attachment wp-att-1490\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2015\/06\/RFIDKit.jpg\" alt=\"RFIDKit\" width=\"1024\" height=\"576\" class=\"aligncenter size-full wp-image-1490\" \/><\/a><\/p>\n<p>Notes from the first round of fiddling with it follow. <\/p>\n<p><!--more--><\/p>\n<p>It&#8217;s branded &#8220;Mifare Card Encoder M302,&#8221; I paid about $23 at NewConcept on Aliexpress for a bundle with the device, a standard A to mini B USB cable, five fobs, and five cards, all of which should be writable cards of the Mifare Classic flavor.  Product link <a href=\"http:\/\/www.aliexpress.com\/item\/New-Contactless-USB-Interface-13-56MHZ-RFID-14443A-Card-Encoder-IC-Card-Reader-for-Mifare-Writer\/32322666775.html\">New Contactless USB Interface 13.56MHZ RFID 14443A Card Encoder IC Card Reader for Mifare Writer with 5pcs Cards 5pcs Key Fob<\/a> &#8211; I bought several things from the seller and one of the other ones came as single items when the description was lots of 3, so this is neither an endorsement nor a warning, I&#8217;ve seen apparently the same kit for similar prices many, many places online.  It included the standard unlabeled 25Minute MiniCD that comes with all cheap Chinese electronics, which in addition to various drivers and instructions, and some RAR files I&#8217;m not terribly excited to find out what are lurking in, included an <a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2015\/06\/M302-protocol-V1.pdf\">extremely useful PDF<\/a> describing the device protocol in reasonable detail.<br \/>\n<br \/>\nLinux sees the devices as a <code>1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter<\/code> in lsusb, which is simply a USB\/Serial adapter.  Support for the device seems to be extremely limited, however Michael Ablassmeier has shared <a href=\"https:\/\/github.com\/abbbi\/mifare\">a little 33-line python script on github<\/a> which literally converts part of the text of the provided PDF into an absolutely minimal dumper for reading the serial numbers off of <a href=\"https:\/\/en.wikipedia.org\/wiki\/MIFARE\">MIFARE<\/a> tags. I haven&#8217;t tried the Windows drivers or found other more featureful software that works with it under Linux, but this was just a first pass to verify that it works.<br \/>\n<\/p>\n<p>Being me, as soon as I verified that it basically worked, I pulled it apart to see what I actually got.  <\/p>\n<p><a href=\"http:\/\/pappp.net\/?attachment_id=1489\" rel=\"attachment wp-att-1489\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2015\/06\/RFIDBoard.jpg\" alt=\"RFIDBoard\" width=\"684\" height=\"1024\" class=\"aligncenter size-full wp-image-1489\" \/><\/a><\/p>\n<p>Photo quality improved by the rather awesome collapsible soft box I got in the same Aliexpress binge. <\/p>\n<p>The main RFID chip is a <a href=\"http:\/\/www.nxp.com\/documents\/data_sheet\/MFRC500.pdf\">NXP MFRC500<\/a> (PDF Warning!), the &#8220;Original&#8221; Mifare Classic\/1K\/4k part, with support for all of  ISO\/IEC 14443 A.<br \/>\nIt is USB interfaced via a <a href=\"http:\/\/www.e-voron.dp.ua\/files\/pdf\/USB\/CH340DS1.PDF\">CH340T<\/a> (PDF Warning!) USB\/Serial adapter, which works under Linux with the ch341 module in mainline, and whose datasheet is, despite being an exercise in Chinglish, readily available, comprehensible and complete.<br \/>\nThe board is glued together with a <a href=\"http:\/\/www.stcmicro.com\/STC\/STC89c52rc.html\">STC 89C52RC<\/a> microcontroller, which is a typical cheap 8051 part with 8k of flash and 512 byes of RAM onboard.<br \/>\n<br \/>\nThe three chips each have their own crystal can, at the expected 12.0000Mhz for the USB\/Serial, 11.0592 for the micro, and 13.5600 for the RFID.<br \/>\n<\/p>\n<p><a href=\"http:\/\/pappp.net\/?attachment_id=1488\" rel=\"attachment wp-att-1488\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2015\/06\/RFIDAntenna.jpg\" alt=\"RFIDAntenna\" width=\"863\" height=\"1024\" class=\"aligncenter size-full wp-image-1488\" \/><\/a><br \/>\nIt has R\/G indicator LEDs and a buzzer, both of which are easily controlled by serial.   The antenna is a five loop PCB antenna on the underside of the board.<br \/>\n<br \/>\nThere are also quite a number of unpopulated pads, including two rows marked 5V\/TXL\/RXL\/G that I suspect are a programming interfaces for the USB\/Serial bridge and microcontroller respectively, though the one near the bridge may simply be a second port on the bridge.  There are also a couple of extra pads for (probably redundant) indicator LEDs, what I suspect are pads for an external antenna connector, and footprints for two extra SOIC packages, one 8 pin labeled U4 and one 21 pin with a weird bidirectional silkscreen labeled U7 at one end and U8 at the other, and surrounded by footprints for decoupling caps &#8211; my first guess is optional external RAM\/ROM.<br \/>\n<\/p>\n<p>I haven&#8217;t yet succeeded in talking to either the HID iClass Px G8H card or XceedID Proximity 7610 fob I have from the university, most likely because I didn&#8217;t read carefully and they are <a href=\"https:\/\/en.wikipedia.org\/wiki\/ISO\/IEC_15693\">ISO\/IEC15693<\/a> type RFID devices not supported by the reader\/writer I bought.  The pin-compatible NXP CLRC63201T part offers 14443 A, B and  ISO\/IEC 15693 support, but that&#8217;s not what&#8217;s in here, nor what the vendor claimed.  While trying to figure out my mistake, I eventually came across and learned a great deal from this handy multi-vendor <a href=\"https:\/\/www.adafruit.com\/datasheets\/rfid%20guide.pdf\">RFID Selection Guide<\/a> from EVB which explains the various RFID flavors in circulation and, like so much good documentation, is hosted by Adafruit.<br \/>\n<br \/>\nIt should still make a fun toy. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently picked up a USB RFID reader\/writer pod to play with, partly to learn enough to be dangerous about the tech, and partly hoping to tamper with the RFIDs in the current university ID cards. I&#8217;m pretty sure I &hellip; <a href=\"https:\/\/pappp.net\/?p=1487\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8,37,1,10],"tags":[51,269],"class_list":["post-1487","post","type-post","status-publish","format-standard","hentry","category-computers","category-diy","category-electronics","category-general","category-objects","tag-linux","tag-rfid"],"_links":{"self":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/1487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1487"}],"version-history":[{"count":0,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/1487\/revisions"}],"wp:attachment":[{"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}