Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Atmel applications journal.Summer 2004

.pdf
Скачиваний:
109
Добавлен:
23.08.2013
Размер:
4.39 Mб
Скачать

A T M E L A P P L I C A T I O N S J O U R N A L

SECURITY IS NOT JUST AN AMERICAN ISSUE BUT A WORLDWIDE CONCERN. PROTECTING INDIVIDUAL PRIVACY, ENSURING BUSINESS VIABILITY, AND PREVENTING FRAUD IS IMPORTANT EVERYWHERE.

Security at an Affordable Price

By Jean Pierre Benhammou and Mary Jarboe

After working closely with several international customers to understand their security needs, Atmel designers recognized the need for a family of low-cost, highly secure products. These chips would offer an alternative to the microcontrollers that are used in bankcards, GSM phones, and similar applications. A low-cost solution was needed to protect an item with a value of $20 to $200 can make the cost of the security “fix” outweigh the cost

of

the fraud.

In creating

this

new

family

of

devices, Atmel designers also

considered

the

economic

 

limitations

of

emerging countries

that

need

affordable

solutions

to

launch

large applications.

 

 

 

 

With these concerns in mind, the Atmel team created a low-cost, high-security chip, using a 64-bit key encryption: the CryptoMemory® chip. This chip has many security features not found in any other product in the marketplace, including full encryption. Atmel’s CryptoMemory chip has a fast time-to-market, because as a chip solution, it doesn’t require an operating system. This fast delivery provides an affordable solution for businesses requiring immediate security.

To address a large array of applications, CryptoMemory is available in an entire family of nine devices from 1 Kbit to 256 Kbits, providing solutions for applications that require varying amounts of memory utilizing the same security features and protocols. When a customer’s application grows, the CryptoMemory device can be upgraded without changing software or hardware.

One business is using that flexibility to expand the 4-Kbit CryptoMemory devices currently in its ID badges. By the end of 2004, the company expects to purchase the 32K CryptoMemory device to handle photo IDs; and by 2005, it will increase the memory to 128 Kbits when finger chip technology is installed for access to high security areas of the buildings. This approach meets the company’s immediate security needs at a minimal cost and adds the flexibility to slowly increase security features to future building access plans.

Several nations worldwide, including the United Kingdom, are using CryptoMemory smart card modules for ID card systems that use the security of

Atmel’s CryptoMemory®chip is making low-cost security systems possible worldwide.

the device to integrate biographic and biometric information to identify their immigrant population. The UK had a three-week demonstration deadline from their first contact with Atmel. Because of the availability of the device and excellent relationships with card manufacturers and outside partners, Atmel successfully met the time constraints.

The same security proven in the smart card market is now being utilized for embedded applications, with standard plastic packages. CryptoMemory is the world’s only family of secure serial EEPROMs, making it easy and cost effective to upgrade from an application using a serial device with no security to different levels of security, from password protection to encryption with secret keys. CryptoMemory is offered in a standard SOIC, PDIP or SAP, using the same pinouts as Atmel’s 24Cxx serial family, so it is a drop-in solution to security at an affordable price.

With its high speed of 1.5 MHz, CryptoMemory ensures the authenticity of OEM removable components used to uniquely identify and protect them from counterfeiting or recharging. These devices can be used in electrical components within a system such as sensor modules or automotive air bags as well as non-electrical components like toner cartridges. Whether it is protecting intellectual property, protecting keys in a larger security scheme, preventing the counterfeiting of a system, or protecting dozens of other types of data, CryptoMemory offers the secure solution.

www.atmel.com

page 29

 

A T M E L A P P L I C A T I O N S J O U R N A L

CryptoMemory Security and Operating Features

64-bit Key Encryption

Symmetric Private Key Encryption Algorithm

Family of Nine Devices, from 1 Kbit (1/8K byte) to 256 Kbits (32K bytes); different densities can be used in the same application

Dynamic Mutual Authentication between Device and Host

Four Completely Independent Secret Key Sets for Multi-application Systems

Dual Communication Protocols, ISO 7816-3 Asynchronous T=0 Standard Interface and Synchronous Two-wire for Smart Cards and Synchronous Two-wire in Plastic Packages for Embedded Applications

Can be Used in Virtually Any Smart Card Reader

Stream Encryption with Changing Session Keys Ensures Data Privacy

Encrypted Passwords with Attempts Counters for Additional Security

Read and Write Encrypted Checksum Guarantees Data Integrity and Authenticity of Source

