Awesome Open Source
Awesome Open Source


Python library to control Chinese USB HID 125Khz RFID Reader/Writer


This library is the result of reverse-engineering the communication protocol of a Chinese USB 125Khz RFID Reader/Writer. A detailed document describing the whole procedure can be found at the wiki section of this project:

How to reverse engineer a USB HID RFID Reader/Writer

The library can be used to control the USB RFID device under Linux or MacOS, and it uses pyusb and libusb to communicate through the USB port.

Installation (using pip)

You will need Python 2.7.x or greater, and pip.


$ brew install libusb
$ pip install pyusb
$ pip install --upgrade pyrfidhid


$ sudo apt-get install libusb-1.0-0-dev
$ sudo pip install pyusb
$ sudo pip install --upgrade pyrfidhid

Manual Installation

If you can't install the library using pip, then try to install it using script. Just clone this repo, install the dependencies and run the script:

$ python install


The library should work with both Python 2.7.x and 3.x. After running the script you should be able to import and use the library within your project like this:

from rfidhid.core import RfidHid

    # Try to open RFID device using default vid:pid (ffff:0035)
    rfid = RfidHid()
except Exception as e:

payload_response = rfid.read_tag()
uid = payload_response.get_tag_uid()


The above script should try to connect to the device, read a Tag (if it is already close to the device), print the UID and beep.

For more complex read/write examples, please check out the examples folder.

You can also check the API documentation for a list of exported methods.


A command line tool called rfid_cli is also included with the library, and it can be used to read, write and clone tags. For a complete documentation please check rfid_cli documentation

Final notes

If you are looking for an Android tool similar to IDRW V3 you can check this project

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,146,154
Cli (15,989
Reverse Engineering (2,058
Driver (1,454
Usb (852
State Machine (742
Rfid (270
Wireshark (198
Usb Hid (174
Rfid Reader (63
Sniffing (61
125khz (10
Related Projects