Reply To: What is MIFARE Classic 1K Access Bits means? How to calculate and use it?

Forum MIFARE general topics and applications What is MIFARE Classic 1K Access Bits means? How to calculate and use it? Reply To: What is MIFARE Classic 1K Access Bits means? How to calculate and use it?

Re: What is MIFARE Classic 1K Access Bits means? How to calculate and use it?

17. February 2016 at 9:59
Hi NTMS,

In the attachment I see that you are on the right way. But let me explain it for all visitors.

Have a look to table 7 and 8 (I refer to the MIFARE Classic data sheet with the link above). You can see in table 7, with none combination of C1, C2 and C3 you can read the key A, so key A is a write-only value. C1 = 0, C2 = 0 and C3 = 1 is the so called “transport condition” for the sector trailer. With the known value of default key A = FF…FF you authenticate with key A to the sector and you are able to read the access condition (ac) bytes, the key B. You are also able to write to key A, the ac bytes, key B. Table 8 shows the ac bytes for the data blocks 0, 1 and 2. Here is the transport condition C1 = C2 = C3 = 0. This means, you can read, write, increment, decrement all data blocks either with key A or key B.

You want to use key A for reading and key B for writing. This is the setting for the data blocks. In this case key A is known at the reader terminal. Let us assume you want to allow reading data block 0 (the customer ID) and decrement a credit (data value in block 1). But with key A it should not be possible to write to the ID data nor to increment the credit value. In this case C1 = 1, C2 = 1 and C3 = 0 is the ac combination for the data blocks (table 8). Writing end-user data or set a new value for the credit is only possible at the issuer station (with a cashbox) and only here the key B is known.

The sector trailer ac combination could be C1 = 0, C2 = 1, C3 =1 (table 7). Key A and key B can never be read but can be written with key B. Okay, we have:
C10 = 1, C20 = 1, C30 = 0,
C11 = 1, C21 = 1, C31 = 0,
C12 = 1, C22 = 1, C32 = 0,
C13 = 0, C23 = 1, C33 = 1
With this information we go into figure 10 (page 12) and we get for bytes 6, 7 and 8:
00001000  01110111  10001111 = 08778F

Byte 9 can be used also in a user application, you can set it as you like.

That is the same you also find out! Congratulations, you a now ready to prepare a MIFARE Classic to a shopping card application.

The MIFARE Team
+ 0  |  - 0