Anti-Tearing Avoids Data Corruption or Recovers Data in Case of Power Loss

2.7V to 5.5V Operation

User-Defined Memory Partitioning for Secure and Open Data Storage

Additional Features for Use in Embedded Applications

1.5 Mhz Compatible Two-wire Serial Interface for Fast Operation

Pin Compatibility with Atmel’s AT24Cxx Devices

Accommodates up to 15 Devices on Same Bus

Smart Card Applications

ID and Access Cards

Health Care Cards

Loyalty Cards, Such as Restaurant and POS E-Purse

Internet Kiosks

Energy Meters and E-Government

Embedded Applications

Printers and Removable Storage Devices

Subscriber Systems (Set Top Boxes)

Access Control Systems

Subassembly Authentication

Networked Systems

CryptoMemory devices are available in smart card module form or in plastic packages.

Cr

www.atmel.com

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

page 30

 

A T M E L A P P L I C A T I O N S J O U R N A L

CRYPTOMEMORY IS ATMEL’S SECURE SERIAL EEPROM SOLUTION WITH THE SAME PINOUT AS THE AT24CXXX SERIES, MAKING IT EASY TO UPGRADE FROM AN OPEN EEPROM TO A SECURE SOLUTION FOR EMBEDDED APPLICATIONS WITH ITS DUAL COMMUNICATIONS PROTOCOL.

Understanding CryptoMemory‚

The World’s Only Secure Serial EEPROM

By Dale Anderson, Applications Engineer

CryptoMemory, Atmel’s most advanced secure memory product, is a family of serial EEPROM devices available in capacities up to 256K bits with advanced security features, including data encryption/decryption. With trusted EEPROM technology as its core, this secure stand-alone memory is based on Atmel’s years of experience in the smart card and security markets.

A wide variety of markets require secure serial EEPROM. CryptoMemory was first introduced in the smart card marketplace, offering an easy-to- implement secure solution that communicates with standard card readers. One card has the capability to manage multiple applications. In an office or campus environment, CryptoMemory can be used as an ID card for access control and as a stored value card for cafeteria, parking or other services. CryptoMemory can also be used as an electronic key to unlock system features.

CryptoMemory is designed to keep contents secure, whether operating in a system or removed from the board and sitting in the hacker’s lab. Information about the system, about the user, or about a component of the system can easily be stored in this secure nonvolatile device. CryptoMemory provides a secure location for a manufacturer to store information not accessible by the user and can protect specific user data from other users. It also provides a unique and secure ID for removable components to control use in a system and prevent counterfeiting.

To create the CryptoMemory device, Atmel started with reliable EEPROM technology, which is structured in such a way that it is almost impossible to physically determine memory contents in a die-level attack. EEPROM memory is divided into zones or sectors, giving CryptoMemory the ability to isolate data for different uses or applications on one chip. Access to the EEPROM is only through the security logic that surrounds the memory. This logic is hard-wired and cannot be modified or tampered with in an attempt to bypass any of the security features. Each zone of the memory can be independently configured to operate as full read/write, read-only, or program-only memory; or can operate in a special write-lock mode that allows locking the memory in smaller sections.

Security Logic:

Password

Authentification

Encryption

Figure 1: The physical layers of CryptoMemory. Note how the logic surrounds the memory,

and tamper protection resides between communication protocols and the logic.

These memory features provide flexibility to the application developer, while the configurable security options make CryptoMemory a desirable secure storage device.

Different Levels of Security

Each zone of the memory can be independently configured to require different levels of security before its contents can be accessed.

First Option: No Security

With this option, one or more zones are set up with open access for data that does not require protection.

Second Option: Password Protection

A password must be successfully presented before access is granted to the protected memory zone. Only four incorrect attempts are allowed before that password and the protected zone are locked permanently.

Third Option: Authentication

Increasing the security another level, the authentication option protects one or more memory zones. In this security level, 64-bit cryptograms are

www.atmel.com

page 31

 

A T M E L A P P L I C A T I O N S J O U R N A L

exchanged; independent calculations are performed for a dual authentication between CryptoMemory and the host logic. Incorrect attempts are limited, and access is granted to the protected memory zone only after successful calculations.

Fourth Option: Data Encryption and MACs

The highest level of security utilizes data encryption and message authentication codes (MACs). To use encryption, authentication must be successfully performed first. With each successful authentication, a new 64-bit session key is generated. This key is used for subsequent encrypted read and write operations. When a memory zone is configured to require encryption, all data exchanges will be encrypted. A MAC may be requested to further validate data read from the device, and a MAC is required for each data string to be written to CryptoMemory.

