I am using an ACS card reader. I have a contactless VISA card. By reading the card I get the following hex ATR information:
3B 6E 00 00 80 31 80 66 B1 A3 01 01 21 0A 83 00 90 00
From the above ATR, how I can detect the card number and type?
I am using an ACS card reader. I have a contactless VISA card. By reading the card I get the following hex ATR information:
3B 6E 00 00 80 31 80 66 B1 A3 01 01 21 0A 83 00 90 00
From the above ATR, how I can detect the card number and type?
You can't.
That ATR (answer-to-reset) does not contain such information. In fact, since your card is a contactless card (ISO/IEC 14443-4), it does not even have an ATR, but an ATS (answer-to-select), which is the contactless "equivalent" (at least in terms of contained information) of an ATR.
Instead, you would need to exchange APDUs (ISO/IEC 7816-4) with your card to get further information from it. Since you refer to VISA, your card probably speaks the EMV protocol for contactless cards (see http://www.emvco.com/).
ATR = Answer to reset, is hex string getting from the card as a response of Reset command sent by the IFD/Card_Reader. It tells about card properties like-
- card speed
- protocol (T=0, T=1) supported by card
- etc..
If you need to get the card number/ PAN from the card you need to fire Read_Record command to get the value from the card. Sequence will be like:-
Contactless PPSE:
00A404000E325041592E5359532E444446303100 // ppse command
it will give you the AID of application installed in the card, in your case it will be
A0 00 00 00 03 10 10 //VISA AID
Select application
00 a4 04 00 07 A0 00 00 00 03 10 10 00
then Fire GPO command , it will give you AFL detail. Next you need to fire Read Record command and search for PAN Tag ( 5A).
this SO post can be useful for you..hope this information helps you to get the card number/PAN as you are looking for.