You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@therealri Im trying to authenticated a card but any solutions its working for me in all the code that i have trying return code: operation_failed
#109
Open
saulmonci opened this issue
Jan 7, 2021
· 0 comments
... memory is organized in 16 sectors of 4 blocks. One block
contains 16 bytes.
When accessing these blocks with this library, blocks are numbered as follows:
sector 0:
block 0 – manufacturer data (read only)
block 1 – data block
block 2 – data block
block 3 – sector trailer
sector 1:
block 4 – data block
block 5 – data block
block 6 – data block
block 7 – sector trailer
sector 2:
block 8 – data block
block 9 – data block
block 10 – data block
block 11 – sector trailer
and so on
That's important, it's that the last block in each sector is "sector trailer" (see Section 8.6.3), which contains access conditions for the other 3 data blocks.
So block 7, which you are trying to write to in your code, is not for data. After you write to it, it changes access conditions (including key) and you cannot authenticate your card then.
I don't have any Mifare Classic card to test it, but according to documentation it is quite clear.
Could you please update your code (remove interaction with block 7, see updated gist here) and test it with a NEW BLANK card if it works?
Hope it helps and looking forward to your answer.
PS Don't forget to star ⭐️ my library, if you find it useful. 😃 Thanks.
@therealri I think that the problem is here:
I am looking into the technical documentation of Mifare Classic 1K.
Section 8.6 is about Memory organization.
When accessing these blocks with this library, blocks are numbered as follows:
That's important, it's that the last block in each sector is "sector trailer" (see Section 8.6.3), which contains access conditions for the other 3 data blocks.
So block 7, which you are trying to write to in your code, is not for data. After you write to it, it changes access conditions (including key) and you cannot authenticate your card then.
I don't have any Mifare Classic card to test it, but according to documentation it is quite clear.
Could you please update your code (remove interaction with block 7, see updated gist here) and test it with a NEW BLANK card if it works?
Hope it helps and looking forward to your answer.
PS Don't forget to star ⭐️ my library, if you find it useful. 😃 Thanks.
Originally posted by @pokusew in #16 (comment)
The text was updated successfully, but these errors were encountered: