本文介绍了从ATR确定卡类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用ATR来确定我是否拥有ISO14443A或ISO14443B类型的卡?如果是,怎么办?

Is it possible using ATR to determine whether I have ISO14443A or ISO14443B type card? If yes, how?

推荐答案

正确地 mictter ,仅对ISO 7816接触卡存在真实 AT R .我可以接受这样的论点,即等效于ISO 14443的可能是ATQA/ATQB,因为这是激活后从标签获得的第一个答案,尽管我宁愿说ATR的等效物是ATQA + SAK + ATS的组合( A型)和ATQB + ATTRIB答复(B型)的组合.

As mictter correctly explained, a real ATR only exists for ISO 7816 contact cards. I can follow the argumentation that the ISO 14443 equivalent could be the ATQA/ATQB as this is the first answer you get from tags after activation, though I would rather say that the equvalent of the ATR is a combination of ATQA + SAK + ATS (for Type A) and a combination of ATQB + Answer to ATTRIB (for Type B).

关于您看到的ATR,根据 PC/SC规范.

Regarding the ATR you see, I assume that this is a PC/SC-emulated ATR according to the PC/SC specification.

对于智能卡(ISO 14443-4传输协议),此ATR的格式为

For smartcards (ISO 14443-4 transport protocol) this ATR would have the form

3B 8n 80 01 T[1]..T[n] xx

,其中T[1]T[n]

  1. ISO 14443 Type A的ATS历史字节,或
  2. ATQB应用程序数据(T[1] T[2] T[3] T[4]),ATQB协议信息字段(T[5] T[6] T[7])和ATTRIB MBLI字段(T[8])的串联.
  1. the ATS historical bytes for ISO 14443 Type A, or
  2. a concatenation of the ATQB application data (T[1] T[2] T[3] T[4]), the ATQB protocol information field (T[5] T[6] T[7]) and the ATTRIB MBLI field (T[8]).

因此,如果 guess 是A型或B型智能卡,则可以进行某种形式的匹配. IE.如果 n == 8并且T[1]T[n]中的参数与B型卡的这些字段所期望的匹配.不过,我仍然怀疑您能否获得可靠的任意卡片结果.

So you might be able to do some form of matching to guess if it is a Type A or B smartcard. I.e. if n == 8 and the parameters in T[1] to T[n] match something that you expect for those fields of a Type B card. Still I doubt that you will get reliable results for arbitrary cards.

对于非接触式存储卡,情况肯定会更好.对于这些卡,模拟的ATR如下所示:

For contactless memory cards, the situation is certainly better. For these cards, the emulated ATR looks like this:

3B 8n 80 01 T[1]..T[n] xx

,其中T[1]T[n]包含应用程序标识符存在指示符(标记4F).所以T[1]T[n]通常看起来像这样:

with T[1] to T[n] containing an application identifier presence indicator (tag 4F). So T[1] to T[n] typically look something like this:

80 4F yy A000000306 ss nnnn 00000000

,其中ss标识卡的协议:

0x01: ISO 14443-1 Type A
0x02: ISO 14443-2 Type A
0x03: ISO 14443-3 Type A
0x05: ISO 14443-1 Type B
0x06: ISO 14443-2 Type B
0x07: ISO 14443-3 Type B

nnnn标识卡名(有关完整列表,请参见 PC/SC规范)

and nnnn identifying the card name (see the PC/SC specifications for a full list).

这篇关于从ATR确定卡类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 01:47