print · source · login   

Bank Card

Related publications:[ARP13]

Description

Bank cards (or debit cards) are smart cards used for payment systems. All smartcards follow the ISO/IEC 7816 standard [ISOIEC7816]. Here communication is in master-slave mode: the terminal sends a command to the card, and the card returns a response, after which the terminal can send another command, etc. Commands and responses are simply sequences of bytes with a fixed format and meaning, called APDUs (Application Protocol Data Units). The second byte in a command APDU is the instruction byte, and specifies the instruction that the smartcard is requested to perform. The last two bytes of a response APDU are the status word, which indicates if execution of the command went OK or if some error occurred. The ISO/IEC 7816 standard defines some standard instruction bytes and error codes. Standard instructions we used to infer the behaviour of bank cards include:

  • the SELECT instruction to select which of the possibly several applications on the smartcard the terminal wants to interact with;
  • the VERIFY instruction to provide a PIN code to the card for authentication of the cardholder;
  • the READ RECORD instruction to read some data from the simple file system that the card provides;
  • the GET DATA instruction to retrieve a specific data element from the card (for example the PIN try counter, which records how often the PIN can still be uessed);
  • the INTERNAL AUTHENTICATE instruction to authenticate the card; the terminal supplies a random number as argument to this command which the smartcard then encrypts or signs to prove knowledge of a secret key.

Most smartcards issued by banks or credit cards companies adhere to the EMV (Europay-MasterCard-Visa) standard [EMVCo]. This standard is defined on top of ISO/IEC 7816. It uses some of standard instruction bytes (incl. those listed above), but also defines additional ones specific to EMV, including:

  • the GENERATE AC instruction to let the card generate a so-called Application Cryptogram (AC);
  • the GET PROCESSING OPTIONS instruction to initialise the transaction, provide the necessary information to the card and retrieve the capabilities of the card.

The finite state machine models obtained from real bankcards provide a useful insight into decisions (or indeed mistakes) made in the design and implementation, and would be useful as part of security evaluations not just for bank cards but for smartcard applications in general as they can show unexpected additional functionality that is easily missed in conformance tests.