- 360 page book
- CD with source code
- 3K Multiflex smart card
Smart Card Developer’s Kit
$49.99 – $69.99
Only 1 left in stock
Publisher : Macmillan Technical Pub (February 13, 1998)
Authors: Scott B. Guthery, Timothy M. Jurgensen
Language : English
Textbook Binding : 360 pages
ISBN-10 : 1578700272
ISBN-13 : 978-1578700271
Smart Card Details
The Multiflex card conforms to the ISO 7816-4 standard and also implements a few additional commands (for example, create file – which is missing from the ISO 7816-4 standard).
2. Activating Smart Cards: Reset and Answer to Reset
The ATR for the Multiflex is: 3B16 0216 1416 5016. The meaning of each byte is explained in Table 6.1.
|TS||Bit synchronization||3B16||1 is voltage high|
|T0 – high order||Other fields present||016||No other T fields present|
|T0 – low order||Number of historical bytes||216||2 historical bytes present|
|T1||First historical byte||1416||Component code|
|T2||Second historical byte||5016||Mask code|
Table 6.1: The ATR for the Multiflex smart card.
As mentioned in Chapter 3 the first part of the ATR (up to the historical bytes) is governed by ISO 7816-3. Schlumberger uses the historical bytes to identify the microcontroller and the operating system in the ROM. The component code (1416) means that the chip is a Motorola SC21 and the mask code (5016) indicates that the ROM contains the Multiflex operating system.
After the card has transmitted the ATR to the reader, it enters a polling loop, listening for a command from the application program on the reader side.
3. Directories and Files
The Multiflex supports the following five types of files:
|File Type||Value||Max Record Size||Max Number of Records|
|Record file (fixed-length records)||0216||255 bytes||255|
|Record file (variable-length records)||0416||255 bytes||255|
|Cyclic file||0616||255 bytes||255|
Table 6.2: File types supported by the Multiflex.
3.1 Selecting a Directory
C016 A416 0016 0016 0216 3F16 0016. The meaning of each byte is explained in Table 6.3.
|P3||Third parameter||0216||Two data bytes to follow|
|Data||Data||3F16||Field of file to be selected|
Table 6.3: The Multiflex Select File command.
A smart card responds to a command by sending either one to two status bytes known as status word 1 (SW1) and status word 2 (SW2). These bytes inform the reader application of the result of the command. The Multiflex card returns the following response to the above command:
This response indicates that the command was completed successfully, but the card has some additional information. The second byte indicates how much information is available i.e. 1416 (20 bytes). A Get Response command must be sent to the card with the number of bytes as its argument in order to retrieve this information, as shown below.
C016 C016 0016 0016 1416
The 20 bytes of file description information returned from the Get Response command indicates how many bytes are available for new files and subdirectories in the current directory. It also reveals how many subdirectories, elementary files, secret codes and PIN files are in the current directory. The information also indicates which file was selected and its file type as well as the operations that are allowed on that file type. In addition the information shows the access conditions for the various operations on the selected file. The Multiflex supports seven possibilities for access conditions. These are shown in Table 6.4.
|Key Knowledge Needed||Value of Access Condition|
|None – operation always possible||
|PIN (4 digits)||
|Protected (8 byte cryptographic key)||
|Authenticated (8 byte cryptographic key)||
|PIN and protected||
|PIN and authenticated||
|None – operation never possible||
Table 6.4: Access conditions supported by the Multiflex smart card.
3.2 Selecting an Elementary File
An unused Multiflex card contains two elementary files. The first if the serial number file with filename 000216 and the second is the transport key file with filename 001116. The serial number file contains a sequence of eight bytes that uniquely identifies the particular smart card. It includes a series number, customer identification code, Schlumberger manufacturing site and usage.
The transport key file contains the transport key that locks the card. The purpose of this key is to protect the card from unauthorized access while being transported from the manufacturer to the customer. The key is usually sent to the customer “out of band” i.e. by post, telephone, fax etc. A simple transport key is sufficient for low-value cards while higher value cards may use more complex transport key protocols. For example, each card may have a different transport key that is a function of the serial number of the card. This is known as a diversified key.
Once the card has been unlocked using the transport key, an application can then be written onto the card. The process of creating a specific application on a generic smart card is known as personalization. This process may also include writing specific data into the files created on the card, for example storing a fingerprint of the card owner. The personalization process should either delete or overwrite the transport key.
When an elementary file is selected using the Select File command, the card should return the following status code:
This means that there are 0F16 (15 bytes) of descriptive information about the file available. This information includes the number of bytes in the selected file, its file ID and type. It also includes access conditions for the various operations on the selected file.
3.3 Keys and Key Files
The Multiflex smart card uses two types of keys:
- PIN codes
- Cryptographic keys
PIN codes are usually four digits in length, however they may be up to eight digits in length. They are used by the card to ensure that the person attempting to use the card is authorized to do so. Typically, the user is prompted to enter a PIN on a keypad or keyboard attached to the reader containing the card. The value entered is sent to the card via the Verify PIN command. If this matches with the value stored in the current PIN file then the access level on the card is set to CHV (cardholder verified). All operations authorized by the CHV access condition can then be performed.
Cryptographic keys are used for mutual authentication between the card and the reader or computer. There are four ways of using cryptographic keys:
- Verify key – the reader can demonstrate knowledge of a key by simply sending the key to the card.
- External authentication – the reader can demonstrate knowledge of a key by using the key to encrypt a challenge provided by the card.
- Internal authentication – the card can demonstrate knowledge of a key by using it to encrypt a challenge provided by the reader.
- Protected-mode commands – the reader can use a command protected by a key by sending a challenge encrypted with the key along with the command.
Both internal and external authentication are more secure than verifying the key since the key itself is not transferred over the communication channel.
Each directory on the Multiflex card may contain up to three key files that control access to the files in that directory. The key files are transparent elementary files with special reserved names. These files are shown in the table below.
|Key File Identifier||Key File Name||Key File Contents||Max Keys|
|000016||PIN file||PIN code||1|
|000116||Internal authentication file||Cryptographic keys||16|
|001116||External authentication file||Cryptographic keys||16|
Table 6.5: Key files supported by the Multiflex.
The PIN file contains 23 bytes of data. This data contains the PIN code, the number of attempts allowed, the number of attempts remaining until the card is blocked, the unblocking code, the number of unblocking attempts allowed and the number of attempts to unblock the card remaining until the card is blocked indefinitely.
Both the internal and external authentication files have the same format and contain 38 bytes of information. This information includes the length of the key, the algorithm used with the key, the key itself, the number of attempts allowed, the number of attempts remaining until the card is blocked. This information is specified for each key that is stored in the file.
3.4 Record Files
As the name suggests, a record or cyclic file comprises of a series of records. Each record can be up to 255 bytes in length and there may be 255 records in a record or cyclic file.
One of the functions most frequently used on record files is the search function. The Multiflex card supports a Seek command that enables the records in a selected file to be searched for a particular pattern. The search may start at a given offset in each record and either start from the beginning of the file or from the current position in the file. The card returns success if the pattern is found in a record and the record found becomes the current record. If the pattern is not found in any of the records on the file then an error will be returned.
4. Multiflex Commands
The previous section described a few commands supported by the Multiflex smart card. The Multiflex card supports a total of 21 commands which can be used to build an application. Table 6.6 below lists these commands.
|Change PIN||Change PIN in selected file|
|Create File||Create new file or subdirectory in current directory|
|Create Record||Create new record in selected record file|
|Decrease||Make next record in selected cyclic file the current record minus the given value|
|Delete File||Delete file from selected directory|
|External Authentication||Retrieve encrypted challenge from reader and check|
|Get Challenge||Retrieve challenge from card|
|Get Response||Retrieve information about a selected file or directory|
|Increase||Make next record in selected cyclic file the current record plus the given value|
|Internal Authentication||Retrieve encrypted challenge from card|
|Invalidate||Block access to the selected file|
|Read Binary||Read data from selected transparent file|
|Read Record||Read record from selected linear file|
|Rehabilitate||Remove the block on selected file|
|Seek||Search selected record file for records containing given byte string|
|Select||Make file with given file ID the current file|
|Unblock PIN||Unblock a blocked PIN|
|Update Binary||Overwrite data in selected transparent file|
|Update Record||Overwrite record in selected linear file|
|Verify PIN||Present a PIN to card|
|Verify Key||Present cryptographic key to card|
List of Multiflex commands
The purpose of protected mode commands is to add security to certain commands to ensure that the command is performed by an authorized party. Prior to executing a command that is protected mode the reader must first issue a Get Challenge command to the card. The reader must then encrypt the data returned by the card with a specific shared key and return it together with the protected mode command. The card will decrypt the data and if it matches the challenge that it sent previously, then it will execute the command. However if the decrypted data does not match the challenge, the card will abort and return an error status.
5. Authentication States and Authentication State Transitions
The purpose of this section is to explore what happens when a party is successfully authenticated in one directory and then moves to another directory with a different PIN or key file. The ISO standards do not cover this area and so smart cards vary in their authentication state maintenance policies.
Authentication states in the Multiflex card are characterized by three 2-byte variables:
- PIN authentication directory – the file ID of the directory that contains the PIN file of the last PIN to be authenticated
- External authentication directory – the file ID of the directory that contains the external authentication file containing the last key to be authenticated
- External authentication key – 16 bits which, depending on which bit is set, determines which key in the current external authentication file has been authenticated
The operating system simply checks these variables when an access-controlled operation is about to be performed. If PIN authentication is required and the PIN authentication directory variable is non-null, then the operation may proceed. Otherwise it fails. If key authentication is required and the external authentication directory variable is non-null and the bit corresponding to the required key is set in the external authentication key variable, then the operation may proceed. Otherwise it fails.
The Multiflex card implements hierarchical access control, that is, if a key file is present in a directory of a particular application, then that key file defines the keys required to access the files in that directory and all its subdirectories. If there is no key file in an application’s directory, then the key file in the directory containing the application define the keys required to access the application’s files. Consequently, moving from one elementary file to another in the same directory does not alter the setting of the authentication state variables. However, selecting a new directory does change the authentication state. In other words, the authorizations do not follow as you navigate from one directory to another, unless the files in the new directory use the same authorization files as the files in the old directory.
As expected, when moving into a subdirectory of the current directory, the authorizations remain the same, unless a new authorization file is present. If this is the case, then the authorizations are cleared and authentication with the new PIN or key must be performed.