Mifare Ultralight C Authentication On Android
Solution 1:
What you are doing wrong is that you did not actually implement the MIFARE Ultralight C authentication. On MIFARE Ultralight C tags, writing to pages 0x2C..0x2F does exactly what the command says: It writes to that pages, but it does not perform any authentication.
Instead, MIFARE Ultralight C implements a three-way mutual challenge-response authentication protocol. This protocol is started by sending an AUTHENTICATE command:
byte[] result1 = mifare.transceive(newbyte[] {
(byte)0xA1, /* CMD = AUTHENTICATE */
(byte)0x00
});
In response to that command, you will get a challenge that you need to decrypt using the authentication key, manipulate, encrypt and send back to the tag to proof that you actually posess the authentication key. You can find some code that implements MIFARE Ultralight C authentication in this Q/A: Android: Authenticating with NXP MiFare Ultralight C.
Post a Comment for "Mifare Ultralight C Authentication On Android"