简体   繁体   English

我可以通过值块中存储的地址开始对 Mifare 经典卡进行身份验证吗?

[英]Can I start authentication of Mifare classic card by the address stored in value block?

Background information背景资料
I was studying Mifare Classic 1K (S50) protocols.我正在研究 Mifare Classic 1K (S50) 协议。 Most of the data come from this document .大部分数据来自这份文件

I found that authentication command is 60 (with keyA) or 61 (with keyB) followed by 1 byte of address (two bytes of CRC is ignored in this question).我发现身份验证命令是 60(带 keyA)或 61(带 keyB)后跟 1 个字节的地址(本题忽略两个字节的 CRC)。 The address is the block number of the block you want to access.该地址是您要访问的块的块号。 For example, Mifare Classic 1K has 16 sectors with 4 blocks in each sector.例如,Mifare Classic 1K 有 16 个扇区,每个扇区有 4 个块。 This gives a total of 64 blocks.这给出了总共 64 个块。
If I want to authenticate for block 3 in Sector 0, the address should be 0 * 4 + 3 = 3 which is 0x03;如果我想对扇区 0 中的块 3 进行身份验证,地址应该是0 * 4 + 3 = 3即 0x03; if I want to authenticate for block 2 in sector 12, the address should be 12 * 4 + 2 = 50 which is 0x32.如果我想对扇区 12 中的块 2 进行身份验证,地址应为12 * 4 + 2 = 50 ,即 0x32。 Any address greater than or equal to 64 (0x40) should be rejected because Mifare 1K does not have that many blocks.任何大于或等于 64 (0x40) 的地址都应该被拒绝,因为 Mifare 1K 没有那么多块。

However, I have noticed that data blocks can be configured as value blocks.但是,我注意到数据块可以配置为值块。 In the end of a block the 4 bytes are the address value (3 out of 4 bytes are backup values for the address).在块的末尾,4 个字节是地址值(4 个字节中的 3 个是地址的备份值)。

Question
I am confused but I can't actually test it: If I set the address of a value block (let's say it is block 2 of sector 12, which is 0x32) to be 0x41, could I authenticate this block by sending the command 0x60 0x41 ?我很困惑,但我无法实际测试它:如果我将值块的地址(假设它是扇区 12 的块 2,即 0x32)设置为 0x41,我可以通过发送命令0x60 0x41来验证此块0x60 0x41 If I could, can I still authenticate this block by sending 0x60 0x32 ?如果可以的话,我还能通过发送0x60 0x32来验证这个块吗?

Thank you in advance!先感谢您! If my description is confusing please leave a message!如果我的描述令人困惑,请留言!

No, the authentication does not change by setting the address bytes, consider the address bytes as an informational addition to the stored value.不,身份验证不会通过设置地址字节而改变,将地址字节视为存储值的信息补充。

Nothing in Mifare protocol will resolve the address or do something with the data pointed to automatically. Mifare 协议中的任何内容都不会解析地址或对自动指向的数据进行处理。 The byte is just a hint for an intelligent application, where to look in fallback-case of desaster.该字节只是一个智能应用程序的提示,在灾难的后备情况下在哪里查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM