将Mifare Ultralight与Mifare Ultralight C区分开 [英] Distinguish Mifare Ultralight from Mifare Ultralight C

查看:499
本文介绍了将Mifare Ultralight与Mifare Ultralight C区分开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可靠的方法来确定RFID卡是Mifare Ultralight还是Mifare Ultralight C?

Is there a reliable way to find out if an RFID card is either a Mifare Ultralight or a Mifare Ultralight C?

到目前为止,我发现的唯一方法是利用这两张卡的尺寸差异来发出较小的卡的边界之外的读取命令. 但这看起来确实像是黑客,我假设如果卡使用Ultralight C身份验证机制,则读取命令可能会失败.

The only way i found so far is utilizing the difference in size of those two cards issuing a read command beyond the boundaries of the smaller one. But it does look like a hack and i assume the read command might fail if the card uses the Ultralight C authentication mechanism.

const char* mifare_ultralight_identification(const nfc_target_info_t nti)
{
  byte_t abtCmd[2];
  byte_t abtRx[265];
  size_t szRxLen;

  abtCmd[0] = 0x30;  // MIFARE Ultralight READ command
  abtCmd[1] = 0x10;  // block address (1K=0x00..0x39, 4K=0x00..0xff)

  if (!nfc_initiator_transceive_dep_bytes(pnd,abtCmd,2,abtRx,&szRxLen)) {
    // READ command of 0x10 failed, we consider that Ultralight does have 0x10 address, so it's a "simple" Ultralight (i.e. not a Ultralight C)
    // When a READ failed, the tag returns in HALT state, so we need to reselect tag
    nfc_initiator_select_passive_target(pnd, NM_ISO14443A_106, nti.nai.abtUid, nti.nai.szUidLen, NULL);
    return "";
  }
  return " C";
}

来源

推荐答案

是的,如果您有关于MIFARE Ultralight C身份验证机制如何工作的文档,则是可能的. MIFARE Ultralight不支持此功能,因此会引发错误情况.

Yes, it is possible if you have the documentation on how the MIFARE Ultralight C authentication mechanism works. MIFARE Ultralight does not support this, so it will raise an error condition.

这篇关于将Mifare Ultralight与Mifare Ultralight C区分开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