APDU Command to read card number

39,026

Solution 1

First of all let me tell you that there isn't a easy way.

You have to look into the EMV documentation, this tutorial is pretty good.

http://www.openscdp.org/scripts/tutorial/emv/index.html

All the information in a Chip Card is in bytes, mostly coded in TLV. The card generally has multiple records where the information is stored, you have to loop that records to find the tag "5a" which is the one of the PAN.

Hope it helps.

Solution 2

The card number that you are talking about is the PAN = Primary Account Number

This data is contained in Track 1 and Track 2, as exposed here.

You can retrieve this data from chip via APDU commands. There is a step by setp on how to do that here.

Share:
39,026
JuanD
Author by

JuanD

Updated on July 05, 2022

Comments

  • JuanD
    JuanD almost 2 years

    I would like to know if it's possible to get a Debit/Credit Card number from a SmartCard, I' trying to get it using a SmartCard reader with the communication protocol PC/SC,CCID and the card interface ISO/IEC 7816-1/2/3 SmartCard,MicroSD interface ISO 7816-4 SmartCard.

    So far I just get the type of the card inserted (Visa, Mastercard, Maestro, etc.)

    Thanks!