Smart Card Cryptography
Smart Card Cryptography
Smart Card Cryptography
Final Project
Tel2820 – Cryptography
Dr. Prashant Krishnamurthy
“Smart Cards” is an emerging technology in the United States that offers the seamless
interactions in everyday life that we have begun to expect from technologies such as USB and
Bluetooth. It offers a one-stop mentality for all your financial transactions and a utility
beyond the means people currently take for granted. Whether it is depositing your paycheck
with a swipe, buying groceries, or digitally signing the electronic purchase of your new car, a
heretofore unprecedented level of personal computing utility is at our fingertips. For all this
to occur however, these cards contain a potentially deep level of personal identification that
goes well beyond the current application technologies such as RFID. It is not surprising to
hear that many voices have already voiced concerns over the lack of security and privacy that
an RFID tag presents. Given the concerns shown over the lack of privacy inherent to RFID, it
is not difficult to see that there will be many outspoken opponents of the smart card
technology. With the current quality of security in said RFID devices, this is rightly so. The
potential damage that can be caused by an unscrupulous vendor, given unmitigated access to
an individual’s SSN, account numbers, credit card numbers, address, and other such personal
significant challenge in many areas. Of particular concern in the security arena are two key
topics that must be explored to ensure safety and acceptance of this technology. First, there
prevent unauthorized purchases, and to determine who made an unauthorized purchase should
one occur. Finally, it is critical that there be access controls to determine who can see what
aspects of the smart card’s data as well as what functions they can call, lest they infer a
specific subset of data from a wider range of queries. Exploration of these complex arenas
will help us all have a greater understanding and a proper trust or fear of devices that carry
As was stated already, highly secure cryptographic schemes must be present. To this
date, a variety of encryption schemes have shown their capability to securely transfer
sensitive data. A number of these are callable functions within a smart card’s processor, as
Standards. These primarily come from the public/private key schema, and are such protocols
as RSA, DES, and AES. Hashing techniques are also used, both MDA5 and SHA-1. Padding
techniques are also available, usable at both the low and the high end values, using PKCS#1.
Within the RSA encryption scheme, several techniques are available. 512, 768, 1024,
and 2048 bit keys are creatable, using the Chinese remainder theorem, which states that two
n1 = n2 (mod gcd(m1,m2)). The solution is unique modulo lcm(m1,m2). DES keys are creatable
within a single or triple-strength algorithm. The DES key is used to generate cryptograms, 8
byte random numbers with a random key. DES is used for an 8 byte key, and DES_3 is used
for 16 byte keys. These cryptograms will be important later, but their creation is stated here
to show the ways in which DES is implemented. AES is a synchronous key encryption
protocol that has begun to surpass DES encryption as a standard of choice. Its applications
here are limited, with the strong and proven RSA encryption retaining ground, but it’s
inclusion into the smart card, shows a strong acceptance of it as a reliable source of
along with the keys, are more commonly padded. Padding is many times simply used to pad
the length of an AES key to be 16 octets, with padding optionally coming at the upper or
lower end. The PKCS #1 standard is used to pad MD5 and SHA-1 with 18 and 15 header
bytes respectively. These encryption schemes have thus far proved highly secure within our
normal computer networks. It is the case however that the relative openness of the data, it
being a wafer-thin piece of data in little protection, throws a unique light, no pun intended, on
systems in many smart card systems by developing a way of attacking and causing faults in
cards using common tools such as a photographer’s flash gun and a microscope. On a similar
vein of attacking the card on the hardware level, the Differential Power Attack (DPA)
introduce a 1st order bias. This is due to the fact that there is a power consumption difference
between a 1 volt and a 0 volt, it is in fact the defining difference between them.
For example, we have a cryptographic scheme which at one point generates the
following computation:
Alg1(PTI) {
Vulnerable computation -> Result = PTI SecretKey
…
return CTO
}
Now, we can examine the signals for the presence of particular patterns noted below.
Using these computational algorithms, we can average the signals, and subtract to
red flag to the bit-stream sent when the algorithm was used. This bit-stream can then be re-
encoded to give us the key. With that key, we have unmitigated access to the smart card and
So, where does this distressing news leave us? What can alleviate the destruction of
carefully and brilliantly crafted computational algorithms? A few options are set forth, with a
varying degree of confidence and from various angles. There are noise generators using
through time lapse, and finally masking through a mathematical computation. Some of these
The noise generators were fairly well deprecated from the start, but nevertheless must
be an explored option. In this schema, noise in introduced to the algorithm. This is both
simple and effective, but mitigating factors prevent it from becoming widespread. It is not
energy efficient, since it is pumping additional power. As a side effect, it is more expensive
to implement. Also, though the signal is distorted it is still ‘hidden’ there in a raw form. It
may also be tampered with. On the other side of the fence, we can minimize the signal to
almost nothing using an active power filter. This too is simple and effective, but also requires
a hardware change and is susceptible to physical tampering. Additionally, these filters either
can’t be made large enough (passive filter), or the active filter won’t be able to keep up with
modified the electrical bit stream in the following way, where the green arrow represents the
the difficulty of the analysis, but does not throw it for a grand new loop.
Finally we have another great contender for a protocol to mitigate the danger of a
differential power analysis, this is the concept of masking. In masking you turn a single bit
array into a pair of arrays to which a code must be applied to break it back into a single bit
Alg1(PTI) {
Vulnerable computation -> Result = PTI SecretKey
…
return CTO
}
Alg2(PTI) {
RandomMask = Rand();
mPTI = PTI RandomMask;
Result = mPTI xor SecretKey;
….
More masked options…
…
unmask and return CTO
}
The flaw here is that the algorithm is susceptible where a 2nd order attack is engaged.
In a 2nd order attack you must find correlated peaks, then you must identify inversely
correlated peaks. This is similar to the signal analysis done in a first order DPA attack.
Finally, you must determine which sets are correlated and which are uncorrelated in the
malicious hacker to solve. In a first order attack, “fewer than 50 power signals are needed” to
crack the data. In a second order attack, this number rises to 2N2. Finally, use of a masking
technique requires the attacker to know what time component of the signal to identify, which
So, are AES and RSA encryptions the standards of choice? While they are both very
powerful encryption schemes, they are both vulnerable to DPA and other physical attacks.
Yet it has yet to be seen that there is a encryption scheme that can, on its own, defend against
these types of attacks. Masking presents us with a glimmer of hope for successful encryption
of signals, but this discipline is still relatively young. Until the encryption of signals advances
to the point that they cannot be forcefully decrypted in a time span less than the usefulness of
the data, smart cards represent a significant security risk that cannot be ignored.
Now that all of you are scared about the security of the smart cards, let us look at
another aspect of smart card security that could use some deeper thought and analysis.
Access control models are methods and control structures that determine who can access what
data and functions within the smart card architecture. Access control models have been
making great strides in the last 8-10 years, especially with the introduction of the high-utility
Role-Based access control model. So how are they implemented in smart cards?
To understand the Access Control rules, you must understand the architecture of a
smart card. Interoperability is designated at two levels by the Government Smart Card –
Interoperability Standard (GSC-IS), the service call level and the command level. The service
level is more basic and is primarily concerned with functions that obtain various services from
the card, primarily dealing with cryptographic identification and creation of a secure
transmission medium. The API for this medium is called the BSI, or Basic Services Interface.
The BSI is implemented by the Service Provider Module (SPM). SPM is a hardware and
software interface, while the software service alone is called the Service Provider Module
(SPS). At the command level, the specified API is the Virtual Card Edge Interface (VCEI).
This level is concerned with the Application Protocol Data Units (APDU) sent to receive
required services. These APDUs are defined within IS 7816-4 (ISO4) and 7816-8 (ISO 8)
Service Provider Software (SPS) reformats BSI-level authentication structures into APDUs
for the VCEI, and vice versa. At this time it should be noted that certain data sets, called Data
Models, are a required standard format to ensure the interoperability provided by the BSI and
VCEI. Categories of these data models are called containers. For example, “One of these
containers, the Card Capability Container (CCC), describes the differences between a smart
card’s native APDU set and the standard APDU set defined by the VCEI. An SPS retrieves a
smart card’s CCC and uses it to perform the translation between the VCEI and the card’s
native APDU set. The GSC-IS accommodates any smart card whose APDU set can be
mapped to the VCEI via a CCC Definition”(NIST, 21). At this time, a graphic of the smart
card layout will show you how the layers are stacked.
Within the BSI, three logical modules are instantiated by NIST to define what services
they provide. Different modules are used to sort and define the different user groups, and
three modules are instantiated by the NIST standards. They are the Utility Service Provider,
Generic Container Service Provider, and the Cryptographic Provider. The utility service
provider is responsible for creating and terminating logical connections, retrieving a list of
available card readers, and other such tasks. The generic container service provide an
core requirements for cryptography such as random number generation, authentication, and
smart cards. These are virtual machines and file systems. The “file system” cards are the
original, and conform to ISO 7816-4, dealing with communications standards. They are hard
coded at time of manufacture, and cannot be changed later. Virtual machines commonly use a
special java virtual machine specification, though other environments are theoretically
supported. Executable can be integrated with the environment, and programmatically change
its function. These changes allow it to theoretically support any protocol, not the least of
which include the ISO communications standards. The VCEI must contain two things: a card
edge definition for file system cards and a card edge definition for virtual machine cards to
include the following three pieces: a generic container provider, a symmetric key
Now that this has been defined, we can look more deeply at the access control model.
The modules we mentioned earlier of utility service, generic services, and cryptographic
services play a large role here. A smart cards services and containers provided by SPM are
subject to Access Control Rules (ACRs), which are defined when a smart card is initialized.
There are three general authentication mechanisms that the ACRs are based upon: Pin
Verification, External Authentication, and Secure Messaging, which you can see in the list of
rules.
These BSI level ACR’s are logical compositions of primitive access methods, with
associated hexadecimal values. The standard BSI service in this instance specifies 23 services
that are required, grouped across the 3 modules and they contain some of the following
functions:
These functions support various ACR’s. In addition, any function call that maps directly to a
previously mentioned DES cryptograms are useful at this stage, as BSI transmits and receives
logical connection is created using gscbciUtilConnect(). Then it would retrieve the ACRs
gscBciUtilAcquireContext() using the ACRs required by the service’s security context. After
the verification is complete, a gscBsiUtil. So we can see here that there is a significant
framework of access control models and methods within the smart cards that allows for a
varying degree of security and authentication. There is a potential oversight however, which
Application Protocol Data Units for the Virtual Card Edge Interface, and vice versa. Thus,
they are an isolated medium of communication between the card and the reader. There is no
SPS authentication, and the SPS is not responsible for enforcing the ACRs. What this
essentially means is that the SPS is always a trusted authority for the transmission of
communication. It should be trivial to note at this point that this can be classified as a very
bad thing. The potential for misuse and abuse is rampant, since the software can basically
interpret the data any way it wishes to and capable of doing. Additionally, this can be
extremely transparent to the user since it would raise no flags at the time of execution. That
When the user can neither confirm nor deny whether he or she authorized a particular
transaction, non-repudiation is thrown out the window. With a power attack analysis at time
of execution, or an attack on a physical card that has been stolen as the researchers at
Cambridge have proven, there are several ways in which a user can lose unique access to their
encryption schemes. Additionally, other sensitive and identifying data is still at risk. I
believe it is safe to say at this time that non-repudiation is an unachievable goal with the
With many actors at work in the field, and with so many commercial, it is not
unreasonable to believe that smart card technology can be a viable option in the next five to
seven years. However, several barriers stand in the way. The easily broken transmission
encryption schemes make the theft of a card a significant risk. The relatively poor solid state
data protection also makes theft a significant risk, and opens up wide avenues of abuse. The
lack of authentication in the SPS allows malicious alteration of otherwise secure transactions.
These forces together make smart card security a dim proposition at this time, yet there is a
Smart Card Security. 25 Sept. 2004. Gamma Secure Systems. 20uly. 2005
<http://www.gammassl.co.uk/topics/smart%20cards/>.
NIST Smart Card Standards and Research. 16 July 2003. US Commerce Department’s
Technology Administration. 22 July. 2005 <http://smartcard.nist.gov/>
Smart Card Overview of Smartcards, integrated circuit cards, Chipcards and Memory Cards.
20 July 2005. Jacquinot Consulting Inc.. 21 July. 2005 <http://www.cardwerk.com/>
Corman, Patrick and Burke, Caron. Cryptography Resarch Patents for Smart Cards. 19 Apr.
2004. Cryptography Research Inc.. 22 July. 2005
<http://www.google.com/search?q=cache:dJb41PwnchAJ:www.cryptography.com/
company/prel/20040419-DPA-Patent.pdf+%22smart+cards%22+cryptography&hl=en>
Messerges, Thomas, PhD. Power Analysis Attack Countermeasures and their Weaknesses. 12
Oct. 2000. Motorola. 20 July. 2005
<http://www.iccip.csl.uiuc.edu/conf/ceps/2000/messerges.pdf>