Mifare Classic 1k and 4k card reader and writer. It can be used as a command line program or as a Java class for programming other programs.
Only tested with the SCL3711 reader, for other readers it may be necessary to create a subclass and rewrite the getUID, loadKey, readBlock, writeBlock and valueBlockCommand methods to modify the APDU commands.
# mcrw Usage: mcrw a|b key action block|sector data|value echo $data | mcrw a|b key action block|sector Actions: read-block block read-block-string block write-block block data write-block-string block data clear-block block format-value-block block read-value-block block increment-value-block block value decrement-value-block block value read-sector sector read-sector-string sector read-sector-info sector write-sector sector data write-sector-string sector data clear-sector sector read-sector-trailer sector write-sector-trailer sector data read-card-info Examples: mcrw a 08429a71b536 write-block 4 4578616d706c6520537472696e670000 mcrw b 05c4f163e7d2 write-block-string 5 "Example String" mcrw b 05c4f163e7d2 increment-value-block 6 10
MifareClassicReaderWriter device = new MifareClassicReaderWriter(); device.readCard(); device.loadKey(KEY_A, "ffffffffffff"); String block = device.readBlockHexString(4);
More info in "Tarjetas NFC Mifare Classic" blog article.