Home > Articles > Hardware

  • Print
  • + Share This
This chapter is from the book

Security Mechanisms

The previous sections define some of the abstract concepts of security as well as the major components of the systems for which a secure environment is desired. In this section, some of the mechanisms that the various players can use to facilitate the various security concepts are examined.


The field of cryptography is dedicated to the development of mechanisms through which information can be shared in a secure fashion. A variety of mechanisms have thus been developed through which the security concepts discussed earlier can actually be realized. Several different mechanisms have been developed to support the authentication of identity among widely diverse participants in a transaction. A few of the more prevalent of these mechanisms are described in the following sections.

Symmetric Key Authentication

Most, if not all, authentication mechanisms involve the sharing of a secret among all the participants in a transaction. Two such mechanisms involve distinct forms for encryption and decryption of information; the first makes use of a symmetric key encryption algorithm and, the second, a public key encryption algorithm. Both of these mechanisms involve a shared secret; however, the manner in which the secret is shared in each case makes the two mechanisms preferable in different situations. Specifically, symmetric key algorithms are most useful in providing bulk encryption of information because they are less processor intensive than public key algorithms.

Symmetric encryption algorithms make use of a single key for both the encryption and the decryption of information. This is illustrated in Figure 4.2.

Figure 4.2Figure 4.2 Symmetric key encryption.

In a symmetric key approach, the same key is fed into the encryption algorithm to both encrypt information and decrypt information. Plain text information is passed into the encryption process, where it is modified through the application of the key value. The resulting ciphertext contains all the information present in the original plain text; however, due to the manipulation of the encryption algorithm, the information is in a form not understandable by a reader that does not possess the key. When the ciphertext is passed back through the encryption algorithm with the same key applied (as was used for the encryption process) then the plain text is recovered.

It is apparent that this approach can be used to keep secret the plain text information from anyone who does not have the required key. The approach also can be used, however, to allow each side of a pair-wise transaction to confirm that the other side holds the same key and thereby authenticate a known identity.

This symmetric key identity authentication for a smart card environment is illustrated in Figure 4.3.

Figure 4.3Figure 4.3 Authentication via shared secret.

In the case shown in Figure 4.3, the application spans both the off-card environment and the on-card environment. In most common instances today, the application is created by the card issuer, who installs the shared secret (the key) in both environments. It should also be pointed out that the case shown in Figure 4.3 could be extended to make use of two distinct authentication operations, each using a different key. This approach would be quite useful if, for many different

cards (with different cardholders), all of the cards simply need to authenticate a single identity for the off-card application while the off-card application needs to authenticate the unique identity of each individual card.

With this approach, each card would need to know two keys: one to be used to authenticate the off-card application and one to use in authenticating itself to the off-card application. The off-card application, however, would need to know a large number of keys; the one it uses to authenticate itself to all the various cards and one for each card it uses when each card authenticates itself to the off-card application. From the standpoint of the cardholder, this is a less than optimal situation in that the secret key used to authenticate the identity of the card is known outside the card. Similarly, the secret key used to authenticate the identity of the off-card application is known to every card that can access this application. If this key can be retrieved from the card, then perhaps an attacker could use it to gain access to the application.

A shared secret approach typically is used by a smart card to authenticate the cardholder to the card. This is done through a cardholder verification (CHV) command set, listed among the interindustry commands defined in the ISO/IEC 7816-4 specification that we'll consider a bit later in this chapter. This verification process often is referred to as PIN entry or PIN checking. In this process, a file is written within the file structure of a smart card. A PIN value is then written in this file. When a cardholder inserts a card into a terminal, the off-card application requests the bearer to enter a PIN through a terminal keypad. The number sequence then entered is passed through an application protocol data unit (APDU) command to the card, which then compares the value supplied by the terminal (which was entered by the cardholder) to the value in the CHV file. If they match, the cardholder is then identified (so far as the card is concerned) as the person for whom the card will act.

This CHV process can be significantly more complex than depicted here; multiple PINs can be required or supported by a single card. In addition, multiple steps can be required for the cardholder to finally be authenticated to the card.

Asymmetric Key Authentication

A second approach that is widely used for identity authentication makes use of an encryption process called asymmetric key encryption; this technique is commonly called public key cryptography. As the name implies, the technique makes use of different keys for the encryption operation and the decryption operation. This is illustrated in Figure 4.4.

Figure 4.4Figure 4.4 Asymmetric key encryption.

With this technique, one key is used to encrypt information and the other is used to decrypt the ciphertext to get back the original plain text. There is actually a shared secret between the encryption and decryption keys; that is, the keys are generated as different components of a common algorithm. What's so interesting about this approach, as opposed to the symmetric key approach, is that the proliferation of keys alluded to in the symmetric key discussion can be greatly reduced.

Of the two keys used in the asymmetric key mechanism, one of the keys can be held as a closely guarded secret (and indeed should be) by the entity that will subsequently use this key for identity authentication; this key is termed the private key. The other key can now be distributed to anyone; hence, it's referred to as the public key. The public/private key pair can be used to establish authenticated identity, as illustrated in Figure 4.5.

Figure 4.5Figure 4.5 Asymmetric key authentication.

What's shown in Figure 4.5 is actually just authentication in one direction; that is, the off-card application can authenticate its identity to the smart card–side application. To do this, the off-card application keeps secret the private key, which essentially represents its identity. The public key corresponding to this private key can be freely distributed; hence, it can be stored on every smart card that might want to access the off-card application. So, the card can use this public key to encrypt some type of challenge text string; that is, some arbitrary string that the card knows and wants to see if the terminal can find out. It then sends the ciphertext generated from this challenge text to the off-card application. If the off-card application really possesses the identity (private key) corresponding to the public key possessed by the card, then it can decrypt the challenge and return the plain text to the card for validation.

Obviously, the inverse of this procedure can be used to allow the card to authenticate its identity to the off-card application. In this case, the off-card application needs to know only the public key component related to each card's identity. So if it is to be able to authenticate a large number of cards, it needs to keep a list of, or at least be able to obtain, the public keys of the cards it wants to authenticate. This is considerably better from a security standpoint than the symmetric key situation described in the previous section.

Of course, there's never a free lunch. Computationally, a public key encryption and/or decryption algorithm is much more intensive than a symmetric key algorithm. Therefore, it is unrealistic to think about encrypting or decrypting large amounts of information on a smart card processor in a short time. However, the challenge text noted previously does not have to be too voluminous. So for establishing authenticated identity, public key mechanisms can be used effectively even given the limited processor capacity of a smart card.


The mechanisms described previously are useful for authenticating identities among a variety of parties to a transaction. Although it may not always be thought of as a transaction, the same mechanisms are useful for establishing identities related to documents or procedures—that is, performing the function of allowing an identity to sign a document or a process. Thus, this identity authentication procedure can form part of what can be referred to as a digital signature. The other aspect of a digital signature is the confirmation that the information that has been digitally signed has not been modified from the time that it is signed until it is read (and the signature's identity is authenticated). This, then, is a means of addressing another of the concepts of security: integrity.

One-Way Hash Codes

In the case illustrated by Figure 4.5, when the smart card encrypts the challenge text with a public key, the smart card authenticates the identity of the off-card application when it demonstrates possession of the private key, which can decrypt the challenge text. The smart card application knows that only the possessor of the private key can decrypt that message. So if the process is reversed and the off-card application generates some piece of text and encrypts it with its private key, the smart card application knows that the text, when decrypted with the public key (of the off-card application's identity) must have come from the off-card application. Thus, the off-card application has digitally signed the text in question; that is, it has essentially affixed an identifying symbol that conveys the same information that the signature at the bottom of a contract does.

As mentioned previously, public key encryption and decryption can be very processor intensive. Further, the public key encryption and decryption operations being discussed are (for purposes of the current discussion) intended to authenticate identity, not assure privacy. This being the case, it is not actually necessary to encrypt all the information in question in order to digitally sign it and to validate that it hasn't changed (i.e., that the integrity of the information has been preserved). Rather, all that is necessary is to calculate some type of unique checksum over the information in question and then encrypt that checksum. A checksum is the result from a computational algorithm acting on the information in question such that if a single bit of that information changes, the resulting checksum will change.

Generation of such checksums is possible with a family of computational algorithms known as one-way hash functions. Through these functions, you can process a large collection of information and derive a much smaller set of information, referred to as a hash code. You might think of a hash function as a logical, nondestructive meat grinder. When you grind a piece of meat with it, you don't destroy the meat, but you get out a pile of ground round that is unique for every piece of meat you put into it. So, if I put the same piece of meat through the grinder twice, I get two identical batches of ground round.

Some very desirable traits of useful one-way hash functions are the creation of a unique hash code for a unique collection of bits comprising the source document and the inability (or at least great computational difficulty) to predict what hash code will be generated (without passing the information in question through the one-way hash code algorithm) from a given collection of bits. Probably, the most popular one-way hash code in use in the smart card world is the SHA-1 algorithm.

A variant of one-way hash functions has been developed that also requires a key, in addition to the information in question, before a one-way hash code can be computed. These functions are referred to as message authentication codes, or MACs. They are useful for confirming integrity of information as well as authenticating identities associated with the information, but without guaranteeing the privacy of the information. A variant on this theme involves the use of public key cryptography in conjunction with one-way hash functions; this is the mechanism that is most generally called a digital signature as opposed to the definition suggested earlier.

Digital Signatures

If a one-way hash function is computed on a collection of information and that hash code is not encrypted with the private key of a public/private key pair, the encrypted information that results provides both authentication of the identity of the entity which encrypted the hash code (essentially signed the original information) and the integrity of the original information. This mechanism is illustrated in Figure 4.6.

Figure 4.6Figure 4.6 A digital signature using a one-way hash code.

From Figure 4.6, you can see that if the original document along with the digital signature of that document (i.e., the private key–encrypted hash code calculated from the document) is now passed to a another entity, that entity can validate the digital signature, authenticate the identity of the entity that digitally signed the original document, and confirm the integrity of the original document (i.e., confirm that the same one-way hash code is calculated from the document on receipt as was calculated from the document at signing time).


After the identity of an entity is established through some authentication procedure, what that entity is allowed to do in the context of a given system is the subject of another security concept termed authorization. It is useful to think of authorization in the context of a server that is being accessed by a client—the server provides information or some other abstract service to the client based on what privileges the client has with respect to that server; the model is illustrated in Figure 4.7.

Figure 4.7Figure 4.7 The authorization model.

This model indicates that if a client wants to gain some type of access to an object of interest, it must first authenticate its identity to the server. The server can then consult a list of privileges, which that client (identity) has with respect to that object of interest. Figure 4.7 denotes this list of privileges as an access control list (ACL); most such mechanisms can be abstracted back to something that looks like an ACL. This mechanism is widely used within smart cards for access to information (in files or objects) and/or processing capabilities (functions).


ACLs are authorization or privileges lists that link identities, and what those identities are allowed to do, to specific objects of interest. The ACL is typically viewed from the perspective of the object of interest and the server that makes that object of interest accessible to clients. It is the server that interprets the ACL and decides, based on the authorizations it finds there, what access to allow to the object of interest by the client. For a particular object of interest, a well- defined set of authorizations typically can be defined. For a file, for instance, the following privileges typically are defined:

  • create
  • delete
  • read
  • write
  • modify
  • execute

An ACL for such a file might then look as shown in Table 4.1.

Table 4.1 The ACL for the File abc.txt








Jane Doe







Good Person







Iffy Person







This ACL says that the identity Jane Doe can really do anything at all to the file. The identity Good Person can read, write, and execute any code found in the file, while the identity Iffy Person can only read the contents of the file.

Capabilities List

A relatively orthogonal way of looking at this same authorization model (i.e., one represented by an ACL) is called a capabilities list. In most instances, the way this variant of the model is implemented, the capabilities list is passed along to the server essentially merged with the identity authentication. That is, there is assumed to be an administration function that decides, external to the actual server, what capabilities (privileges) a specific identity is to have with respect to the object of interest.

In both variants, the security procedures followed are essentially the same. First, authenticate the identity, and then go to an authorization list to determine what privileges that identity has with respect to the object of interest. The most straightforward mechanism for doing this is to include the capabilities list in the digital certificate through which identity is tied to a key that can be used to authenticate that identity.


The final concept of security to be dealt with is privacy, which is keeping the details of a transaction secret from everyone not involved in the transaction. The cryptographic mechanisms previously discussed are adequate to provide transaction privacy. In general, the major design factor (i.e., deciding which mechanism to actually use) is one of performance in the actual operational environment.

As mentioned previously, public key cryptography is significantly more processor intensive than is symmetric key cryptography. Consequently, most systems make use of symmetric key algorithms to actually encrypt the information flow between two disparate points involved in the same transaction. In point of fact, however, public key mechanisms are still quite useful in even this case. Specifically, public key mechanisms are useful in order to exchange the symmetric key needed by both ends of the communication channel. Such shared secrets are well-recognized risk areas in security systems; the longer and more often that the same symmetric key is used, the better the chance for an attacker to figure out what it is and use that knowledge to compromise the privacy of the transaction channel.

If public keys are well known throughout the specific security system, then the mechanisms discussed earlier can be used in which one end of the transaction channel can generate a random symmetric key and send it, under cloak of encryption by the other end's public key knowing that only the other end possesses the private key necessary to decrypt the message containing the secret symmetric key.

If public keys are not well known throughout the system, or actually even if they are, another mechanism exists that is useful specifically for distributing secret symmetric "session" keys (so named because a new key can be generated for each "session" in which a transaction of some type is to occur) among disparate participants in the transaction. The mechanism is known as the Diffie-Helman protocol. It has the very nice feature that, by agreeing in advance to make use of a common algorithm, each end of the channel can calculate a secret key based on information that it can exchange in the clear. The mechanism cannot be used to actually encrypt information, but rather just to exchange a secret symmetric key, which can then be used to encrypt the actual transaction information.

Bulk Encryption

The encryption of transaction information often is referred to as bulk encryption. In general, smart cards are not involved in bulk encryption processes. The data transfer rate across the I/O port from a smart card reader to the card is very low (on the order of 10 Kbps) relative to typical transmission speeds across local area or even wide area networks. Consequently, most cryptographic operations that are actually performed on a smart card are related to establishment of identity.

The dominant algorithms used for bulk data encryption include the DES algorithm, the Triple-DES algorithm, the RC4 algorithm, and the AES algorithm.

  • + Share This
  • 🔖 Save To Your Account