4
votes

Can anyone tell me what is the data structure of EMV cards?

In case of magnetic stripe cards track data is used, which contains PAN, User details, Expiry date, CVV, etc.

What do we read when EMV card is inserted into the card reader?

I went through a few documents and sites and it was hard for me to understand.

A little help would be appreciated.

6

6 Answers

6
votes

The EMV card contains chip. This chip manages the file system that stores the data needed by each card application.

There are 2 categories of files, DF(Dedicated files) and EF(Elementary files). They are organized in hierarchical tree, DF as branches and EF as leaves.

EMV file system

The highest DF in file is also called MF(Master file). EF1 contains all information related to card, like, administrative and general security information, ICC serial number, access control keys, card’s general PIN. These information can be used to create one more DF at MF level.

5
votes

MagStripe and EMV cards rely on two different principles :

  • a mag stripe card is just a passive info storage : you read the info from the card and then use it as needed
  • an EMV card is a small computer, with its own CPU, ram, storage. When inserted in the reader, it powers on, and a dialog is started by sending commands to the card (APDUs) and analyzing its responses.

The sequence of commands depends on the type of card (ex : Visa, mastercard, contact or contactless, etc.). You have to read and implement the full EMV specification, or to buy an EMV Kernel.

More info is this SO question, you can find an example of a full contactless EMV transaction here.

2
votes

What do we read when EMV is inserted into card reader?

There are many things to read from EMV card. Here is an example.

It is well known that all EMV cards do not ask for PIN at POS. Some ask and then the user needs to enter their PIN.

What do you think where is it defined whether the PIN is asked for or not?

It is defined on the EMV card, in form of a tag. Here tag 8E (Cardholder Verification Method (CVM) List) defines whether card is pin based or not.

The POS terminal reads the card and checks tag 8E to make a decision about PIN usage. If tag 8E value requests online/offline pin, the POS asks user for the PIN.

Hope this small example helps you to identify what a EMV card contains and why the POS needs to read the card.

1
votes

As @Nicolas Riousset writes -- have a look at EMV Specifications, especially Book 3 - Application Specification which contains a nice summary of possible data elements in Annex A.

In addition, different issuers and payment systems define additional elements which can be present on the card.

Which particular elements are used on a given card is up to the card issuer (and probably governed by the relevant payment system).

1
votes

EMV Chip read you will need to gather all the tags that you get back from the terminal and send them to the gateway company you use.

Tag 5A contains your pan.

If you do regular swipe, tag 57 contains those track data you can use.

0
votes

EMV Chip read you will need to gather all the tags that you get back from the terminal and send them to the gateway company you use.

Tag 5A contains your pan.

If you do regular swipe, tag 57 contains those track data you can use.