The procedure of Mifare Classic 1K is
- Polling for tags
- Authenticate those tags
- If authentication succeded then read/write.
I already completed those procedures and also read and write data from specific sectors.
Command for Polling for tags is
new byte[] { (byte) 0xFF, (byte) 0x00, (byte) 0x00,
(byte) 0x00, (byte) 0x04, (byte) 0xD4, (byte) 0x4A,
(byte) 0x01, (byte) 0x00 }
Authentication command is
new byte[] { (byte) 0xFF, (byte) 0x86, (byte) 0x00,
(byte) 0x00, (byte) 0x05, (byte) 0x01,(byte) 0x00, (byte) 0x04,
(byte) 0x60,(byte) 0x00 };
Here "(byte) 0x01" is the Sector 1
And Write on Sector 1, block 5 is
new byte[] { (byte) 0xFF, (byte) 0x00, (byte) 0x00,(byte) 0x00, (byte) 0x15, (byte) 0xD4,
(byte) 0x40,(byte) 0x01, (byte) 0xA0, (byte) 0x05,(byte) 0x01, (byte) 0x02,
(byte) 0x03,(byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07,(byte) 0x08,
(byte) 0x09,(byte) 0x0A,(byte) 0x0B, (byte) 0x0C, (byte) 0x0D,(byte) 0x0E,
(byte) 0x0F, (byte) 0x10};
Here
(byte) 0x01, (byte) 0x02, (byte) 0x03,(byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07,(byte) 0x08,(byte) 0x09,(byte) 0x0A,(byte) 0x0B, (byte) 0x0C, (byte) 0x0D,(byte) 0x0E,(byte) 0x0F,(byte) 0x10
is data those are writing on block 5 on Sector 1.
Read From Sector 1 and Block 5 Command is
new byte[] { (byte) 0xFF, (byte) 0x00, (byte) 0x00,
(byte) 0x00, (byte) 0x05, (byte) 0xD4, (byte) 0x40,
(byte) 0x01, (byte) 0x30, (byte) 0x05 };
My Related Complete Code is here...
My Problem is how can I "Lock/make read only" a block from a specific sector?
See Question&Answers more detail:
os