Tamper Protection

Protection provided by CryptoMemory doesn't stop with the features built into logic. A hacker is likely to operate a device outside its normal conditions to try and bypass the logic and gain access to the memory contents. Tamper protection circuits have been added to CryptoMemory to stop hackers. These circuits will detect operations outside the defined limits and will safely shut down the device, preventing all access to its contents.

Implementing CryptoMemory

The first step in implementing CryptoMemory is to determine which memory and security features are needed. Then determine if data will be stored for different applications or will require different security levels, because the security settings are defined for each zone of memory. Once the data configuration and security settings have been defined on paper, initialize the CryptoMemory device.

The memory and security feature settings are stored in a special configuration zone of the EEPROM. Each zone has its own access register in this configuration zone. By programming this access register, the selected memory and security features for each memory zone are set. When two or more zones share the same features, the access registers are programmed the same. Multiple password and key sets are available for password authentication or encryption. The password or key set is also programmed into the access register for each EEPROM zone. Then the actual values for passwords and keys are programmed into specific locations of the configuration zone. Programming the configuration zone is as simple as programming an EEPROM. Once all values are written, a sequence of fuses is set, using a special write command to permanently lock the configuration zone. CryptoMemory is now ready for field use with its user-defined security settings and keys. After the configuration zone

programming is completed, CryptoMemory becomes a unique security device customized to each application – from low security to high security or with several security levels on the same device.

To make using CryptoMemory easier, two wellknown communication protocols are supported. For smart card applications, the ISO 7816-3 T=0 asynchronous protocol allows CryptoMemory to interface with any standard PC/SC reader in the market today. For embedded applications, the popular 2-wire serial interface is the same interface used on serial EEPROMs. The 4-byte commands used to operate CryptoMemory are simple and straightforward, whether setting the memory zone, reading and writing, or enabling authentication and encryption.

Atmel’s CryptoMemory family includes nine devices, from the 1-Kbit AT88SC0104C to the 256-Kbit AT88SC25616C. All devices share the same architecture, security features and communications protocol, allowing users to easily switch between members of the family as memory needs dictate. CryptoMemory offers many options for secure serial EEPROM with data encryption and other advanced security features. For even more options, Atmel’s new CryptoRF™ offers all the features of CryptoMemory with a 13.56 MHz RF interface compliant to ISO 14443-B.

Publisher: Glenn

Glenn@convergencepromotions

Managing Editor:

Bob@convergencepromotions

Technical Editor:

Markus@convergencepromotions

Production Manager:

Dbyd@garlic.com

Designer: Judy Gosse

Judy@convergencepromothions

This issue of the Atmel Applications Journal is published by Convergence Promotions. No portion of this publication may permission, in writing, from the publisher. The contents of this publication are Copyright © Atmel Corporation, 2004. AVRstudio®,SecurAVR™, CryptoMemory®, CryptoRF®, and FPSLIC® are the trademarks of Atmel Corporation or its rights are the proprerty of their respective owners. All product names, specifications, prices and other information are

no responsibility for false or misleading information or errors or omissions. Any comments may be addressed to the - promotions.com, or +1 (925) 516-6227.

www.atmel.com

page 32

 

A T M E L A P P L I C A T I O N S J O U R N A L

DATAKEY ELECTRONICS, INCORPORATED, A MANUFACTURER OF RUGGED MEMORY KEYS, TOKENS, RECEPTACLES AND SYSTEMS THAT SOLVE DATA TRANSPORT AND ACCESS CONTROL PROBLEMS, IS USING ATMEL’S CRYPTOMEMORY PRODUCTS IN THEIR NEWEST SERIES OF SECURE KEYS: CRYPTOMEMORY KEYS AND TOKENS.

Figure 1: Datakey’s rugged and reliable unit protects the embedded memory chip from physical damage.

World Touch Gaming Chooses

Datakey Electronics’ Portable Memory Keys

and Atmel's CryptoMemory®

By: Eric Jennings, Datakey Electronics

