Door Access Using Smart Card
Door Access Using Smart Card
FOOTZEYAW
Faculty of Engineering
UNIVERSITI MALAYSIA SARAWAK
2004
To my Beloved Family and Friends
1
ACKNOWLEDGEMENT
First, I would like to thank God for His grace and mercy upon the thesis
project and for blessing me with a supportive supervisor, family members and friends.
in the preparation of this thesis. I would like to extend my sincere gratitude to Mr.
and sisters who continually supported me throughout the thesis project; also not
projects concerning smart card applications. If it were not by them I could not have
Last but not least, to those who have helped and supported me in completing
11
ABSTRACT
Smart Card has become the necessity in modern lifestyle. The main objective
of this project is to access an electronically locked door, at the same time to create a
log inside the database about the visitations done by the card users, for tracking
purposes. The software used to run the project are Microsoft Access for the databases
and the interface, and ZeitControl Professional IDE for the smart card. The program
was designed in such a way it is available to both card customers and administrators.
ill
ABSTRAK
Kad Pintar telah menjadi satu keperluan dalam kehidupan modem. Objektif
utama projek ini ialah untuk membuka kunci pintu elektronik, pada masa yang sarna
dibuat oleh penguna kad, agar dapat disemak balik. Perisian yang digunakan untuk
menjalankan projek ini ialah Microsoft Access untuk menghasilkan pangkalan data
dan antara muka, serta ZeitControl Professional IDE untuk kad pintar. Program
tersebut direkabentuk sebegitu supaya dapat digunakan oleh kedua-dua pihak yakni
IV
Table of Contents
Dedication
ACKNOWLEDGEMENT 11
ABSTRACT iii
ABSTRAK IV
Table of Contents V
List of Figures Xl
CHAPTER 1 INTRODUCTION 1
1.1 Background 1
v
2.3.2.1 Contact Smart Card 9
2.5.3 Software 17
2.7 Application 21
2.8 Conclusion 23
3.6 Relationships 32
VI
3.6.3 One-to-one Relationship (1-1) 37
3.7 Conclusion 37
4.4 The Tables and Fields Planned to be used in Database for Door Access 45
4.6 Miscellaneous 48
4.7 Conclusion 49
5.1 Introduction 50
5.3 Design 56
5.4 Algorithm 58
Vll
5.5 Implementation 64
5.6 Conclusion 78
6.1 Introduction 79
6.3 Conclusion 81
7.1 Introduction 82
7.2 Recommendations 82
7.2.2 Multi-Applications 83
7.3 Conclusion 83
Vlli
APPENDIX A 85
DoorCard.bas 86
DoorCard.def 94
Commands.def 95
Dealer.key 97
Issuer.key 97
APPENDIXB 98
frmChgMasterPIN form 99
IX
APPENDIXC 146
REFERENCES 147
Chapter 2 147
Chapter 3 148
Chapter 4 149
BIBLIOGRAPHY 150
Chapter 1 150
Chapter 2 150
Chapter 4 150
INDEX 151
x
List of Figures
Figure 1.1 Outline of the Door Access using Smart Card System 2
Figure 1.2 The reader inputs card's data to Pc. The process stops there
and does not proceed further if the card is found fake. 3
Figure 1.3 If the card is valid, then the PC sends signal to unlock the
~~ 3
Figure 2.1 Typical architecture of a memory card with security logic [2
4] 7
Figure 2.3 Contact Smart Card and its Micro-module contact points [2-6]
9
Figure 2.4 Contactless Smart Card. The crescents indicate the direction
of signal radiation. [2-7] 10
Figure 2.5 the interaction between CAD connected to the terminal and
the smart card. The reader accepts commands from the
computer, carries out the specified function at the smart card
and returns the requested data or status information. 13
Figure 2.11 Common data frame (data unit) for smart card data transfer 17
Figure 2.12 Example of data streams that will be stored inside the flash
memory of the card 22
Figure 3.2 The two standard query languages used in Microsoft Access:
(a) QBE and (b) SQL. Note that both languages shown here
Xl
refer to the same query table, which will display the names
of contacts that does not have telephone number stored in
the database. The circled numbers in QBE indicate the
matching parts between the QBE and the command line
numbers in SQL. 27
Figure 3.3 Design view of the table "Visitor" in the database for Door
Access system. The primary key field (Card ID) is indicated
with a symbol of a key. 31
Figure 4.1 Basic peripheral configuration of the door access system. The
block arrows show the allowed direction of throughput. 39
Figure 4.2 The reader reads the card ID from the card and sends it to PC
via PS/2-COM 1 connection. The PC loads records from
database to fmd a match for the card ID code. The process
stops and does not proceed further if no match is found. 41
XI1
''''ii:
Figure 5.2 The sequence of events in the door access system (Dealer
program) 53
Figure 5.3 The sequence of events in the door access system (Issuer
program) 54
Figure 5.6 Flow chart ofthe (a) personalization program and (b) unlock
card program 60
Figure 5.8 Flow chart of the (a) Door Accessing Program; (b) change
PIN program 63
Figure 5.9 The files involved in the compilation of card software. One
should open the project file (with the file extension ZCP) in
order to view the source files included in the project. 64
Figure 5.11 The button to open the code builder window in Microsoft
Access. A form or module must be selected in order to enable
this button. 66
Figure 5.12 The code builder window. In order to include the components
for the programs, select the menu: Tools ~ References. 67
Xlll
List of Tables
Table 4.1 The tables and their fields with description in the database for
door access application. PK Primary Key; FK Foreign
Key 44
XlV
CHAPTER 1
INTRODUCTION
1.1 Background
Smart Cards are known to be useful in providing data transfer and carrying
plastic card with an advance internal electronic circuits, smart cards fmd their use in
The author's project is a smart card system used for door accessing. In order
to unlock the door, the smart card user must insert the smart card for the reader to
Because of this, the demand for security to protect the concerned property is
increasingly high. One way to meet the needs of security and to solve the problem of
The main objective of the project is to develop a smart card door access
1
• Study and compare the smart card projects done by his senior students.
• Improve/modify the necessary part of the program of card reader that reads
• Apply the implemented card reader program to a simulated door lock / apply
Figure 1.1 Outline ofthe Door Access using Smart Card System
Figure 1.1 shows the Outline of the Door Access using Smart Card System.
The personal computer (PC) acts as a controller of the whole system, having smart
card program running inside. It has the input port from the smart card reader, and
When a card is inserted into the card reader, the PC will check the card to see
if the card is a valid door access smart card. If it is not, the door remains locked.
2
P AS
Figure 1.2 The reader inputs card's data to Pc. The process stops there and does
not proceed further if the card is found fake.
But if the card is found true, PC will send a signal to the output port to unlock
the door (Figure 1.3). The user then will be able to open the door.
Door
Send the unlock
command
Figure 1.3 If the card is valid, then the PC sends signal to unlock the door.
After certain duration, The PC will output again a signal to relock the door, so
3
In the next few chapters, the author reviews on what he has learnt from
literature about the components involved in the system, and intends to apply what he
4
CHAPTER 2
The term Smart Card is not new anymore to Malaysians than to other people
(GMPC) in the Project of Multimedia Super Corridor (MSC). People has learnt of the
traditional identity card (IC), phone card, credit card, bank card, and others.
Though smart card's existence has changed the way we live as much as any
data communication networks [2-1], only few people got to know what a smart card
is really defmed as. In general, a smart card is in fact a plastic card, with the size
same as of a credit card, but also with an embedded computer chip. The chip is either
programmable logic. The chip connection is either via direct physical contact or via
Smart Cards started off by their structure layout just patented in the seventies
well as other minor factors caused the work on smart cards being confined at the
research and development level at that time [2-3]. The beginning of eighties, in
which semiconductor technology was becoming more advanced, allowed the smart
5
,..'
applications like banking transactions and telephone prepaid business. Since then
until now, massive production and intense improvement of smart cards have been
There are several ways to classify the types of smart card, depending on the
Basing on the internal chip classification, Smart Cards can be divided into
Memory card is basically an information storing card, which only store data
and has no or little data processing capabilities [2-4]. The storage can be Erasable
6
Access Logic
Identification data
Address and
Security Logic
D+-........ va
Flash Memory
D +-..-. Clk
D+-........ Control Channel
D +-..-. Vee
D ~-+-. GND
Data storage
Figure 2.1 Typical architecture ofa memory card with security logic [2-4]
for the memory. The data is transmitted to and from the card via the I/O port. With
low manufacturing cost, memory card finds its useful application in pre-paid phone
service, health insurance and electronic payment, where the card will cease its
function if all the internal memory units are used up, and can be reloaded by resetting
Unlike memory card, which uses address and security logic to do nothing
more than accessing data, a microprocessor card has a processor inside it to process
data as well as manage data storage. It has also other functional blocks like Flash
7
p
Processor
Operating
System
Working
memory I
Application D 110
Flash D elk
Memory D Reset
D Vee
D GND
Data storage
Beside data processing and storage management, the Central Processing Unit
applications. With the ability to add, delete and otherwise manipulate information in
its memory, microprocessor cards can be added with new applications or reinstall
certain applications to increase its functionality, provided that the processing capacity
(RAM) and storage capacity (Flash memory) is large enough. Because of these,
microprocessor card is more flexible in use and high in security, but with the expanse
of its cost. Today's uses of microprocessor card include bank card with advance
Smart card can also be classified into three distinctive groups according to its
8
2.3.2.1 Contact Smart Card
Contact smart card requires insertion into a smart card reader in order to
card, which is typically gold platted. After the connection between the contacts of the
card and the reader is made, data transfer to and from the chip is able to take place.
Vee GND
RST
VO
RFU
Legend
Vee - Power Supply Voltage
RST - Reset the Microprocessor
CLK - Clock Signal
GND-Ground
Vpp - Programming Voltage
VO - Serial Input/Output Line
RFU - Reserved for Future Use
Figure 2.3 Contact Smart Card and its Micro-module contact points [2-6J
Instead of making direct physical connection with card reader, the contactless
smart card communicates with the reader via radio link. Therefore a contactless
smart card requires an antenna connected to its chip, sandwiched by top and bottom
layers of the card. To be read by the reader, the card must be placed in close