How to retrieve essential smart card info

4.3k Views Asked by At

I am using a simple smart card reader and am wanting to retrieve information that is stored on an EMV chip using the same reader. Currently, I found a library to do so, called pyscard, and it uses python.

At the moment, I have managed to use the documentation and some command codes to get the ATR of my card, including Applet codes, but have not been able to retrieve any of the data that is actually important, as in CardHolder name, PAN, Expiration date, card type(Visa, MasterCard...) etc.

Does the ATR or AID is somewhat useful? Do I have to process or analyze the ATR and AID to get the command codes?

Is there a possibility to get the data, as there are no command codes anywhere, but a lot of stack overflow articles leading mostly nowhere with thorough explanations that are available in Wikipedia and in overall documentation.

The pyscard documentation also did not seem to provide such information.

Also, is it possible to access the library of purchases the user has made, for instance as a list: 4.5euro, 22euro, 5euro.. etc or rather not, or is such data even logged on the chip?

The closest source I found was this link: https://iso8583.info/lib/EMV/TLVs with a duplicate-like article here Retrieve smart card's PAN with Python and pyscard with some documentation here https://www.openscdp.org/scripts/tutorial/emv/reademv.html

Here is also documentation for the pyscard: https://pyscard.sourceforge.io/index.html

Thanks for answering if not for downvoting, as many similar queries I have found, have received such votes.

2

There are 2 best solutions below

0
Tom On

RFIDIOt is an great library to use for this:

https://github.com/AdamLaurie/RFIDIOt

It comes with many examples include ChAP.py which has the code you need to talk to EMV cards.

0
Deepanshu On

SCSH (Smart Card Shell) provided by Card connect can be a useful tool for you. It has some predefined scripts to read EMV cards. Download link is EMV Credit Card Application