Datakey Electronics’ products are a convenient, rugged way to carry electronic data and to control access. The CryptoMemory Keys and Tokens feature Datakey Electronics’ industry-leading solid molded construction, rugged wear-resistant exterior and long-lasting contacts. Unlike cards that can be easily broken in rough usage, the key’s body protects the embedded memory chip from physical damage and harsh environmental influences—the keys can be sterilized, dropped in the mud, washed, driven over, exposed to electrostatic discharge or chemicals, and they’ll still work. For more than 25 years, these products have been proven reliable in hundreds of worldwide military and commercial applications, providing a cost-effective and secure way of storing and transporting electronic information where conventional methods would not survive.

With proven rugged and reliable data transport options already in place, Atmel’s CryptoMemory allowed Datakey Electronics to create a new, more secure product offering in a relatively short amount of time. The keys and tokens incorporate Atmel’s CryptoMemory dynamic,symmetric and mutual authentication protocol ICs. Atmel’s new encryption-based integrated circuits were perfectly sized to fit the existing form factors and provided Datakey Electronics with cost-effective, high-level security features. Datakey Electronics’ CryptoMemory Keys and Tokens are available with user EEPROM memories up to 256 kilobits. Security is provided using encrypted passwords, mutual authentication, data encryption and encrypted checksums. With respect to devices available in higher densities, features such as photos and biometric information can also be stored on-chip. Atmel’s CryptoMemory family of devices provides an innovative, cost-effec- tive solution that gives Datakey Electronics an advantage in the secure portable memory marketplace.

Although a very recent product offering, Datakey Electronics is already using CryptoMemory products to solve security issues for World Touch Gaming, a gaming software company based in

Figure 2: World Touch Gaming unit encorporates Atmel’s CryptoMemory’s dynamic, symmetric and mutual authentication protocol ICs to bring a whole new level of gaming to the field.

Cumming, Georgia. World Touch Gaming designs, develops and delivers leading-edge gaming and lottery products to the Class II Indian, Class III Indian and public gaming sectors. Their dual-display technology and proprietary, customized use of Windows CE .NET 4.2 allows World Touch Gaming to bring dynamic, reliable and highly profitable gaming content to their target markets. They also offer highly network-centric, multi-game, multi-denomination, multi-site inter-linked play of Class II games on multimonitor Player Terminals with integrated Match Play and Raffle promotional modes, which bring a whole new level of gaming to the field.

World Touch Gaming is also committed to ensuring maximum product security. Their most recent concern was authenticating access to the intellectual property of their gaming machines. They needed a secure medium to store passwords and "keys" that enable the software and unlock special features. Not

www.atmel.com

page 33

 

A T M E L A P P L I C A T I O N S J O U R N A L

only did the electronics need to be secure, but the hardware packaging needed to be robust.

Before settling on Datakey Electronics and Atmel’s CryptoMemory, World Touch Gaming also looked at secure microprocessors in DIP packages, but rejected this package because the potential for bent pins was too great. They barely glanced at mere standard storage mechanisms, due to the inability to secure the read function. They also looked at SD Cards, but the mechanism for securing the data from replication requires that each copy of the data be water-

marked, which changes the “image” from copy to copy. In the gaming industry, regulatory requirements make that impractical.

Figure 3: Datakey Electronics and Atmel’s advances in gaming technology enable and enhance security in gambling centers around the world.

The combination of Atmel’s CryptoMemory and Datakey Electronics’ rugged token package brought together a truly best-of-breed solution. The form factors that Datakey Electronics focuses on are ideal for consumer and operator-oriented security and personalization applications. World Touch Gaming was impressed by the level of physical and electrical integrity found in Datakey Electronics’ products. World Touch Gaming uses the tokens to license and authorize the use of their intellectual property (the software on their gaming machines) and to potentially give access to special testing features. To implement this capability, World Touch Gaming embedded a token receptacle into their proprietary Vertex II I/O PCB. The tokens that go into this recptacle are securely read and written to.

World Touch Gaming was especially pleased at how few obstacles arose during the implementation of

CryptoMemory. Obtaining the ELVA protocol from Atmel was one such obstacle, primarily due to its secure nature.

The main CryptoMemory interface component World Touch Gaming chose is the AT89C5122 secure micro. It uses a "relatively open" USB connection back to their main processor, but the ELVA protocol and the secure, private keys used for secure communication are all hard-coded in the secure areas of 5122. World Touch Gaming worked directly with Atmel on that issue.

By implementing CrytpoMemory, World Touch Gaming saved money, reduced time-to-market, eliminated security roadblocks, and gained a competitive advantage. Their customers can be confident that only authorized parties are given access to the appropriate features. By using the

Figure 4: The combination of Atmel’s CryptoMemory and Datakey Electronics’ rugged token package brought together a truly best-of-breed solution.

