In ISO/IEC 7816-4, the core standard for smart card commands and file organization, the SELECT command (INS code A4) is how a terminal or reader chooses which application (called a Dedicated File or DF) or data file (Elementary File or EF) becomes the current one on the card. Everything else the card does afterward—reading data, authenticating, running transactions—happens in the context of whatever was last selected. Think of it as navigating a file system: you have to “cd” into a directory before you can work with the files inside it.
The command works by sending an APDU with specific parameters. P1 tells the card how to interpret the identifier you’re providing (e.g., P1 = 00 for short file ID, P1 = 04 for selection by DF name, which is the AID). P2 controls details like whether this is the first selection, the next one in a series, and what information the card should return (FCI template, FCP, etc.).
When selecting an application by AID (the usual way for multi-application cards), the standard supports two important variations that tie into your second question about privacy.
Full AID selection requires sending the complete Application Identifier (5–16 bytes). The card matches it exactly. This is straightforward, but in contactless environments it can be a privacy risk because anyone eavesdropping on the radio communication sees the exact AID, which often reveals the issuer, card type, or even specific product—information that could be used to track or profile the cardholder.
Partial AID selection lets the terminal send only a prefix of the AID (truncated from the right). The card then selects the DF whose name has the longest match starting from the left. You use P2 = 00 for the first/only occurrence and P2 = 02 for the next matching one if several DFs share the same prefix. This is why the standard mentions “preferably complete” for the first command but allows the same (possibly shorter) data field on subsequent ones.
Partial selection gives some privacy because the terminal doesn’t have to transmit sensitive proprietary parts of the AID (the PIX bytes after the registered RID). It only sends the common prefix, making it harder for a passive listener to fingerprint the exact application.
Even better privacy comes from indirect selection through a directory file. ISO 7816-4 supports an optional EF.DIR (or information in historical bytes/ATR) that lists available applications. In practice, payment standards like EMV built on this idea with the fixed-name PPSE (‘2PAY.SYS.DDF01’). The terminal always selects this same well-known name first—no card-specific AID is sent over the air. The card responds with a list of supported payment applications (their full AIDs and priorities), and only then does the terminal explicitly select the desired one. This is often referred to in industry discussions as “selection with privacy” because the initial discovery step reveals nothing about which applications are actually present or chosen.
Practical example you can try yourself
If you have a smart card reader and a test card (or emulator), here is the APDU for selecting the PPSE—this is the privacy-friendly first step in every contactless payment:
Command APDU (hex):
00 A4 04 00 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00
(That’s CLA=00, INS=A4, P1=04, P2=00, Lc=0E, data=”2PAY.SYS.DDF01″)
A typical response from a payment card starts with 6F (FCI template) and contains a list of supported AIDs inside BER-TLV tags.
For partial selection, imagine two applications sharing the same RID A000000004 (Mastercard). You could send a short prefix like A000000004 and get the first matching one, then use P2=02 to get the next.
A very short Python snippet using pcsc (pyscard library) to send that PPSE select:
from smartcard.System import readers
from smartcard.util import toHexString, toBytes
r = readers()[0]
connection = r.createConnection()
connection.connect()
SELECT_PPSE = [0x00, 0xA4, 0x04, 0x00, 0x0E, 0x32, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31, 0x00]
data, sw1, sw2 = connection.transmit(SELECT_PPSE)
print("Response:", toHexString(data), "SW:", hex(sw1), hex(sw2))
Run this on a contact or contactless reader with a payment card inserted, and you’ll see the directory response—this is exactly how real terminals discover applications without compromising privacy.

















