2
votes

I have one communication between terminal and chip on APDU, and I need to decode that communication.

It's something like this:

Terminal: 00 B6 02 00 06 00
Chip: 49 55 7B 2C 1F 30 57 35 63 7D 24 7B 60 21
Terminal:00 B5 03 0B 04 02 00
Chip:45 43 3C 3B 4A 31 51 35 53 4B 34 2C 30 21 

From what I know, terminal is sending commands to smart card chip, and smart card chip is giving response. So, I need to know what is their communication about. It has to do with EMV standards and APDU.

How can I decode it? What are the steps and rules?

1
You should search for ISO 7816-4 (smart card commands, fle system, philosophy) and EMV specifications.guidot

1 Answers

4
votes

The communication between chip and terminal is using APDUs. Command APDU and response APDU. Below will give you idea about the struct of messages. For detailed reading download the documents(those are called books in emv world) from here. Infact the below are copy paste from Book 3. Have a detailed look and come back if you need more information.

All data are in hex.

  • The command APDU has the below format.

[Class] [Instruction] [Parameter 1] [Parameter 2] [Length of command Data] [Command]

[Length of maximum expected data response]

  • Response APDU has the format

[Data] [2 bytes status of APDU execution( See coding of Sw1 Sw2 below]

  • Coding of the Class Byte

The most significant nibble of the class byte indicates the type of command. 0' Inter-industry command, '8' Proprietary to this specification.

  • Instruction bytes define the funtions you wish to do. Coding of the Instruction Byte is enter image description here

enter image description here