SmartCache

Welcome to SmartCache

Welcome to SmartCache, a practical application that lets you securely store information on an ISO 7816 smart card. This User's Guide provides information on using SmartCache.

cache (kash) n. [Fr. < cacher, conceal < VL. *coacticare, store up, collect, compress < L. coactare, constrain] 1. a place in which stores of food, supplies, etc. are hidden, as by explorers or trappers. 2. a safe place for hiding or storing things 3. anything stored or hidden in such a place —vt. cached, cach·ing to hide or store in a cache.

prac·ti·cal (prak'ti k'l) adj. [PRACTIC + -AL] 1. of, exhibited in, or obtained through practice or action [practical knowledge]. 2. a) that can be used; workable; useful and sensible [practical application] b) designed for use; utilitarian.


Release Notes

Release Notes for SmartCache Version 3.1

  • Fixed an issue with the splitter setting.
  • Added a Find control to find text within the list.

Release Notes for SmartCache Version 3.0

  • Fixed issue with slow app startup on Windows 10.
  • Increased maximum number of records based on ACOS3 EEPROM sizes.
  • Increased PC/SC read and write speed based on the capability of ACOS2, ACOS3, and ACOS3X cards.
  • Added support for ACOS2 8 KB and ACOS3X 256 KB smart cards.
  • Added capability to save to a CSV file.
  • Added capability to append a file to the list of records.
  • Added capability to remove duplicate records in the list.
  • Added a splitter to resize the records list and card activity control sizes.
  • Added Hide URL checkbox.
  • Added 64-bit app.

Release Notes for SmartCache Version 2.2

  • Added a Change Password button. This allows changing of the password on the card.
  • Added an Erase button. This writes zeros to all user data locations on the card.
  • Added settings to control what happens when you double-click an item in the list: either edit or go to URL.
  • Added a setting to read the card on startup.
  • Fixed a bug in which the test delay and font size settings were not correctly saved.

Release Notes for SmartCache Version 2.1

  • Added Test ATR mode, which performs continuous card resets. Hold down the Shift key when pressing the Test button to activate this mode.
  • Added a setting for the delay between Test mode runs.
  • Added settings to allow manually setting the RS-232 baud rate. This is useful for testing SoftCard emulation setups.
  • Added "Launch XPAtmel" item to the SmartCache main window system menu (right-click on title bar to display).
  • Added Write Changes time to output text
  • Fixed a bug in which a PC/SC session was not being terminated if Test Mode was canceled from the Password dialog (i.e., password was not saved when starting Test mode). This required restarting SmartCache to perform further operations with a PC/SC reader.
  • Fixed a bug in which the Hide checkboxes did not function if a file was loaded before a successful Read operation was performed.
  • Updated setup of the Initialization dialog. If the card password is saved, pressing the Initialize button now opens the Initialization dialog with the password fields initialized. This is useful for emulation testing.

Release Notes for SmartCache Version 2.0

  • Added PC/SC reader support.

Release Notes for SmartCache Version 1.0

  • Initial release.


Overview

SmartCache allows you to securely store information on an ACOS1, ACOS2, ACOS3, or ACOS3X ISO 7816 smart card using the following types of ISO 7816 interface devices: a Phoenix-style Reader/Writer, a Development Terminal, and a PC/SC Reader. The information you can store on the smart card consists of records containing four user-defined fields. By default, these fields are labeled Description, Username, Password, and URL, but SmartCache lets you rename them.

The maximum number of records that can be stored on the smart card depends on the card's EEPROM size, as shown in the following table.

Card | EEPROM Size (KB) | Maximum Records
ACOS1 | 8 | 60
ACOS2 | 8 | 60
ACOS3 | 16 | 120
ACOS3 | 24 | 180
ACOS3 | 32 | 240
ACOS3 | 64 | 480
ACOS3 | 72 | 540
ACOS3X | 256 | 1920

Smart cards initialized with versions of SmartCache before 3.0 are formatted to use only 8 KB of EEPROM, regardless of the smart card's capacity. This cannot be changed. To take advantage of smart card capacity greater than 8 KB, the smart card must be initialized with SmartCache 3.0 or later.

Examples of the types of information you can store include login credentials for computers and websites, credit card numbers, ATM PINs, driver's license numbers, and lock combinations. SmartCache imposes no limitations on the actual type of information you store in each record.

SmartCache interfaces with the ACOS smart card via a secure mutual-authentication mechanism that employs 168-bit Triple-DES (3DES) encryption. Once SmartCache has initialized a card, read and write operations to the card can only be performed after completing the mutual authentication process. This process involves submitting your secure password to the card, which generates a dynamic 3DES encryption key based on random numbers and static 3DES encryption keys. The latter keys are only known to SmartCache and the card.

All secure data displayed in SmartCache, whether it results from a card read or from edits you have performed, is stored in program memory, never on disk. However, SmartCache lets you save your secure information to a password-protected file. The data stored in this file is encrypted with 3DES and checksummed with a 64-bit CRC.

The following is a summary of SmartCache’s features.

  • Runs on Windows XP or later.
  • Interfaces with a Phoenix-style Reader/Writer.
  • Interfaces with a Development Terminal, using either an unencrypted or an encrypted RS-232 serial data interface.
  • Interfaces with any PC/SC reader.
  • Stores information on an ISO 7816 ACOS smart card.
  • Uses 168-bit Triple-DES (3DES) encryption to perform mutual authentication with the smart card.
  • Launches your URLs in a web browser.


Requirements

The following are required to use SmartCache:

  1. Windows XP or later
  2. A PC/SC Reader, a Phoenix-style ISO 7816 smart card Reader/Writer, or a Development Terminal programmed with the appropriate HEX files\ provided with SmartCache.
  3. An ACOS1 8K, ACOS2 8K, ACOS3, or ACOS3X smart card manufactured by Advanced Card Systems

Smart Card Vendors

