YstokCard - smart card API

YstokCard is a portable Common Lisp library dealing with smart cards.
It allows a Lisp program to interact to integrated chip cards (ICC) and interface devices (IFD, card readers).

Memory cards can securely store relatively small amounts of data. Applications usually require certain conditions to be fulfilled before access to the data is possible, such as a PIN verification or authentication of the card.

Processor cards provide environment for the secure execution of programs. This makes smart cards good candidates for the entire security sector. Additionally, they have a well-established format and are convenient for manual use and handling.

YstokCard can be useful for programming both memory-based and file-based card applications. The library relies on the following "back-ends":

PS/SC specification
This specification tries to abstract the smart card layer into a high level API so that smart cards and their readers can be accessed in a homogeneous fashion.
Synchronous API for HID OmniKey readers

PC/SC is a short for "Personal Computer/Smart Card". This specification integrates smart cards into computing environments. Microsoft has implemented PC/SC in Windows 2000. A free implementation of PC/SC, PC/SC Lite, is available for Linux and other Unixes. A forked version comes bundled with Mac OS X.

Basic features


The library supports various smart card types including

In practice, YstokCard was tested with the following devices and cards.

Omnikey 5321
Contact and contactless (RFID 13,56 Mhz) smart card reader USB connected.
Mifare Classic/Ultralight
Contactless cards with 1KB, 4KB, or 256B memory chip by NXP Semiconductors.
Visa/MasterCard/Europay (very slightly).


YstokCard requires Ystok-FFC and Ystok-Library.


Tested on versions 4.4 and 6.1 for Windows.
Tested on version 1.0.55 for Windows.

Download and installation

YstokCard is available from
http://lisp.ystok.ru/ycard/ycard-0-1-001.zip or

The distribution package contains both the ASDlite/ASDF-based ycard.asd and the LispWorks-based defsys.lisp system definition files.

See change.log.

Tests and examples

Some examples of YstokCard usage are listed here. The distribution includes the following files:

Simple tests based on the tester suit from the ACL-Compat lite module.
Starting and stopping the device monitor.

See also