combined Atmel/Datakey Electronics CryptoMemory Keys and Tokens, World Touch Gaming has an electronic key with a very robust hardware and software implementation. To date, no other gaming machine manufacturer has anything close.

The end result of this collaboration is a portable data transport package that prevents improper insertion, and allows World Touch Gaming to store encryption keys, authentication credentials and configurable variables without fear of tampering–critical to the integrity of the gaming machine. The CryptoMemory Tokens enable World Touch Gaming to send their products into a market where security is of paramount importance.

Other applications that require this high level of tamper-proof security include access control, cashless vending, secure data transfer, ATM machines, metering, loyalty programs, identity authentication, kiosks and more.

For more information on

CryptoMemory Keys and Tokens, visit

www.cryptomemorykeys.com

a joint Datakey Electronics, Inc.

and Atmel Corporation web site.

www.atmel.com

page 34

 

A T M E L A P P L I C A T I O N S J O U R N A L

Protecting System Configuration Data with CryptoMemory®

NEARLY ALL EMBEDDED

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SYSTEMS USE SOME FORM OF

By: Dale Anderson, Applications Engineer

 

 

CryptoMemory is a family of secure serial EEPROMs

 

 

 

 

 

 

 

 

 

NON-VOLATILE DATA STORAGE.

In nearly all embedded systems today, some form of

 

designed to protect the information they store. With

 

 

 

 

 

 

 

 

memory

densities

from 1 Kbits

to

256

Kbits,

CRYPTOMEMORY® NOW OFFERS

nonvolatile memory

is used to store

information

 

 

CryptoMemory is able to store and protect small to

 

 

 

 

 

 

 

required by the system for each use. This informa-

 

A SECURE SOLUTION FOR

 

 

large amounts of

data. User-defined memory

 

tion could

be

settings

from

the

last

 

 

 

 

 

 

 

 

 

partitioning

provides

both secure

and

open data

STORING DATA IN A SYSTEM.

system use, preferences selected by the user, or

 

 

storage

in

the same

device. Access

to

secure

 

 

 

 

 

 

 

configuration

data

programmed by

the system

 

THIS ARTICLE WILL DESCRIBE

 

memory

portions

is

controlled

by

a

mutual

manufacturer. In the case of configuration data, this

 

 

 

 

 

 

 

 

 

authentication protocol, encrypted passwords and

HOW TO USE CRYPTOMEMORY

often determines the performance features of the

 

 

data encryption.

And

with its

2-wire

serial

 

 

 

 

 

 

 

system and may be considered confidential by the

 

IN AN EMBEDDED SYSTEM

 

 

communications,

CryptoMemory

can

be

easily

 

system manufacturer. Take,

for example,

the

 

 

 

 

 

 

 

 

 

integrated into any embedded application.

 

 

TO STORE CONFIDENTIAL

 

consumer product offered at three different levels of

 

 

 

 

 

Memory and Security Selections

 

CONFIGURATION DATA.

 

performance and three different price points. For

 

 

 

manufacturing efficiency, the electronics inside all

 

The AT88SC0204C device has 2 Kbits of EEPROM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

three products are identical, and only the features

 

memory arranged as four zones of 512 bits (64

 

 

 

 

 

 

 

that are enabled are different.

The configuration

 

bytes) each. The security access rights for each

 

 

 

 

 

 

 

data determines the features or levels of

 

zone may be independently selected. To protect

 

 

 

 

 

 

 

performance that will be enabled in the low-end,

 

each zone, there are eight password sets and four

 

 

 

 

 

 

 

mid-range and high-end versions of the product. A

 

authentication key sets available. For this example,

 

 

 

 

 

 

 

knowledgeable consumer with an electronics

 

we will elect to use the highest level of security,

 

 

 

 

 

 

 

background (and perhaps a little help from an

 

mutual authentication and stream encryption of

 

 

 

 

 

 

 

Internet site) could purchase the low-end product

 

data. We will use different keys to protect the

 

 

 

 

 

 

 

and attempt to upgrade to the high-end version

 

manufacturer’s configuration data and user’s

 

 

 

 

 

 

 

simply by reprogramming the system configuration

 

information. Additionally, we will lock the manufac-

 

 

 

 

 

 

 

data. Atmel’s CryptoMemory device family offers a

 

turer’s configuration data, so it cannot be rewritten

 

 

 

 

 

 

 

solution to protect this configuration data, the

 

