JuanD
JuanD

Reputation: 301

APDU Command to read card number

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!

Upvotes: 4

Views: 44707

Answers (2)

Karu Ma
Karu Ma

Reputation: 323

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.

Upvotes: 10

kdmin
kdmin

Reputation: 434

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.

Upvotes: 4

Related Questions