Reputation: 651
I am using a Mifare classic 1k reader, and it comes with the default key A and B which is:
FFFFFFFFFFFF
Using the Key A to read and write works. but I want to change the keys.
Is there anyway to get the correct access bits for the sector and what is the format?
What I have done now is,
<newKey>+ access bits + <oldKEY>
212121212121078069FFFFFFFFFFFF
The access bits 078069
I got from reading block 7 of sector 1, which is like this:
000000000000FF078069FFFFFFFFFFFF
But there is error.
Are the access bits incorrect or is the format wrong?
Upvotes: 4
Views: 14707
Reputation: 31
What you need to do is, if access bits have permission (and your's seems like they do), is to write:
AAAAAAAAAAAA078069BBBBBBBBBBBB
where AAAAAAAAAAAA and BBBBBBBBBBBB are the NEW A & B keys, respectively. (You never write the old keys, you authenticate with onthem first).
When you read, using key A, you'll always get
000000000000078069BBBBBBBBBBBB
Key A will allways be masked
Upvotes: 0
Reputation: 10228
Depending on the access control settings of the sector trailer, you may need to authenticate with key A or key B to be able to write keys. See the section 8.7 (and specifically 8.7.2) of the datasheet at http://www.nxp.com/documents/data_sheet/MF1S70YYX.pdf on how to encode/decode the access control bits in the sector trailer.
Upvotes: 4