Classic 1K : Write To A Previous Block Without Re-Authenticating

Forum / MIFARE general topics and applications / Classic 1K : Write To A Previous Block Without Re-Authenticating

  • 15. March 2018 at 4:31
    Hi Guys,

    I'm hoping to find a little bit more info regarding the AUthentication requirements during a single card operation, specifically if it's required to reauthenticate with a card if returning to a previous sector.

    For instance, the following scenario where I connect to the card, read sectors 1-5 authenticating with each sector as i move along the cards memory. However after doing these read operations then write back to these sectors 1->5 in the same order. I originally believed i would have to re-authenticate with each sector again however reading through the android documentation the following comment makes me think that may not be required?

    https://developer.android.com/reference/android/nfc/tech/MifareClassic.html#authenticateSectorWithKeyA(int, byte[])

    Successful authentication of a sector with key A enables other I/O operations on that sector. The set of operations granted by key A key depends on the ACL bits set in that sector. For more information see the MIFARE Classic specification on

    "A failed authentication attempt causes an implicit reconnection to the tag, so authentication to other sectors will be lost. "
    [/b]

    My question is if you weren't able to authenticate with more than 1 sector at a time (without being required to re-authenticate anyway) wouldn't the authentication with the other "sectors" be lost anyway?

    + 0  |  - 0

    Re: Classic 1K : Write To A Previous Block Without Re-Authenticating

    15. March 2018 at 9:50
    Hi Matthew,

    An authentication has effect only to one sector. If you move to another sector, you must authenticate to this sector.

    Let’s say you want to read from block 1 and 5. Block 1 belongs to the first sector and block 5 to the second. Then you must authenticate to block 0 (or 1, 2, 3), read from block 1. Then you must authenticate to block 4 (or 5, 6, 7) and read block 5.

    The TapLinx team

    + 0  |  - 0

    Re: Classic 1K : Write To A Previous Block Without Re-Authenticating

    15. March 2018 at 10:36
    Yes i understand that but what after reading block 5 you want to go back to read block 3 again for instance (do you then have to authenticate with the sector once more?

    For example (1 Card Session / Using connect() function)
    Authenticate (Sector 0) -> Read Block 2 -> Authenticate (Sector 1) -> Read Block 5 -> Write Block 1 (Do i need to re-authenticate with sector 0 again)?
    + 0  |  - 0

    Re: Classic 1K : Write To A Previous Block Without Re-Authenticating

    19. March 2018 at 9:17
    Hi Matthew,

    Yes, you must authenticate again. Therefore it is useful, to collect data in one sector which are need to be read together. The MIFARE Classic 1K contains 16 sectors with 4 blocks, but the Classic 4K contains 32 sectors with 16 blocks and 8 sectors with 16 blocks. So, if you need more than 4 consecutive blocks, you ca use the 4K card.

    The TapLinx team

    + 0  |  - 0
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.