circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 97, August 1998
Designing for Smart Cards - Part 2: Practical Implementation


SYSTEM TYPES

There are two types of smart-card systems—open and closed. In an open system, the card may be used for transactions between many operators. In closed systems, the cards are used with one operator (usually the issuer).

Examples of an open system include phone cards and electronic purses. In those cases, the card establishes a unique identity and eligible services for use with a phone system or for making debits at various point-of-sale terminals.

The simplest case—a closed smart-card system—involves one type of card and one type of reader (e.g., a card used with one mass transit carrier). And, there is a known identification procedure between them, which can be implemented in the answer-to-reset (ATR) string.

The ATR is the first message in a smart-card session with a reader and is sent by the card immediately after powerup (provided that a clock is supplied along with the power). The ATR message contains data that defines relevant transmission protocols and other information.

ISO defines the ATR to have a maximum length of 33 bytes, although this length is seldom reached. As you see in Figure 2, the ATR consists of:

  • an initial character, TS
  • a format character, T0
  • several interface characters
  • a maximum of 15 historical characters
  • a check character, TCK

Figure 2

Figure 2The ATR string, which has a maximum of 33 bytes, is broken down into five main sections.

TS defines the conventions to code data bytes in all subsequent transmissions. There are two conventions—direct ($3B) and inverse ($3F). All terminals can read both, and most card manufacturers are capable of both.

The format character consists of two parts. One part indicates the subsequent interface characters, and the other indicates the number of historical bytes to follow (1–15).

Information transmitted via the interface characters includes the transmission protocol (e.g., T=0 or T=1), the maximum current the reader should supply to the card, and any other transmission parameters pertinent to communicating with the card.

The historical characters may contain any information, such as the manufacturer of the card, software version on the chip, or traceability data. The number of historical bytes is indicated in the least significant half of the interface character.

The last byte of the ATR string is the check character. This byte is defined by ISO 7816-4 to be "a value such that the exclusive ORing of all bytes from T0 to TCK included is null."