even after proper authentication. Atmel’s

 

 

 

 

 

 

 

manufacturer’s intellectual property and the

 

CryptoMemory Evaluation Kit (AT88SC25616C-EK)

 

 

 

 

 

 

 

manufacturer’s profit margin.

 

 

 

 

provides additional information on these and other

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CryptoMemory security options and provides a

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

platform for experimenting with these options on

 

 

 

 

 

 

 

 

 

 

 

Access

Password

 

 

 

 

 

 

 

 

Memory Zone and Security Level

 

 

 

 

real devices. Figure

1

shows the

assignment

of

 

 

 

 

 

 

 

 

 

 

Register

Register

 

 

 

 

 

 

 

 

 

 

 

 

memory zones and security levels. Zone 0 and Zone

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 have the same security settings, providing 1024

 

 

Zone 0 -

 

 

-

 

64 bytes Encrypted

 

 

 

 

 

 

 

 

 

 

Manufacturer's

 

 

 

 

 

 

 

 

 

bits (128

bytes)

of memory for storage and

 

 

 

-

Read Protected by Authentification Key 0, No Write Allowed

 

$D5

$3F

 

 

 

 

Configuration

 

 

 

 

 

 

 

 

protection of the manufacturer’s configuration data.

 

 

Data

 

$038

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$000

 

 

 

 

 

 

 

 

 

 

These security selections are set

by

writing

to

 

 

Zone 1 -

 

-

 

64 bytes Encrypted

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

access

registers

and

password

registers in

a

 

 

Manufacturer's

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read Protected by Authentification Key 0, No Write Allowed

 

$D5

$3F

 

 

 

 

Configuration

 

-

 

 

configuration zone of the device. This configuration

 

 

 

 

 

 

 

 

Data

$038

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

zone is an additional 2 Kbits of EEPROM used to

 

 

 

 

$000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

store security settings, passwords, authentication

 

 

Zone 2 - User

 

-

 

64 bytes Encrypted

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

keys, and cryptograms, and this zone also provides

 

 

Data

-

 

Read/Write Protected by Authentification Key 1

 

 

$D7

$7F

 

 

 

 

 

 

 

 

 

 

 

 

an additional 61 bytes of one-time programmable

 

 

 

$038

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(OTP) memory.

 

 

 

 

 

 

 

 

 

 

$000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programming CryptoMemory

 

 

 

 

Zone 3 - Open

-

 

64 bytes

 

 

 

 

$FF

$FF

 

 

 

 

 

 

Memory

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-

 

Open Memory

 

 

 

 

 

 

for Use

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$038

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Once memory partitioning and security settings are Figure 1: Security Settings determined, the AT88SC0204C may be programmed

for use. Since the manufacturer’s configuration data that we want to protect cannot be changed, it must

www.atmel.com

page 35

 

A T M E L A P P L I C A T I O N S J O U R N A L

be written as the device is initially programmed. The device should be programmed in the following sequence. (The applications note, Programming the CryptoMemory Device for Embedded Applications, available on the Atmel website, provides more detailed information on this process.)

Write user data. Any initial information that is to be stored in the device should be written into the four zones of the memory at this time. Since we will be preventing any future writes to Zones 0 and 1, the manufacturer’s configuration data must be written at this time.

Unlock the configuration zone. This is done by presenting the secure code (provided by Atmel) to the device.

Write to the configuration zone. The access registers, password registers, initial cryptogram values and authentication keys to be used are all written to the configuration zone. Once these values are written, the security options selected take effect in protecting the user zones of CryptoMemory. If any information is to be stored in the OTP areas of the configuration zone, it should be written at this time.

Write the security fuses. The last step in programming CryptoMemory is writing the security fuses to lock the configuration zone. This will hide the secret keys for authentication and prevent any further modifications to the configuration zone.

Programming CryptoMemory is accomplished by using the eight commands shown in Figure 2. Each command consists of four bytes where the last byte indicates how many additional bytes are included for a write command or how many bytes to expect back when reading the device. These commands operate to a simple 2-wire interface consisting of

clock and data and may be implemented on commercially available memory programmers.

CryptoMemory in the System

