1
votes

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
I am thinking it should be possible, as people who skim credit cards are certainly able to do so.john_snow5214
And payment terminals are most certainly able to do so, as the network would not know how to route the numbers if they are not accurate, what network to use and to which bank to make the request for approvaljohn_snow5214
This is significantly too broad, but for a start: pyscard is just the transport medium for the commands, it is not relevant here, since you are asking for the commands to send. The assumption, that youre program is able to do something because type-approved payment terminals can, is somewhat ambitious.guidot
Well mostly, I just need to read the info, not transmit or send new information. The details that are stored on the chip are no use to me, because they are seen on the card.john_snow5214
Please, look at this answer: stackoverflow.com/questions/58299515/…Juris

2 Answers

2
votes

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

1
votes

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.