ACOS1 8K, ACOS2 8K, ACOS3, and ACOS3X smart cards can be purchased online from various vendors for a few U.S. dollars per card. The following are a few such vendors.

  • Advanced Card Systems
  • SecureTech
  • Smartcard Focus
  • Smartcard Zone

Smart Card Readers

PC/SC readers can be purchased from the vendors above that sell smart cards and on Amazon.


Interface Devices

SmartCache has been successfully tested with the following interface devices.

PC/SC Readers (USB)

  • ACS ACR30U
  • ACS ACR38U
  • ACS ACR39U
  • ACS ACR40U
  • ActivCard V2.0
  • Athena ASEDrive IIIe
  • CASTLES EZ100P
  • Gemplus GemPC
  • HID Omnikey 3021 (Author's Choice)
  • Idaxis SecurePIV Pro
  • Recbot CAC Reader
  • SAICOO Smart Card Reader DOD Military
  • SCDTech ICC Reader
  • SCM SCR331
  • Target Visa GCR432

PC/SC Readers (RS-232)

  • ACS ACR30S
  • American Express Blue GCR415
  • Didya Dual Crystal Smart Card Reader/Programmer**
  • Litronic Netsignia 210 Programmer**
  • SCDTech ICC Reader
  • SDLOGIC SD7816U SE ULTRA USCT Smart Card Development Terminal**
  • SDLOGIC SDR-30RS Reader/Writer**
  • Spawn Devices ISO-3.57 MHz Reader/Writer**
  • Spawn Devices SSP 210 Reader/Writer**
  • Vector Technologies NextGen2 Programmer**
  • White Viper Reader/Writer**

**Using Generic DumbMouse/SmartMouse/Phoenix PC/SC driver from https://www.ttfn.net/

PC/SC Readers (PCMCIA)

  • Gemplus GPR400

PC/SC Readers (Keyboard)

  • Dell SK-3106

Phoenix Reader/Writers (RS-232)

  • Didya Dual Crystal Smart Card Reader/Programmer
  • Litronic Netsignia 210 Programmer
  • SCDTech X3
  • SDLOGIC SD7816U SE ULTRA USCT Smart Card Development Terminal
  • SDLOGIC SDR-30RS Reader/Writer
  • Spawn Devices ISO-3.57 MHz Reader/Writer
  • Spawn Devices SSP 210 Reader/Writer
  • Vector Technologies NextGen2 Programmer
  • WB Electronics Infinity USB Phoenix
  • WB Electronics Smartmouse USB
  • WB Electronics Infinity USB Unlimited
  • White Viper Reader/Writer

Development Terminals (RS-232)

  • Absolute 1
  • Atomic P.U.T.
  • Cansat2000 MK II Unlooper
  • Dominator Stealth
  • Mikobu III
  • SCDTech GFX
  • SDLOGIC SD7816U SE ULTRA USCT Smart Card Development Terminal
  • T-5 Typhoon Unlooper
  • Vector Technologies Unlooper
  • White Viper Unlooper


Interface Device Configuration

SmartCache supports three types of ISO 7816 interface devices: a Phoenix-style Reader/Writer, a Development Terminal, and a PC/SC Reader. If you are using a Development Terminal, it must be programmed with the HEX files provided with SmartCache. If you are using a PC/SC reader, the reader's driver must be installed.

To begin using SmartCache, connect the interface device to the computer, then select its type in the Settings dialog. For a Phoenix reader/writer or a development terminal, select the COM port to which the interface device is connected. For a PC/SC reader, select the device name in the Reader pop-up menu.

You can check the connection to the interface device by inserting a smart card and pressing the Reset button. If the interface device is connected correctly and an ACOS smart card is inserted, the ATR response should be 19 characters long and resemble the following.

   3B BE 11 00 00 41 01 38 00 00 00 00 00 00 00 00 01 90 00

If you receive a valid ACOS ATR, the next step is to initialize the card.


Card Initialization

Before you can start using SmartCache to store your information on an ACOS smart card securely, you must perform a one-time initialization of the smart card. This is accomplished by inserting the smart card in the interface device and pressing the Initialize button. If the ACOS smart card has not been previously initialized, SmartCache displays the Initialization dialog shown below.

Initialization Dialog

Card Issuer Code (IC) Field

The Card Issuer Code, or IC, must be submitted to the card to read and write specific files on the card. The default IC applies to a card that SmartCache has not initialized. This default IC may or may not be specified by the vendor from which the card was obtained. The default IC is usually (always?) "ACOSTEST", and this is the default IC that appears in the Initialization dialog. If your default IC is different, you can change it in this field. If the vendor did not specify a default IC, you can leave the default "ACOSTEST".

New password and Confirm new password Fields

These fields allow you to enter a password for accessing the smart card after initialization. This password must be between 1 and 8 characters in length. It is highly recommended that you use an 8-character password, preferably containing some numbers or other non-alphabetic characters. You will be required to enter this password to access the card once initialization is complete. Do not forget this password!

The ACOS smart card maintains an error counter to track and limit the number of consecutive unsuccessful mutual authentication executions. Each time you submit an incorrect password, the error counter is incremented (and each time you submit a correct password, the error counter is zeroed). If the error counter reaches a value of 8 (eight), the card will not execute any authentication commands any longer. In this case, all related security mechanisms (e.g., the password submission) are blocked. This condition is irreversible and will render the card unusable.

Remember Checkbox

You can have SmartCache remember your card password by checking this box. SmartCache stores the password in the Registry using a secure hashing algorithm, 168-bit 3DES encryption, and a 64-bit CRC checksum. You can always change this setting later in the Settings dialog.

Your name

This field allows you to enter your name or any other identifier. This field is stored on the card and is displayed in the card activity text when the Get Info command is issued. This field can be between 0 and 31 characters in length, inclusive. If you leave this field blank, SmartCache will display a warning message box when you press OK, prompting you to confirm that you want to continue.

OK Button

The OK button is enabled only after you have entered and confirmed your new password. When you press the OK button, SmartCache performs a multi-step initialization process to configure the card for use with SmartCache. Initialization consists of the following steps:

  1. Verifies that an ACOS1 8K, ACOS2 8KB, ACOS3, or ACOS3X card is inserted and its lifecycle stage is Manufacturing.
  2. Blows the Manufacturing fuse on the card to put it in the Personalization lifecycle stage.
  3. Configures the user data files that SmartCache will use.
  4. Writes the security attributes for the user data files.
  5. 5. Writes information to the card that the Get Info command will display.
  6. Initializes the user data files.
  7. Writes the new password to the card.
  8. Configures the card to use 3DES encryption.
  9. Blows the Personalization fuse on the card to put it in the User lifecycle stage.
  10. Verifies that the card is initialized correctly by starting a session and performing a mutual authentication.

If an error occurs during any step of the initialization process, SmartCache will display an error message box. If initialization completes successfully, no message box will appear, and the card is ready to use. Click the Read button to verify that the card is in the User lifecycle stage and there are zero records stored on the card. You can now begin using SmartCache to store your information.


Sample File

The SmartCache installation includes a sample file that can be loaded into SmartCache to give you an idea of the type of information that can be stored on the smart card. This sample file can be loaded to the Record List at any time, and the data can be written to an ACOS smart card after the card has been initialized and read.

To load the sample file, press the Load from File... button and open the file sample.sc located in the same directory as SmartCache.exe. Once this file is loaded, you can perform operations on the list data and save it to a file. If you want to write this data to the card, you must first press the Read button, then load the file, then press the Write Changes button.


Main Window Overview

The main window of SmartCache displays secure information and card activity, allows adding, editing, and deleting records, and supports card operations. The main window can be minimized, resized, and maximized. The position and size of the main window are saved between restarts of SmartCache.

Record List

The record list at the top of the window displays the current secure information. Each row in the list consists of separate fields for each column heading, which default to Description, Username, Password, and URL. Clicking a column header in the list sorts records alphabetically by the data in that column. Right-clicking the list displays a context-sensitive menu that lets you perform list operations. Double-clicking a row opens the Edit Record dialog. The maximum number of records that can be stored on the smart card depends on the card's EEPROM size, as shown in the following table.

Card | EEPROM Size (KB) | Maximum Records
ACOS1 | 8 | 60
ACOS2 | 8 | 60
ACOS3 | 16 | 120
ACOS3 | 24 | 180
ACOS3 | 32 | 240
ACOS3 | 64 | 480
ACOS3 | 72 | 540
ACOS3X | 256 | 1920

Card Activity

Information on operations performed with the smart card is displayed in the text field at the bottom of the window. Options for clearing this output before each card operation, displaying verbose information, and displaying timestamps are available in the Settings dialog.

Splitter

Moving the mouse over the area between the Record List and Card Activity controls changes the cursor to indicate splitter functionality. Hold down the left mouse button and drag vertically to adjust the relative sizes of these controls.

Card Operations

Operations with the smart card are performed using the buttons in the Card group box in the lower-right corner of the window. Detailed information on each button's function can be found here.

List Operations

Operations on the record list are performed using the buttons in the List group box in the upper-right corner of the window. Detailed information on each button's function can be found here.

Indicators

The indicators in the lower-left corner of the window display the current interface device and interface type, the type of smart card, and the number of records and bytes currently in the list. For an ACOS smart card, the EEPROM capacity (N) and the formatted capacity (M) are shown as "NKB/MKB"; the formatted capacity will be indicated as "0KB" if SmartCache has not initialized the card, and will be "8KB" if the card was initialized by SmartCache 2.2 or earlier. The number of bytes represents the total amount of data to be stored on the smart card, and includes a fixed overhead of four bytes per record.


Card Operations

The buttons in the Card group box in the lower-right area of the main window are used to perform operations on the smart card. This section describes the functionality of each button.

Read Button

The Read button reads the user data from the card. SmartCache must have previously initialized the card to complete this command. The data read from the card by this command is displayed in the Record List at the top of the window.

Write Changes Button

The Write Changes button writes any changes to the card. SmartCache must have previously initialized the card to complete this command. This button is only enabled if there are actual changes. A change is defined as any difference between what is displayed in the Record List and what is currently stored on the card.

Get Info Button

The Get Info button reads configuration information from the card and displays it in the Card Activity area. SmartCache must have previously initialized the card to complete this command. The information displayed by this command consists of the following.

  • The Card Owner (i.e., the text that was entered in the Your name field of the Initialization dialog).
  • The Card ID, which is a 16-byte value that uniquely identifies the card.
  • • The date and time SmartCache initialized the card.
  • The application version of SmartCache that was used to initialize the card.
  • The number of records currently stored on the card.

Test Button

The Test button continuously reads the user data stored on the card; in effect, it performs the same function as pressing the Read button continuously. SmartCache must have previously initialized the card to complete this command. When you press the Test button, the button text changes to Stop. SmartCache will continue to perform read operations until either the Stop button is pressed or an error is detected. When you press the Stop button, the button becomes disabled and displays the text Stopping.... The button remains disabled until the current read operation completes. Upon completion of the test, information on the total number of read operations and statistics is displayed in the Card Activity output.

The Test button was implemented for robustness testing of the hardware (interface device, smart card, and serial port) and the software (Windows and SmartCache).

Test Button (with Shift key down)

When the Shift key is down, the Test button text changes to Test ATR. Pressing this button in this mode results in continuous card resets; in effect, it performs the same function as pressing the Reset button continuously. This function works with any ISO 7816 smart card, not just ACOS ISO 7816 smart cards.

Initialize Button

The Initialize button performs a one-time-only initialization of a card to configure it to work with SmartCache. See the Card Initialization section for details. Note that if the card has already been initialized, SmartCache will display a message to that effect. Once a card has been initialized, it can never be initialized again.

Change Password Button

The Change Password button allows you to change the password stored on the card. The card must have been initialized with SmartCache 2.2 or later to change the password.

Erase Button

The Erase button writes zeros to all user data locations on the card.

Reset Button

The Reset button resets the card and displays the ISO 7816 Answer To Reset (ATR) from the card. The ATR is displayed in hexadecimal.


List Operations

The controls in the List group box in the upper-right area of the main window are used to perform operations on the record list control. This section describes the functionality of each control.

All controls described in this section only operate on the Record List. None of these actions operates with the smart card. To write what is currently displayed in the Record List to the card, press the Write Changes button, described here.

Hide Checkboxes

When checked, the Hide Description, Hide Username, and Hide Password checkboxes display stars in the associated column of the record list. This functionality lets you demonstrate SmartCache to someone without revealing any of your confidential information. Note that the names of the checkboxes will change to Hide Column 1, Hide Column 2, and Hide Column 3 if anything but the default column headings are specified.

Add Button

The Add... button opens the Add Record Dialog, which lets you add a new record to the list. New records are added to the bottom of the list.

Edit Button

The Edit... button opens the Edit Record Dialog to allow you to edit the currently selected record in the list.

Duplicate Button

The Duplicate button inserts a copy of the currently selected record in the list.

Delete Button

The Delete button removes the currently selected record from the list.

Down Button

The Down button moves the currently selected record down one row in the list.

Up Button

The Up button moves the currently selected record up one row in the list.

Goto URL Button

The Goto URL button treats the text in the URL column as a hyperlink. This button is disabled if there is no text in the URL column for the selected record. More information on using URLs can be found here.

Save to File Button

The Save to File... button lets you save the list data to a file. You can password-protect the file, which is recommended if you are keeping sensitive data. Regardless of whether you password-protect the file, the data in it is encrypted with 168-bit 3DES encryption and checksummed with a 64-bit CRC. An unlimited number of records can be saved to a file.

Save to CSV Button

The Save to CSV... button lets you save the list data to a Comma-Separated Values (CSV) file. The file can be opened in programs such as Microsoft Excel. Use this feature with caution, as the file is not password-protected.

Load File Button

The Load File... button allows you to load data from a file into the list. You can load data from a file at any time and perform operations on the records in the list. However, the Write Changes button is enabled only if you have previously read the card using the Read button.

Append File Button

The Append File... button lets you append data from a file to the list. You can append data from a file at any time and perform operations on the records in the list. However, the Write Changes button is enabled only after you read the card using the Read button.

Pop-up Menu

Right-clicking in the list displays the pop-up menu shown in the following figure. It contains items that perform functions on the selected item in the list or on the entire list.

If SmartCache is configured to remember your smart card password, and you save data to a password-protected file, be careful about what passwords you use for each. If you use the same password for both the smart card and the file, someone can load and view the file's contents by checking the "Use saved card password" checkbox in the File Password dialog (this checkbox is only enabled when the Remember checkbox in the Settings dialog is checked). If you are the only person with access to your computer, this is not a problem. If others have access to your computer, consider using different passwords for the smart card and file, even if the passwords differ by a single character. For example, if your smart card password is sample$1, you could use a file password of sample$2.


Settings Dialog

This dialog allows you to configure SmartCache settings.

Interface Device

These radio buttons are used to select the interface device used for communication between SmartCache and the smart card. The PC/SC radio button and the Reader pop-up menu are disabled if the smart card base components are not installed or if no PC/SC readers are connected.

COM Port Combo Box

This setting specifies the COM port for non-PC/SC interface devices. SmartCache lists all available COM ports in this combo box. In other words, the items displayed in the combo box depend on the available COM ports on the computer.

Baud Rate Controls

The controls within the Baud Rate group box set the RS-232 baud rate for Phoenix reader/writers and development terminals. When the Auto radio button is selected, SmartCache uses a fixed baud rate of 9600 bps for Phoenix reader/writers and 115,200 bps for development terminals. To manually select the baud rate, select the Manual radio button and choose the baud rate from the combo box.

Manually setting the baud rate is useful for interfacing with an emulation setup at baud rates other than 9600 and 115,200 bps. Empirical results show that some Phoenix reader/writers can operate at all standard baud rates between 9600 and 115,200 bps, inclusive, while others can only operate up to 38,400 bps.

Font Size Combo Box

This setting specifies the font size for the record list and card activity text.

Card Password

This setting allows you to enter the password that SmartCache issues to the card each time it starts a mutual authentication session. If you do not have the Remember checkbox checked, you will be prompted to enter your password each time SmartCache performs a Get Info, Read, Write Changes, or Test command. If you have the Remember checkbox checked, your password is saved in the Registry using a secure hashing algorithm, 168-bit 3DES encryption, and a 64-bit CRC checksum.

Clear before each command Checkbox

When this setting is checked, it clears the card activity text before each command.

Verbose Checkbox

When checked, this setting displays detailed internal information about the commands and data exchanged between SmartCache and the smart card. Note that if this checkbox is checked and you are running in Windows 9x, depending on the number of records stored on the card, the amount of text displayed in the card activity output may exceed the edit control's limit. In this case, once the limit is reached, no further text will be displayed.

Show timestamps Checkbox

When checked, this setting displays a timestamp for each line of text in the card activity output. The first number in the timestamp represents the time since the start of the command, and the second number represents the delta time since the previous line of text. Both values are in seconds.

Test Mode Delay Setting

This setting specifies the delay, in milliseconds, between Test mode runs. In previous versions of SmartCache, this delay was hard-coded to 1 second. A 1-second delay was sufficient to view the output text after each run in Test mode. With the addition of the Test ATR function, a smaller delay value (even 0) may be desirable. The valid range for this setting is 0 to 3,600,000 (1 hour).

Show gridlines Checkbox

When checked, this setting displays gridlines in the record list. Note that in some versions of Windows (e.g., XP), gridlines are incorrectly drawn when scrolling down a list.

Copy password to clipboard on Goto URL Checkbox

When this setting is checked, the password field is copied to the clipboard when the Goto URL command is issued.

Double-click action

This setting specifies the action performed when you double-click on an entry in the list. Selecting Edit record will open the Edit dialog for the record. Selecting Goto URL will execute the text in the URL column as if it were a hyperlink.

Headings

These fields allow you to specify the names of the column headings in the record list. The maximum length of each heading is 32 characters.

Use Default Headings Button

Pressing this button sets the heading names to their default values.

Auto Size Checkboxes

These checkboxes automatically set the column width in the record list. When checked, the corresponding column in the list will be sized to fit the data with the maximum width. Auto-sizing of columns is performed after any operations that modify the contents of the record list.

Play Sound Checkboxes

Each of these settings, when checked, plays the specified WAV file after the specified command.

> Button

This button plays the currently selected WAV file.

Browse Button

This button lets you select a WAV file to play after commands. The button to the left of this button plays the selected WAV file.

Read Card on Startup Checkbox

When checked, this setting causes the card to be read at SmartCache startup.


Add/Edit Record Dialog

This dialog is used to add a new record to the list or to edit an existing one. The title of this dialog indicates whether the record is being added or edited. The OK button is only enabled when changes have been made. All fields are allowed to be empty. The sum of the lengths of the characters in each edit field is limited to a maximum of 124 characters.

Add/Edit Record Dialog

SmartCache allocates 128 bytes on the smart card for each record. Four of these bytes are used to store the lengths of each of the four fields: Description, Username, Password, and URL. This leaves a total of 124 bytes to store the actual data in these fields. Rather than restricting the length of each field, SmartCache only limits the total length of the four fields. The maximum number of records that can be stored on the smart card depends on the card's EEPROM size, as shown in this table.

Description Field

This field specifies the text that is displayed in the Description column of the record list.

Username Field

This field specifies the text that is displayed in the Username column of the record list.

Password Field

This field specifies the text that is displayed in the Password column of the record list.

URL Field

This field specifies the URL that is displayed in the URL column of the record list. SmartCache can execute any text you specify in this field. The term executed is general, as the type of text that you can "execute" is not strictly limited to typical Internet URLs. A URL is executed by either pressing the Goto URL button or right-clicking in the record list and selecting the Goto URL item.

Guidelines for Specifying Internet URLs

Whether you need to specify a fully qualified URL depends on the type and version of your web browser. However, in general, URLs can be abbreviated by omitting the "http://" or "https://" prefix. For example, the fully qualified URL https://www.microsoft.com/ can be abbreviated to www.microsoft.com or microsoft.com. The simple rule is that any URL you can enter in your web browser should also work in SmartCache.

Other Types of URLs

SmartCache uses the Windows API function ShellExecute to execute a URL. The ShellExecute function operates on an object, with the operation type specified by the caller. SmartCache specifies an operation of open to the ShellExecute command, and sets the object text to the text specified in the URL field. In addition to Internet URLs, an object text can specify, for example, a file path. The shorter the URL, the better, as it reduces the time it takes to read and write records to the smart card.

As an example, consider a situation in which you have a password-protected Word document. You can use the Password field of a record to store the password and use the URL field to store the full path to the document, for example, C:\Docs\Some.doc. When you execute the Goto URL from SmartCache, the document opens and prompts you to enter the password.


Reader/Writer

A Reader/Writer is a device that allows a Terminal (e.g., a PC) to communicate with an ISO 7816 smart card. A Reader/Writer on its own cannot read from or write to an ISO 7816 smart card. It is the application software (e.g., SmartCache) running on the Terminal that controls reads and writes to the card.

The main functions of a Reader/Writer are to:

  • Provide the proper conversion of logic and level of signals between the Terminal interface (e.g., RS-232 serial) and the ISO 7816 smart card interface.
  • Provide power to the ISO 7816 smart card.
  • Provide an external clock signal to the ISO 7816 smart card.

SmartCache can interface with any ISO 7816 smart card Reader/Writer satisfying the following requirements:

  • Implements a Phoenix-style RS-232 serial interface.
  • Provides a 3.57 MHz clock signal to the Clock pin of the ISO 7816 smart card.
  • Uses the RTS line of the serial port to control the Reset pin of the ISO 7816 smart card.

Each of these requirements is now described in more detail.

Phoenix-style Interface

In a Phoenix-style interface, each byte sent from the Terminal (i.e., PC) to the Interface Device (i.e., Reader/Writer) is echoed back to the Terminal.

3.57 MHz Clock

The ISO7816-3 standard defines the electrical signals and transmission protocols for interfacing with an ISO 7816 smart card. SmartCache requires a 3.57 MHz clock supplied to the smart card because it results in a baud rate of 9600 bps, which is what SmartCache uses to communicate with the Reader/Writer over the RS-232 interface. According to the ISO 7816-3 standard, the baud rate used by the smart card is computed as:

   F/372

where F is the frequency, in Hz, of the clock signal supplied to the smart card. At a frequency of 3.57 MHz, this yields a baud rate of 9597 bps, which is well within the RS-232 interface's 9600 bps tolerance. All ISO 7816 smart cards transmit their ATR at a baud rate of F/372. The baud rate at which subsequent transmissions occur is determined by the parameters specified in the ATR. For ACOS smart cards, the subsequent baud rate is the same 9600 bps with a Phoenix-style interface (but significantly faster with a PC-SC interface if the card was initialized with SmartCache 3.0 or later). For more information on how the smart card uses the clock frequency, consult ISO7816-3.

The ISO7816-3 standard specifies a maximum clock frequency that depends on the ATR parameters. The minimum value for the maximum clock frequency is 5 MHz. Thus, the 3.57 MHz clock supplied by the Reader/Writer conforms to the ISO7816-3 standard.

RTS Control of Reset

SmartCache uses the RTS line of the RS-232 serial port to control the smart card's Reset input. The Reader/Writer must apply a low signal to the Reset pin when RTS is enabled and a high signal when disabled.


Development Terminal

A Development Terminal, also known as a Programmable Interface Device, a Programmable Smart Card Terminal, or an Unlooper, is a device containing a programmable microcontroller that interfaces via an RS-232 serial connection and an ISO 7816 smart card. A Development Terminal cannot read from or write to an ISO 7816 smart card without a program running on the microcontroller that is specifically designed to perform this function. Furthermore, in any practical application, the Development Terminal must also interface with application software (e.g., SmartCache) over the RS-232 serial interface.

The programmability of a Development Terminal makes it an attractive device for innovating new and exciting applications for smart cards. One such example is the way SmartCache interfaces with the Development Terminal using an encrypted RS-232 serial data interface. This capability cannot be provided by an ordinary Reader/Writer.

SmartCache provides Intel HEX files, generated by Atmel's AVR Studio, that can be used to program a Development Terminal to function as an ISO 7816 Reader/Writer, with or without an encrypted RS-232 serial data interface. SmartCache communicates with the Development Terminal over the RS-232 serial interface at 115,200 bps. This results in an overall communication rate with the smart card that is considerably faster than a Reader/Writer, which operates at 9600 bps.

SmartCache can interface with any Development Terminal satisfying the following basic requirements:

  • Uses an Atmel 90S2313-10 (10 MHz) microcontroller.
  • Provides a 9.216 MHz clock signal to the Atmel microcontroller.
  • Provides a 4.608 MHz clock signal to the ISO 7816 smart card's Clock pin.
  • Connects the RTS line of the serial port to pin PB7 of the Atmel microcontroller, using appropriate signal logic and level conversions. This is used to control the ISO 7816 smart card's Reset pin.

The expected pin connections to the Atmel microcontroller are specified in the following table.

Pin | Name | I/O | Usage
1 | RESET | IN | Connected to the inverted RS-232 pin 4 DTR signal.
2 | PDO (RXD) | IN | Connected to the inverted and level-converted RS-232 pin 3 XMIT signal.
3 | PD1 (TXD) | OUT | Connected to the inverted and level-converted RS-232 pin 2 RCV signal.
4 | XTAL2 | IN | Not used.
5 | XTAL1 | IN | Clock input. Must be a 9.216 MHz clock signal.
6 | PD2 | OUT | Not used. Output is always high.
7 | PD3 | OUT | Not used. Output is always low.
8 | PD4 | OUT | Not used. Output is always low.
9 | PD5 | OUT | Connected to the ISO 7816 RESET pin.
10 | GND | N/A | Ground.
11 | PD6 (ICP) | IN/OUT | Connected to the ISO 7816 I/O pin.
12 | PB0 | OUT | Connected to the Anode of the Write LED and the Cathode of the Read LED (the latter may be labeled ERROR).
13 | PB1 | OUT | Connected to the Cathode of the Write LED and the Anode of the Read LED (the latter may be labeled ERROR).
14 | PB2 | OUT | Not used. Output is always low.
15 | PB3 | OUT | Not used. Output is always high.
16 | PB4 | IN | Connected to the card switch on the ISO 7816 connector.
17 | PB5 (MOSI) | IN | Connected to the level-converted RS-232 pin 7 RTS signal. Used for serial input data during In-Circuit Programming and to control the ISO 7816 RESET pin during regular operation.
18 | PB6 (MISO) | OUT | Connected to the inverted and the level-converted RS-232 pin 8 CTS signal. Used for serial output data during In-Circuit Programming.
19 | PB7 (SCK) | IN | Connected to the inverted and the level-converted RS-232 pin 7 RTS signal. Used for clocking of serial data during In-Circuit Programming.
20 | VCC | N/A | +5V.


Development Terminal Programming

To use a Development Terminal with SmartCache, it must be programmed with the appropriate Intel HEX files. These files are provided with SmartCache. A Development Terminal supports in-circuit memory programming, which means you can program the Atmel microcontroller while it is in the Development Terminal. This type of programming requires an application like XPAtmel, which is included when you install SmartCache. In addition, you can program the Atmel microcontroller by removing it from the Development Terminal and using hardware that supports memory programming, such as Atmel's STK500 Development System.

Programming with XPAtmel

XPAtmel can be used to program the Atmel microcontroller while it is in the Development Terminal. XPAtmel requires that you are running Windows 2000 or Windows XP and are logged in with Administrator privileges. To program the Development Terminal using XPAtmel:

  1. Connect the Development Terminal to an available serial port and apply power to the Development Terminal.
  2. Start the XPAtmel application, located in the XPAtmel subfolder of the SmartCache installation folder. You can access XPAtmel from the SmartCache item in the Start menu.
  3. Select either iso7816_encrypted or iso7816_plain from the list box in XPAtmel.
  4. Select the COM port that the Development Terminal is connected to.
  5. Press the Program button and wait for the programming to complete.
  6. When programming is complete, exit XPAtmel and cycle power on the Development Terminal.

If programming was successful, your Development Terminal is now ready for use with SmartCache. If there were any errors using XPAtmel, check the power and serial port connections to the Development Terminal and try again.

Programming with Atmel's STK500

To program the Development Terminal using Atmel's STK500:

  1. Remove power to the Development Terminal.
  2. Remove the Atmel microcontroller from the Development Terminal.
  3. Place the Atmel microcontroller in the 20-pin red DIP socket on the STK500.
  4. Open Atmel's AVR Studio and open the STK500 programming dialog.
  5. When you open this dialog, AVR Studio will attempt to detect the STK500. If detection is successful, move to the next step. Otherwise, close the dialog, check the serial port and power connections to the STK500, and try again.
  6. Select AT90S2313 in the Device combo box.
  7. Check the checkbox labeled Erase Device Before Programming.
  8. In the Flash group box, select the appropriate Intel hex file, either iso7816_plain.exe.program.hex or iso7816_encrypted.exe.program.hex. These files are in the XPAtmel subfolder of the SmartCache installation folder.
  9. In the Flash group box, press the Program button and wait for programming to complete.
  10. Uncheck the checkbox labeled Erase Device Before Programming.
  11. In the Flash group box, select the appropriate Intel hex file, either iso7816_plain.exe.eeprom.hex or iso7816_encrypted.exe.eeprom.hex. These files are in the XPAtmel subfolder of the SmartCache installation folder.
  12. In the EEPROM group box, press the Program button and wait for programming to complete.
  13. Remove the Atmel microcontroller from the STK500 and put it in the Development Terminal. All pins must be seated.
  14. Apply power to the Development Terminal.

If programming was successful, your Development Terminal is now ready for use with SmartCache.


PC/SC Reader

A PC/SC reader is a device that allows a Terminal (e.g., a PC) to communicate with an ISO 7816 smart card. A PC/SC reader on its own cannot read from or write to an ISO 7816 smart card. It is the application software (e.g., SmartCache) running on the Terminal that controls reads and writes to the card.

The main functions of a PC/SC reader are to:

  • Provide the proper conversion of logic and level of signals between the Terminal interface (e.g., RS-232 serial, USB) and the ISO 7816 smart card interface.
  • Provide power to the ISO 7816 smart card.
  • Provide an external clock signal to the ISO 7816 smart card.

SmartCache can interface with any ISO 7816 PC/SC reader. SmartCache does not interface directly with the PC/SC reader; instead, it uses the Windows smart card library. The latter interfaces with a driver that ultimately controls the interface with the PC/SC reader.

All ISO 7816 smart cards transmit their ATR at a baud rate of F/372, where F is limited to 5 MHz. The baud rate at which subsequent transmissions occur is determined by parameters specified in the ATR. For ACOS3 smart cards initialized with SmartCache 2.2 and earlier, this subsequent baud rate is the same as the ATR baud rate. For ACOS3 and ACOS3X cards initialized with SmartCache 3.0 or later, this subsequent baud rate is the maximum the card supports, and is significantly (about 5 times) faster. For more information on how the smart card uses the clock frequency, see ISO7816-3.

PC/SC support is provided in the base installation of Windows XP and later.


RS-232 Serial Ports

SmartCache communicates with interface devices using an RS-232 serial data interface. Most computers have one or two built-in serial ports, commonly configured as COM1 and COM2 in Windows. SmartCache communicates with a Reader/Writer at 9600 bps and with a Development Terminal at 115,200 bps.

USB to RS-232 Serial DB9 Adapters

If your computer lacks serial ports or they are in use by other applications (e.g., a modem), consider adding a serial port with a USB-to-Serial converter device, available for around $30. The following are some notes on the devices I have tested with SmartCache.

Belkin F5U109

This was tested under Windows XP. Although Belkin claims this device supports baud rates up to 115,200 bps, my experience shows that it is slow at any baud rate. I do not recommend this device.

IOGEAR GUC232A

This was tested under Windows XP. IOGEAR specifies that this device supports baud rates up to 230 Kbps. My experience shows that this device performs as expected at both low and high baud rates, with the following exception. Occasionally, the USB hub to which this device is connected resets, causing the associated COM port to disappear. This issue appears to occur when using the device continuously, such as when running the Test command with SmartCache.

StarTech.com ICUSB232

This was tested under Windows XP. My experience shows that this device performs as expected at both low and high baud rates. The problem with the USB hub resetting also applies to this device.

Sabrent USB 2.0

This was tested under Windows XP, Windows 7, Windows 10, and Windows 11. My experience shows that this device performs as expected at both low and high baud rates. This is the best adapter.

Port Monitoring

Several products are available for monitoring the data being transmitted and received over an RS-232 serial interface. One of the best for 32-bit Windows is the free application PortMon, provided by Sysinternals. To monitor the serial data transmitted and received by SmartCache or any other application, start PortMon first, then begin the application. It should be noted that PortMon can monitor ports on remote computers.

For 64-bit Windows, one of the best commercial software products is Serial Port Monitor from Electronic Team, Inc.


SDLOGIC SD7816U USCT Configuration

The SDLOGIC SD7816U USCT can be configured to work with SmartCache as either a Reader/Writer or a Development Terminal. The recommended configuration is a Development Terminal, which provides for a faster interface. To configure the USCT as a Development Terminal, the blue DIP switch should have only switch 3 ON, as shown in the following figure. The mode selector switch should be set to repair/format terminal mode, i.e., the switch position is closest to the DB9 serial port connector.


ACOS Smart Cards

ACOS1, ACOS2, ACOS3, and ACOS3X are ISO 7816 smart cards manufactured by Advanced Card Systems. ACOS smart cards provide the following features:

  • ACOS1 has 8 KB of EEPROM memory for application data.
  • ACOS2 has 8 KB of EEPROM memory for application data.
  • ACOS3 has 16, 24, 32, 64, or 72 KB of EEPROM memory for application data.
  • ACOS2, ACOS3, and ACOS3X cards support user modification of the TA1 byte in the ATR for speed setting.
  • Compliance with ISO 7816-3, T=0 protocol.
  • DES and MAC capabilities.
  • Five secret codes + Issuer Code.
  • PIN, changeable by the cardholder.
  • Key pair for mutual authentication.
  • Session key based on random numbers.
  • Linear files with fixed record length; record length can be different for different files.
  • Account data structure for highly secure payment applications as an optional function.

SmartCache works with ACOS1 8 KB and all ACOS3 and ACOS3X smart cards. For further information on ACOS smart cards, consult the ACOS1 and ACOS3 reference manuals available here.


Security

This section discusses security issues related to SmartCache. Understanding these issues will help you decide which SmartCache features to use and which to avoid. The following issues affect the level of security you can achieve with SmartCache.

  • The complexity of your card password.
  • Having SmartCache remember your smart card password.
  • Saving your sensitive personal information to a file.
  • Serial port monitoring.

Maximum Security

Maximum security is achieved by:

  1. Not having SmartCache remember your smart card password.
  2. Never save your data to a file.
  3. Never letting anyone but yourself have access to your smart card.

If you adhere to all the above, your sensitive data is stored only on the Smart Card, and no one but yourself can ever access it. Furthermore, if SmartCache does not remember your password, and someone else obtains your smart card, they will have to guess your password to access the data on the card. After eight consecutive incorrect password attempts, the card's operating system will render the card unusable. Your card password can be between 1 and 8 characters; therefore, it is highly advisable to select a password that is eight characters long and includes at least one number or other non-alphabetic character.

Password Remember

You can have SmartCache remember your card password so you do not have to enter it each time you run a read, write, get info, or test command. If you have SmartCache remember your card password, it is stored in the Registry using a secure hashing algorithm, 168-bit 3DES encryption, and a 64-bit CRC checksum. If you are disciplined enough never to let anyone access your smart card, then having SmartCache remember your password is advisable, as it relieves you of having to enter it each time you perform a secure command.

Saving Data to a File

SmartCache lets you save the data stored on the smart card to a file. You can also password-protect this file. If you ever save your data to a file, you are strongly urged to password-protect the file. Not password-protecting a file should only be used when the data is not sensitive or personal; for example, the sample file provided with SmartCache is not password-protected because it does not contain any sensitive information.


SmartCache is written in C++ using Microsoft Visual Studio. The source code is statically checked using Vector's PC-lint Plus and run-time checked using Software Verify's Memory Validator. Bullseye Coverage is used to analyze SmartCache's code coverage. SmartCache is based on source code developed for an application that uses an ISO 7816 smart card to create unique serial numbers for fitness devices. Future applications include using an ISO 7816 smart card to generate unique serial numbers for transponders implanted in juvenile salmon released into the Columbia River for research.

The Atmel codes for the Development Terminal are written in assembly using WinAVR. These codes are entirely the original work of the author of SmartCache and are not based on any existing code. The encryption code for the RS-232 data uses a symmetric-key encryption algorithm.


Glossary

ACOS

Abbreviation for ACS (Smart)Card Operating System. Refers to the operating system employed on Advanced Card System's ACOS1, ACOS2, ACOS3, and ACOS3X ISO 7816 smart cards.

ATR

Abbreviation for Answer To Reset. ATR is the value of the sequence of bytes sent by an ISO 7816 card to the interface device when a RESET signal is applied.

bit

Abbreviation for binary digit, the smallest unit of information on a machine. A single bit can hold only one of two values: 0 or 1.

bps

Abbreviation for bits per second. Used to specify the bit rate of a communication line. The term bps is typically implied when specifying a baud rate, e.g., 115,200 baud implies 115,200 bps.

byte

Abbreviation for binary term, a unit of storage capable of holding a single character. A byte is almost universally 8 bits (other sizes are only of interest to programmers). Memory sizes are often specified in terms of kilobytes (KB, 1024 bytes), megabytes (MB, 1024 KB), and gigabytes (GB, 1024 MB).

CRC

Abbreviation for Cyclic Redundancy Check, a common technique used for detecting data errors. CRCs treat blocks of input bits as coefficient sets for a message polynomial. A second generator polynomial with constant coefficients is divided by the message polynomial, yielding a quotient and a remainder. The coefficients of the remainder form the final CRC bits. The order of the generator polynomial defines the number of bits in the CRC. For example, Ethernet packets use a 32-bit CRC. SmartCache uses a 64-bit CRC.

DES

Abbreviation for Data Encryption Standard, a symmetric-key encryption algorithm. DES uses 56-bit encryption keys. Triple-DES (3DES) uses 168-bit encryption keys.

HEX File

Also popularly known as an Intel HEX file. This is a text file with a .hex extension that allows program or data files to be encoded in a printable (ASCII) format. The Intel HEX format is one of the most widely used in the embedded programming world. A HEX file is typically used to store the instructions and data to be programmed into flash or EEPROM memory on a microcontroller.

ICC

Abbreviation for Integrated Circuit Card, an ISO 7816 smart card containing an integrated circuit.

ISO 7816

A series of International Standards describing the parameters for integrated circuit cards with contacts and the use of such cards for international exchange. ISO/IEC 7816 consists of the following parts, under the general title Information technology—Identification cards—Integrated circuit(s) cards with contacts:

  • Part 1: Physical characteristics.
  • Part 2: Dimensions and location of the contacts.
  • Part 3: Electronic signals and transmission protocols.
  • Part 4: Interindustry commands for interchange.
  • Part 5: Numbering system and registration procedure for application identifiers.
  • Part 6: Interindustry data elements.
  • Part 7: Interindustry commands for structured card query language.

PC/SC

Abbreviation for Personal Computer Smart Card, an interoperability specification for ICCs and personal computers.

RS-232

Abbreviation for Recommended Standard-232, a standard interface approved by the Electronic Industries Alliance (EIA) for connecting serial devices. RS-232 has been a popular interface for mice, modems, and PDAs, and remains a popular interface for ISO 7816 interface devices, microcontroller programmers, and numerous custom applications.

URL

Abbreviation for Uniform Resource Locator, a standard way of specifying the location of an object, typically a web page on the Internet.

USB

Abbreviation for Universal Serial Bus. An external bus that supports Plug and Play installation. The original USB 1.1 specification specifies a transfer rate of 12 Mbps. The newer USB 2.0 specification delivers transfer rates of 480 Mbps and is backward compatible with USB 1.1.


Find

The Find control is used to find text within the list. Press Ctrl+F to shortcut to find a string in the list. The Find control appears in the upper-right corner of the list.

Enter the text you wish to find and click the > button or press the Enter key. The controls below the text allow you to match case, match a whole word, and use regular expressions (hover the mouse over a control to display a tooltip). Once a match is found, press F3 to find the next occurrence or F2 to find the previous occurrence.