After the AT88SC0204C is programmed, it is ready for installation in the system. The system may access Zone 3 by simply executing a Set User Zone command followed by the Read User Zone or Write User Zone command; there were no security conditions established for this zone so access is open. Access to User Zones 0, 1 or 2 will require a successful execution of the Verify Authentication command, using the proper key. Authentication involves a calculation and exchange of new 64-bit cryptograms by both the system logic and CryptoMemory device. Received values are compared against calculated values before access is granted to the protected user zone. These values will be different for each and every authentication between the system and CryptoMemory. After successful authentication, the Verify Encryption command is used to initiate data encryption. Only after this is accomplished can the protected manufacturer’s configuration data in Zones 0 and 1 be read out in an encrypted form.

In addition to the logical protection of data stored in CryptoMemory, there are also tamper protection circuits on chip. Whether operating in a system or removed from the system and under attack in a lab, these circuits are designed to prevent any unauthorized access to the memory contents of CryptoMemory. All features combined provide a safe location for storing manufacturer’s configuration data or any other sensitive information in a simple secure serial EEPROM.

 

 

 

 

Command

Addr 1

Addr 2

N

 

Data (N)

Write User Zone

 

 

 

$B0

$00

addr

N

$10

N bytes

Read User Zone

 

 

 

$B2

$00

addr

N

 

 

System Write

Writi8ng Config. Zone

 

 

$B4

$00

addr

N

$10

N bytes

 

 

 

 

 

 

 

 

 

 

 

Write Fuses

 

 

$B4

$01

fuse ID

$00

 

 

 

 

 

 

 

 

 

 

 

 

 

Set User Zone

 

 

$B4

$03

zone

$00

 

 

System Read

Read Config. Zone

 

 

$B6

$00

addr

N

 

 

 

Read Fuse Byte

 

 

$B6

$01

$00

$01

 

 

 

 

 

 

Verify Secure Code

 

 

 

$BA

$07

$00

$03

 

3 byte password

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2 : Commands for Programming

www.atmel.com

page 36

 

A T M E L A P P L I C A T I O N S J O U R N A L

CryptoMemory® as a Stored-Value Card for Electronic Purse Applications

By Dale Anderson, Applications Engineer

THE ELECTRONIC PURSE CONCEPT INVOLVES PLACING MONETARY VALUE ON A SMART CARD KNOWN AS A STORED-VALUE CARD THAT WILL BE DEBITED WHEN USED TO PAY FOR SMALL VALUE GOODS AND SERVICES.

Figure 1: Memory Map

Would you like to visit the laundromat without bringing a bag of quarters? Tired of searching for coins to feed the parking meter? Would you like the convenience of making your cafeteria and vending purchases without using cash? For all of these situations, smart cards offer a solution known as the electronic purse or e-purse. The electronic purse concept involves placing monetary value on a smart card known as a stored-value card that will be debited when used to pay for small-value goods and services. These payments may be made to a cashier or through an unattended point of sale (POS) terminal. When funds are exhausted, the user may reload the card at an authorized station for continued use.

Atmel produces many devices for the smart card marketplace, and the CryptoMemory® family of devices is well-suited for stored value cards in the e-purse application. CryptoMemory offers a standard communications protocol, built-in mutual authentication and data encryption using 64-bit keys. A partitioned memory and multiple key sets, all configurable to the user’s specific needs, provide flexibility. This family of secure devices includes nine memory densities ranging from 1 Kbit to 256 Kbits to accommodate small to large data storage requirements. All devices share the same logic and security features, making it easy to upgrade to larger memory sizes if data requirements should change.

User Zone

0 = Laundry Value

 

 

 

 

 

 

$00

256 bit value counter

 

 

 

 

 

 

$08

 

 

 

 

 

 

 

 

$10

 

 

 

 

 

 

 

 

$18

 

 

 

 

 

 

 

 

User Zone 1= Laundry History

 

 

 

 

 

 

$00

date0

date0

value0

value0

date1

date1

value1

value1

$08

date2

date2

value2

value2

date3

date3

value3

value3

$10

date4

date4

value4

value4

date5

date5

value5

value5

$18

date6

date6

value6

value6

date7

date7

value7

value7

User Zone 2 = Parking Value

 

 

 

 

 

 

$00

256 bit value counter

 

 

 

 

 

 

$08

 

 

 

 

 

 

 

 

$10

 

 

 

 

 

 

 

 

$18

 

 

 

 

 

 

 

 

User Zone

3 = Parking History

 

 

 

 

 

 

$00

date0

date0

value0

value0

date1

date1

value1

value1

$08

date2

date2

value2

value2

date3

date3

value3

value3

$10

date4

date4

value4

value4

date5

date5

value5

value5

$18

date6

date6

value6

value6

date7

date7

value7

