The difference between Mifare S50 and Mifare S70
2023-06-25
The difference between Mifare S50 and Mifare S70
One is that the reader sends a request command to the card, and the card type (ATQA) bytes returned by the two responses are different. The card type (ATQA) of Mifare S50 is 0004H, and the card type (ATQA) of Mifare S70 is 0002H. Another difference is the capacity and memory structure of the two. The capacity of the S50 is 1K bytes, and the capacity of the S70 is 4K bytes.
Mifare S50 divides the capacity of 1K bytes into 16 sectors (Sector0-Sector15), each sector includes 4 data blocks (Block0-Block3, we also number the 64 blocks of 16 sectors according to the absolute address 0~63), each data block contains 16 bytes (Byte0-Byte15), 64*16=1024.
Mifare S70 divides the capacity of 4K bytes into 40 sectors (Sector0-Sector39), of which the structure of the first 32 sectors (Sector0-Sector31) is exactly the same as that of Mifare S50, and each sector includes 4 data blocks (Block0 -Block3), each of the latter 8 sectors includes 16 data blocks (Block0-Block15). We also number 256 blocks of 40 sectors according to the absolute address (0~255), each data block contains 16 bytes (Byte0-Byte15), 256*16=4096.
Mifare S50 divides the capacity of 1K bytes into 16 sectors (Sector0-Sector15), each sector includes 4 data blocks (Block0-Block3, we also number the 64 blocks of 16 sectors according to the absolute address 0~63), each data block contains 16 bytes (Byte0-Byte15), 64*16=1024.
Mifare S70 divides the capacity of 4K bytes into 40 sectors (Sector0-Sector39), of which the structure of the first 32 sectors (Sector0-Sector31) is exactly the same as that of Mifare S50, and each sector includes 4 data blocks (Block0 -Block3), each of the latter 8 sectors includes 16 data blocks (Block0-Block15). We also number 256 blocks of 40 sectors according to the absolute address (0~255), each data block contains 16 bytes (Byte0-Byte15), 256*16=4096.
Radio Frequency Identification Technology Discussion (13)——Mifare S50 and Mifare S70
Mifare S50 and Mifare S70 are often referred to as Mifare Standard, Mifare Classic, and MF1. They are the most widely used and most influential cards in compliance with the ISO14443A standard. The capacity of Mifare S70 is 4 times that of S50, the capacity of S50 is 1K bytes, and the capacity of S70 is 4K bytes. The operation timing and operation commands of the reader to the card are exactly the same.
Each card of Mifare S50 and Mifare S70 has a 4-byte global unique serial number. The data on the card has a storage period of 10 years and can be rewritten 100,000 times and read unlimited times. In general applications, there is no need to consider whether the card will be damaged by reading or writing, except for violent hard damage.
There are two main differences between Mifare S50 and Mifare S70. One is that the reader sends a request command to the card, and the card type (ATQA) bytes returned by the two responses are different. The card type (ATQA) of Mifare S50 is 0004H, and the card type (ATQA) of Mifare S70 is 0002H. Another difference is the capacity and memory structure of the two.
Mifare S50 divides the capacity of 1K bytes into 16 sectors (Sector0-Sector15), each sector includes 4 data blocks (Block0-Block3, we also number the 64 blocks of 16 sectors according to the absolute address 0~63), each data block contains 16 bytes (Byte0-Byte15), 64*16=1024.
Each card of Mifare S50 and Mifare S70 has a 4-byte global unique serial number. The data on the card has a storage period of 10 years and can be rewritten 100,000 times and read unlimited times. In general applications, there is no need to consider whether the card will be damaged by reading or writing, except for violent hard damage.
There are two main differences between Mifare S50 and Mifare S70. One is that the reader sends a request command to the card, and the card type (ATQA) bytes returned by the two responses are different. The card type (ATQA) of Mifare S50 is 0004H, and the card type (ATQA) of Mifare S70 is 0002H. Another difference is the capacity and memory structure of the two.
Mifare S50 divides the capacity of 1K bytes into 16 sectors (Sector0-Sector15), each sector includes 4 data blocks (Block0-Block3, we also number the 64 blocks of 16 sectors according to the absolute address 0~63), each data block contains 16 bytes (Byte0-Byte15), 64*16=1024.
Mifare S70 divides the capacity of 4K bytes into 40 sectors (Sector0-Sector39), of which the structure of the first 32 sectors (Sector0-Sector31) is exactly the same as that of Mifare S50, and each sector includes 4 data blocks (Block0 -Block3), each of the latter 8 sectors includes 16 data blocks (Block0-Block15). We also number 256 blocks of 40 sectors according to the absolute address (0~255), each data block contains 16 bytes (Byte0-Byte15), 256*16=4096.
Each sector has a set of independent passwords and access control, placed in the last Block of each sector, this Block is also called the end block, S50 is Block3 of each sector, and the first 32 sectors of S70 The area is also Block3, and the last 8 sectors are Block15.
Sector 0 and block 0 (absolute address block 0) of S50 and S70 are used to store the manufacturer code, which has been solidified and cannot be changed. The card serial number is stored here. Except the vendor block and the control block, the rest of the blocks in the card are data blocks, which can be used to store data. Data blocks can be used in two applications:
(1) It is used for general data storage and can be read and written.
(2) Used as a data value, it can be initialized, added, subtracted, and read.
What is the difference between a data block and a value block? No matter what the content of the block is, you can treat it as normal data, even if it is a value block. But not any data can be regarded as a value, because the value block has a relatively strict format requirement. The length of the value in the value block is the complement of 4 bytes, and the range it represents (-2147483648~2147483647).
Sector 0 and block 0 (absolute address block 0) of S50 and S70 are used to store the manufacturer code, which has been solidified and cannot be changed. The card serial number is stored here. Except the vendor block and the control block, the rest of the blocks in the card are data blocks, which can be used to store data. Data blocks can be used in two applications:
(1) It is used for general data storage and can be read and written.
(2) Used as a data value, it can be initialized, added, subtracted, and read.
What is the difference between a data block and a value block? No matter what the content of the block is, you can treat it as normal data, even if it is a value block. But not any data can be regarded as a value, because the value block has a relatively strict format requirement. The length of the value in the value block is the complement of 4 bytes, and the range it represents (-2147483648~2147483647).
VALUE is the complement of the value, and addr is the block number (0-63). Only with the above format can it be considered as a value block, otherwise it is an ordinary data block.
The tail block of each sector is a control block, including 6-byte password A, 4-byte access control, and 6-byte password B.
The tail block of each sector is a control block, including 6-byte password A, 4-byte access control, and 6-byte password B.
Password A Access Control Password B
The factory password of the new card is generally A0A1A2A3A4A5 for password A, B0B1B2B3B4B5 for password B, or 6 FFs for both password A and password B. Access control is used to set the access conditions of each block in the sector (including the control block itself).
The factory password of the new card is generally A0A1A2A3A4A5 for password A, B0B1B2B3B4B5 for password B, or 6 FFs for both password A and password B. Access control is used to set the access conditions of each block in the sector (including the control block itself).
Card selection and three-way mutual authentication have been introduced earlier. Other operations are as follows:
(1) Read (Read): Read the content of a block, including ordinary data blocks and value blocks;
(2) Write (Write): write data to a block, including ordinary data blocks and value blocks, if data in an illegal format is written in the value block, the value block becomes an ordinary data block;
(3) Add (Increment): add value to the value block, only the value block can be operated;
(4) Decrement: decrement the value block, only the value block can be operated;
(5) Halt: Put the card in the sleep working state, and it can only be woken up by using the WAKE-UP command.
In fact, the addition and subtraction operations are not directly performed in the Mifare block. These two commands first read the value in the Block, and then add or subtract. The result after addition and subtraction is temporarily stored in the volatile data register (RAM) on the card, and then another command is used to transfer (Transfer) Write the contents of the data register to the block. The command corresponding to Transfer is Restore, which is used to store the contents of the block into the data register, but this command is rarely used.
(1) Read (Read): Read the content of a block, including ordinary data blocks and value blocks;
(2) Write (Write): write data to a block, including ordinary data blocks and value blocks, if data in an illegal format is written in the value block, the value block becomes an ordinary data block;
(3) Add (Increment): add value to the value block, only the value block can be operated;
(4) Decrement: decrement the value block, only the value block can be operated;
(5) Halt: Put the card in the sleep working state, and it can only be woken up by using the WAKE-UP command.
In fact, the addition and subtraction operations are not directly performed in the Mifare block. These two commands first read the value in the Block, and then add or subtract. The result after addition and subtraction is temporarily stored in the volatile data register (RAM) on the card, and then another command is used to transfer (Transfer) Write the contents of the data register to the block. The command corresponding to Transfer is Restore, which is used to store the contents of the block into the data register, but this command is rarely used.