4

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Shashank B Rai
  • 105
  • 1
  • 8

6 Answers6

6

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.

Darshn
  • 1,512
  • 1
  • 23
  • 31
  • 1
    This is not how EMV works, however. (Apart from the PSE). In EMV you SELECT the EMV Application and then use EMV specific commands to read records, etc. The structure of the data depends on what you're trying to do. Check out EMV Book 3 and look for AFL (Application File Locator) which should include information about the relevant information stored on the card. – a2800276 Nov 12 '15 at 13:47
5

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.

Nicolas Riousset
  • 3,447
  • 1
  • 22
  • 25
2

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.

a2800276
  • 3,272
  • 22
  • 33
Arjun
  • 3,491
  • 4
  • 25
  • 47
1

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).

vlp
  • 7,811
  • 2
  • 23
  • 51
1

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.

jjlei
  • 109
  • 7
0

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.

Arpit
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 27 '22 at 15:01