value7

 

 

 

 

 

 

 

 

 

In this article, we will look at building a sample e-purse application using one of the CryptoMemory devices. Our requirements are for a low-cost, stored value card capable of interfacing with two separate applications (i.e., laundry and parking). Each application has a maximum stored value of $64, and $0.25 is the minimum unit size for any transaction. Both applications should be able to independently debit and reload the card without risk of mixing funds between the two stored values on the card. For this example, we will select the AT88SC0104C device, offering 1 Kbits of EEPROM memory divided into four equal zones. This is the smallest and most cost-effective device in the CryptoMemory family, offering the same security features as even the largest device of 256 Kbits in the family.

Mapping the Device Memory

The AT88SC0104C has four separate user zones that may be used to store different types of data and may be set up with different security access rights. To establish a stored value card supporting two separate and independent applications (laundry and parking), we will assign two user zones to each application. For each application, we will utilize one zone to store the current value and one zone to record a history of most recent transactions.

Define the Data Format

Within the Value and History Zones, we need to define a data format to be used by each application. The actual type of data stored and its format may be different for the laundry and parking applications, but for this example we will use the same. The 32 bytes of the Value Zones will be defined as a 256-bit value counter. The 32 bytes of the History Zones will be defined as eight historical records consisting of date and value information.

256-bit value counter – to store the value for each application, one bit in the Value Zone will be defined to equal $0.25 when it is set to a logic 1. The maximum value that may be loaded on the card for either application is $64 when the entire zone is written to 1s.

Date – Sixteen bits will be used to express the date of each historical transaction. Three bits will be used to indicate the year (0-15), nine bits to indicate the day within the year (0-365) and four bits indicate the transaction within the day (0-15).

www.atmel.com

page 37

 

A T M E L A P P L I C A T I O N S J O U R N A L

Atmel devices power “smart cards” that streamline transactions for vendors in a variety of previously coin-operated businesses.

Value – Sixteen bits will be used to express the value after each transaction for each historical entry. Nine bits will indicate the value (up to 256 units), one bit will indicate the type of transaction that was performed (debit or credit), and six bits will be used to indicate the merchant or location of the transaction.

Security Needs

In this example, we are creating a reloadable card where many merchants will be able to deduct value from the card and limited trusted locations will be authorized to increase the card value. To protect against fraud at the debit locations, it is important that separate security keys protect the debit and credit operations. CryptoMemory provides for protecting both operations with mutual authentication using two separate 64-bit keys for the debit and credit operations. A crypto algorithm is built into CryptoMemory for performing this task on chip. Keys are stored and protected on CryptoMemory, providing a higher level of security than schemes where memory devices with no computational power are used. Selecting the dual access mode of authentication protection for the Value Zones will allow for separate debit and credit operations with separate keys. With one key the merchant is allowed only to change 1s to 0s in the Value Zone to reduce the value on the card. If a dishonest merchant attempts to add value to a card, CryptoMemory will not allow it. With a separate key, the trusted location will be allowed to write 1s into the Value Zone to increase the card value after receiving proper payment from the user. The trusted location may also write 0s into the Value Zone if the user wishes to surrender his card for the remaining cash value. In addition to protecting access to the Value Zones with mutual authentication, the data exchanged between the debit or credit locations and the CryptoMemory device is

encrypted, and message authentication codes (MACs) are used to further validate each read or write operation. Atmel’s CryptoMemory Evaluation Kit (AT88SC25616C-EK) may be used to explore these security options as well as program sample cards for the development phase of any new application. Figure 2 shows the various security options available for any User Zone. For User Zone 0, which is our laundry value zone, authentication key 0 is selected for full access and authentication key 1 is selected for program only access (writing 1s to 0s for the debit operation).

With the selections we made for the Laundry Value Zone (User Zone 0), the Access Register = $C7 and Password Register = $1F. These are the actual

values that will be written into the Configuration Zone of the CryptoMemory device to activate the selected security options. For the Parking Value Zone (User Zone 2), we will select authentication key 2 for full access and key 3 for program only access. The Zone 2 Access Register = $C7 and Password Register = $BF. The Value Zones determine the actual values stored in the card, and the History Zones are used to keep a historical record of recent transactions. Both debit and credit locations will need access to the History Zones to read historical data and update with the most recent transaction. A simple password could be selected for protection of the History Zones, but with CryptoMemory a higher level of security is

Figure 2: Security Selections

www.atmel.com

page 38

 

Соседние файлы в предмете Электротехника