Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 2.37 KB

File metadata and controls

57 lines (34 loc) · 2.37 KB

Raspberry and RC522 module

💳 About PiFare

PiFare is a Raspberry Pi tool for reading Mifare classic 1k cards with a RC522 module via SPI. This project is for fun and for learning RFID related things.

PiFare is based on these projects (I have changed the "print" statements to make them work with Python3):

📝Installation

  1. First, you need to enable SPI interface in the Raspberry pi: https://pimylifeup.com/raspberry-pi-spi/
sudo raspi-config
  1. Connect the RC522 with the Raspberry. The wiring is described here ("Wiring the RFID RC522"): https://pimylifeup.com/raspberry-pi-rfid-rc522/

Raspberry and RC522 wiring

  1. To install necessary libs, execute the install script:
./installation/install.sh

💻 Usage

Run the script with python3:

python PiFare.py

The script will ask for a card and read the UID. Then, it ask you if you want to bruteforce the keys (first KeysA, after that, it does the same process for KeysB) with the dictionary in the "dict" folder which contains around 1400 keys.

PiFare main screen

If you found some Keys, the script will read the data from the different blocks:

Blocks data printed

All the information related to the card read is saved in /data/{UID}.json file (I have copied the same structure as the proxmark uses). If you open the file, you can see the keys, the content of the blocks read, etc.

Data from json file

Data from json file

📂 Documentation

Here you can find useful information about Mifare Clasic 1k: https://github.com/XaviTorello/mifare-classic-toolkit

✅ To do

  • Create a "Write" mode to write data into the cards
  • Fill "AccessConditions" and "AccessConditionsText" information in the json files.