MULTI-PURPOSE TRANSACTION CARD SYSTEM

Abstract: Disclosed is a multi-purpose transaction card system comprising an issuer (101), one or more cards (102), one or more terminals (103), and optionally one or more acquirers (104), communicating using a variety of cryptographic confidentiality and authentication methods. Cards authenticate messages using public-key based cryptographic without themselves performing the extensive computations usually associated with such cryptography. Integrity of complex transaction sequences and plural card storage updates are maintained, even under intentionally generated interruptions and/or modifications of data transmitted between card and terminal. Cards do not reveal any information to the terminal which is not directly necessary for the transaction or any information to which the terminal should not have access, through externally measureable aspects of its behaviour. Transaction types supported include those suitable for off-line credit cards, in which the "open to buy" is maintained on the card.

Description: MULTI-PURPOSE TRANSACTION CARD SYSTEM BACKGROUND OF THE INVENTION 1. FIELD OF THE INVENTION ι This invention relates to transaction systems, and more specifically to secure trans- 2 action systems involving tamper-resistant devices. 2. DESCRIPTION OF PRIOR ART. 3 Reference is hereby made to P C T. publication WO 89/08957, E.P.O. filing 4 89905483.7, and U.S. patent 4,987,593 filed 3/16/88, titled "One-Show Blind Signature s Systems" by Chaum, which are incorporated herein by reference. Reference is also hereby β made to E.P.O. filing 90200207.0 and U.S. patent 5, 131,039 filed 1/29/90, titled ? "Optionally moderated transaction systems" by Chaum, which are incoφorated herein by β reference. Reference is also hereby made to U.S. patent 4,914,698 filed Jul. 24, 1989, titled s "One-show blind signature systems" by Chaum and to U.S. patent 5,276,736, filed Jul 13, ιo 1992, titled "Optionally moderated transaction systems" by Chaum, which are incoφorated ii herein by reference. 12 A basic technique for "endorsing" a public key digital signature was disclosed in the 13 first above included reference and a related paper presented at Crypto '88. This technique I* was used in the second above included reference and also in other subsequent publications, is such as, for example, U.S. Patent 5,016,274 by Micali et al. related to a paper presented at iβ Crypto '89 and CWI technical Report CS-R9035. — 2 — ι Endorsement schemes are simply one-time signature schemes where the 2 authentication of the public key that is always needed in one time signature schemes is done 3 using the very well know technique of a public key certificate. 4 Three efficiency improvements for the endorsement function, compared to that first s disclosed in the first above included reference, are known in the prior art. The first two β pertain to one-time signature schemes and the third improves the true public key digital 7 signatures. β The first two improvements were made in the context ofthe well-know original one- β time signatures called "Lamport" signatures that are disclosed and attributed to Lamport in to "New directions in cryptography," IEEE Transaction on Information Theory, pp. 644, 654, ii 1976, and are also subsequently described by Lamport in SRI technical report CSL 98. 12 Lamport signatures simply authenticate, as a public key, the output of a public one-way 13 function on a list of secret values; later release of a subset ofthe secret values allows i4 anyone to confirm both that they correspond to the authenticated list and the message is signed by being encoded in the choice of subset. 16 The first improvement is believed disclosed at least in IBM Technical Disclosure 17 Bulletin, vol. 28, no. 2, July 1985, pp. 603-604, titled "Matrix digital signature for use with ιβ the data encryption algorithm" and in the Proceedings of Crypto '87 by Merkle in the is context of Lamport signatures and was subsequently incoφorated in the second above 20 included reference by Chaum. This first improvement reduces the size ofthe original list of 21 secret inputs to the one-way function. Instead of simply basing the signature on single 22 independent applications of one-way functions, the functions are composed or "chained" so 23 that the output ofthe previous function application in the chain serves as the input ofthe 24 next function application. Each chain can be thought of as representing one digit ofthe 25 numeric message signed by the one-time scheme. The radix is one plus the length ofthe 26 chain, with the original Lamport signatures having radix 2. This first improvement results in 27 economy of storage and transmission, at the expense of an increase in computation. 2β The second efficiency improvement was also disclosed by Merkle, as cited above. It 29 applies techniques, believed known in the coding art, that reduce the number of "control" 30 digits needed. These digits prevent a signature from being changed into a signature on a 31 different message. The previous disclosures cited used one control digit per message digit, 32 with the control digit representing the additive inverse ofthe message digit. The 33 improvement works essentially by having only a few control digits that represent the ι additive inverse ofthe sum ofthe message digits. Accordingly, the number of control digits 2 is reduced from being linear in the number of message digits to being only logarithmic. 3 The third improvement applies to certain public key digital signature schemes. It was 4 disclosed first in U.S. Patent 4,949,380, in a paper presented at Crypto '89, PCT s publication US89/04662, and EPO application 89912051.3, all substantially the same and β all by Chaum. This improvement allows plural public key signatures to be "intermingled" in 7 the space taken by one, so long as they are made with coprime public exponents. They can β be signed in the intermingled form, stored in that form, and later separated for showing. This technique also gives economy of storage (and communication), although potentially at ιo the expense of extra computation. i One commercially interesting use of endorsement schemes appears to be in the area 12 of "prepaid cards." 13 A prepaid smart card contains stored value which the person holding it can spend at 14 retail points of payment. After accepting stored value from cards, retailers are periodically is reimbursed with actual money by system providers. A system provider receives money in ιβ advance from people and stores corresponding value onto their cards. During each of these i7 three kinds of transactions, secured data representing value is exchanged for actual money ιβ or for goods and services. Telephone cards used in France and elsewhere are probably the i9 best known prepaid smart cards (though some phone cards use optical or magnetic 20 techniques). National prepaid systems today typically aim to combine public telephones, 21 merchants, vending, and public transportation. Automatic collection of road tolls may also 22 be included soon. 23 Growth in the prepaid smart card market appears to be rapid. For instance, at the 24 time of this application it is believed that national prepaid chipcard schemes are rolling out 25 in Denmark, under construction in Portugal, and planned in Belgium, Spain, and France. 26 The MAC network, believed the largest ATM network in the United States, has announced 27 its entry, and systems are apparently already operational in South Africa and Switzerland. 2β In schemes based solely on conventional cryptography used by cards, secured 2β modules (sometimes called SAM's) are needed at every point of payment. The reason is so that transactions are consummated without communication with external sites, to keep si transaction costs commensurate with the low- value of payments, and that conventional 32 cryptographic authentication requires the communicants to share a common secret. Each is secure module is believed to require the ability to develop secret keys of all cards, which ι gives some problems. If the cards of multiple system providers are to be accepted at the 2 same point of payment, all the points of payment must have secured modules containing 3 keys of every provider. This is believed to mean either a mutually trusted module containing the keys of multiple providers, which might be hard to achieve, or one module s per provider, which becomes impractical as the number of providers grows. Furthermore, β in any such system, if a module is penetrated, not only may significant retailer fraud be 7 facilitated, but the entire card base may be compromised. β Endorsement schemes avoid these problems since they do not require such secured 9 modules. Equipment at points of payment needs no secret keys, only public ones, in order ιo to authenticate the endorsements, which act like guaranteed checks filled in with all the ii relevant details. These same endorsements can later be verified by the system provider for 12 reimbursement. (While these systems allow full end-to-end verification, tamper-resistant i3 aggregators can always be used for truncation.) They also allow the cards of any number of i issuers to be accepted at all retailers; retailers cannot cheat issuers, and issuers cannot cheat is each other. 16 The size ofthe chip in the card is of substantial practical importance in such systems. 1 With a given technology, the more storage the more the chips cost to produce and the iβ bigger they are. It is believed that in the industry larger chips are also thought to mean 19 higher card production costs, and less reliable and durable cards. Cards announced so far 20 for such national prepaid systems use only conventional cryptographic authentication and 2i have only about one kilobyte of nonvolatile storage. For endorsement techniques to be 22 competitive, it is believed important that they can be fit into the same chips. Prior art 23 techniques do not allow enough endorsements to be stored in such chips. 24 Furthermore, it is believed that ordinary credit card and/or debit card transactions 25 consummated using a smart card would benefit from the additional security of an off-line 2β public key endorsement of their transaction details. 27 Transaction systems using a tamper-resistant device are well known. Usually the 2β tamper-resistant device has the form of a smart card. Most smart card transaction systems 29 are targeted to financial transactions, but many other transaction such as access control are so in use. In most smart card systems the smart card has one or more secret keys specific to 31 that smart card, while each terminal has one or more 'master keys' in a tamper-resistant 32 device which allow the terminal to derive the secret keys ofthe smart cards. Once both 33 parties in the transaction have a secret key in common, the security and authenticity ofthe ι transaction can be ensured using traditional cryptographic methods. The 'master keys' in 2 the terminal are a weak point in these systems, as any attack which succeeds in getting 3 these keys out of a terminal leads to a catastrophic breakdown ofthe security. Methods of 4 solving this problem usually involve the application of some kind of public key 5 cryptography. Using smart cards with a public key cryptographic capability is one solution, β but such smart cards are more expensive than simple ones. During a transaction a smart card will typically update one or more locations in non- β volatile memory, which could for example consist of EEPROM. Present smart cards are 9 sometimes vulnerable to interruptions during the update which leads to security and ιo reliability problems. Any faults in the non-volatile memory often lead to wrongful ii transaction processing. Another weakness of smart cards using EEPROM memory is an 2 attack in which the smart card is irradiated using ultraviolet (UV) light. It is known that this 13 influences the data stored in the EEPROM, and might thus be used to attack the security of 14 the system. Some types of transactions require several items in non-volatile memory to be is modified simultaneously, a requirement which is not supported in current smart cards. 16 The different actions which make up a transaction are mostly not bound together by 17 cryptographic means, making it harder to provide adequate security for complex ιβ transactions and often necessitating the use of specialized actions. Financial transaction 1 system smart cards which are used for payment puφoses typically subtract the amount of 20 the payment from the internally held balance before giving out the cryptographic proof to 21 the terminal that the payment has been made. Any interruption in the time between this 22 update and the sending ofthe proof can lead to a loss of money, unless special recovery 23 procedures are used. 2 Most smart cards willingly reveal a lot of information, often including a unique card 25 identity number, directory structure etc. Although this information is usually not directly 2β relevant to the security ofthe application, it can provide additional information to the 27 terminal which might be used to invade the privacy ofthe owner ofthe smart card. 2β The tamper resistance of smart cards is typically used to allow the smart card to 29 execute processes using some secret information (e.g. secret cryptographic keys), and care so is taken in the design of transaction systems that the smart card does not reveal any ofthe 31 secret information to the terminal. However, a terminal might perform many more 32 measurements then just looking at the data that is sent by the card; it is our belief that many 33 existing systems are vulnerable to an attack which uses these additional measurements. ι The recently published specifications for the EMV system "Integrated Circuit Card ∑ Specifications for Payment Systems: Part l, Electromechanical Characteristics, Logical 3 Interface, and Transmission Protocols, version 1.1, Part 2, Data Elements and Commands, version 1. _, and Part 3, Transaction Processing, version 1.0" all dated October 31, 1994 by s Europay International S.A., MasterCard International Incoφorated, and Visa International β Service Association define a system designed for credit card applications. They allow off- line processing of some credit card transactions The specifications seem to envision a β setting where the terminal does not have access to any secret keys, the specified off-line transactions do not include any means for the terminal to verify the authenticity of the card ιo and the transaction data in this setting. Furthermore, the specifications seem not to take full ii advantage ofthe capabilities of a smart card The EMV specifications are envisioned to be 12 used for several types of financial transactions, including credit card payments, direct i3 debiting ofthe user's account, pre-paid payments where the money resides in the card etc. 14 The specifications do not address the underlying similarity in structure for all of these is applications. 16 For some types of transactions, and specifically for financial ones, there is also a 17 clearing process. In this process the terminals send information regarding the money they ιβ collected to the acquirer and/or issuer. Current systems rely on either having the terminal i9 forward full transaction information to the acquirer, or having a tamper-resistant device 2o (often called SAM) in the terminal to do the truncation: the SAM accepts the transaction 2i data, verifies them, and keeps track ofthe necessary totals. This allows some or all ofthe 22 transaction data to be discarded, the necessary clearing information is forwarded by the 23 SAM to the acquirer and/or issuer and authenticated using some cryptographic scheme. 2 Forwarding all transaction information can be expensive and cumbersome, while having 25 SAMs in terminals can be expensive. When a single terminal has to deal with many different 2β issuers acquirers, the terminal either needs separate SAMs for each ofthe issuers/acquirers, 27 which is expensive, or a single SAM which is trusted by all the issuers/acquirers, which 2β leads to organizational difficulties. OBJECTS OF THE INVENTION 2β Accordingly, it is an object of the present invention to: so provide a secure, flexible, efficient and reliable multi-puφose transaction system; ι provide a secure and efficient authentication capability for smart cards, which does 2 not rely on a capability ofthe smart card to performing public key cryptographic 3 computations in an adequate fashion; 4 provide a secure atomic update ofthe non-volatile memory in smart cards for one or 5 more modifications to the data in the memory, even under arbitrary interruptions and some β physical attacks; provide proper cryptographic proofs and verifications that the different actions that β make up a transaction are kept together and executed in order; g prevent the smart card from revealing any information to terminals that do not have ιo access to the appropriate keys; ii prevent the smart card from revealing any information in addition to the information 12 communicated as part ofthe transaction, through any external behaviour; 13 provide clearing methods and systems that do not communicate all the transaction 14 data, without the use of one or more tamper-resistant devices in the terminal; is protect the terminals interest in off-line EMV transactions by adding a public key ιβ based digital authentication to the transaction; 1 provide a general transaction structure that can be used for credit card transactions, is pre-paid transactions, direct debit transactions etc.; and 19 allow efficient, economical, and practical apparatus and methods fulfilling the other 20 objects ofthe invention. 21 Other objects, features, and advantages ofthe present invention will be appreciated 22 when the present description and appended claims are read in conjunction with the drawing 23 figures. BRIEF DESCRIPTION OF THE DRAWING FIGURES 24 It will be appreciated that the figures 39, 42, 43, 44, 45 and 46 are part ofthe 25 description of a first preferred embodiment and that all other figures are pan ofthe 26 description of a second preferred embodiment. 27 28 Fig. I shows a combination block and functional diagram of a preferred embodiment 2 of a multi-puφose transaction card system involving four groupings of parties, in 30 accordance with the teachings ofthe present invention; Fig. 2 shows a combination block and unctional diagram of a one time signature 2 structure called a house, in accordance with the teachings ofthe present invention; 3 Fig. 3 shows a combination block and functional diagram of a first preferred compact 4 endorsement signature structure called a town, in accordance with the teachings ofthe 5 present invention; β Fig. 4 shows a combination block and functional diagram of a second preferred compact endorsement signature structure called a town, in accordance with the teachings β ofthe present invention, which is believed to allow an efficient implementation; 9 Fig. 5 shows a combination block and functional diagram of a preferred exemplary ιo embodiment of a compact endorsement signature structure called a town, in accordance ii with the teachings ofthe present invention; i2 Fig. 6 is a block diagram showing exemplary data elements and control elements that 13 are signed using a one time signature structure of Fig. 2, in accordance with the teachings 14 ofthe present invention, in a way which is believed to enhance security; is Fig. 7 shows a combination block and functional diagram of a public key verifying i6 party, in accordance with the teachings ofthe present invention; 1 Fig. 8 shows a flowchart of a preferred embodiment of a card cancel process in is accordance with the teachings ofthe present invention, which, together with Fig. 13, 14, i9 15, 16, 17, 18 and 19 is believed to implement a secure data storage system of said card, 20 and which, in particular, when executed at the end of a session is believed to rollback all the 21 results on the card non-volatile memory of said session; 22 Fig. 9 shows a combination block and functional diagram of a preferred exemplary 23 embodiment of a one time signature structure called a house in accordance with the 2 teachings ofthe present invention; 25 Fig. 10 shows a combination block and functional diagram of a public key issuing 2β party, in accordance with the teachings of the present invention; 27 Fig. 1 1 shows a block and functional diagram of a non-volatile memory model in 2β accordance with the teachings ofthe present invention, which is believed to describe the 29 write and erase behaviour of most types of non-volatile memory used in the art, in so particular the write and erase behaviour of EEPROM; 3i Fig. 12 is a block diagram showing the use of volatile and non-volatile memory in a 32 prefeσed embodiment of a card in accordance with the teachings ofthe present invention; ι Fig. 13 shows a flowchart of a prefeσed embodiment of a card start update process, 2 in accordance with the teachings ofthe present invention, which, together with Fig. 8, 14, 3 15, 16, 17, 18 and 19 is believed to implement a secure data storage system of said card; Fig. 14 shows a flowchart of a prefeσed embodiment of a card delete framefi] 5 process in accordance with the teachings ofthe present invention, which, together with Fig β 8, 13, 15, 16, 17, 18 and 19 is believed to implement a secure data storage system of said 7 card; β Fig. 15 shows a flowchart of a prefeσed embodiment of a card write frame[t,access,data] process in accordance with the teachings ofthe present invention, ιo which, together with Fig. 8, 13, 14, 16, 17, 18 and 19 is believed to implement a secure ii data storage system of said card; 12 Fig. 16 shows a flowchart of a prefeσed embodiment of a card reset process in is accordance with the teachings ofthe present invention, which, together with Fig. 8, 13, 14, 1 15, 17, 18 and 19 is believed to implement a secure data storage system of said card; is Fig. 17 shows a flowchart of a prefeσed embodiment of a card commit process in 16 accordance with the teachings ofthe present invention, which, together with Fig. 8, 13, 14, 17 15, 16, 18 and 19 is believed to implement a secure data storage system of said card; ιβ Fig. 18 shows a flowchart of a prefeσed embodiment of a card find frame[t] process i9 in accordance with the teachings ofthe present invention, which, together with Fig. 8, 13, 20 14, 15, 16, 17, and 19 is believed to implement a secure data storage system of said card; 21 Fig. 19 shows a flowchart of a prefeσed embodiment of a card read frameft] process 22 in accordance with the teachings ofthe present invention, which, together with Fig. 8, 13, 23 14, 15, 16, 17, and 18 is believed to implement a secure data storage system of said card; 24 Fig. 20 is a combination block and functional diagram showing mechanisms of 2s encrypting data with a session-state and chaining data in said session-state chain and 26 decrypting data with said session-state and chaining data in said session-state, in 2 accordance with the teachings ofthe present invention; 2β Fig. 21 is a combination block and functional diagram showing the mechanism of 29 'crypting' data with a session-state and chaining data in said session-state as performed in 30 the prefeσed embodiment of a card, and the mechanism of 'crypting' data with said 31 session-state and chaining data in said session-state as performed in the prefeσed 32 embodiment of a terminal, in accordance with the teachings ofthe present invention, which 33 are believed to implement an encrypt decrypt pair, as shown in Fig. 20, ι Fig. 22 is a combination block and functional diagram showing a prefeσed exemplary 2 implementation of a mechanism of 'crypting' data with a session-state and chaining data in 3 said session-state as performed in a prefeσed embodiment of a card, in accordance with the teachings ofthe present invention, which, together with the mechanism showed in Fig. 23, s are believed to implement the mechanisms as shown in Fig. 21 ; β Fig. 23 is a combination block and functional diagram showing a prefeσed exemplary 7 implementation ofthe mechanism of 'crypting' data with a session-state and chaining data β in said session-state as performed in a prefeσed embodiment of a terminal, in accordance 9 with the teachings ofthe present invention, which, together with the mechanism showed in ιo Fig. 22, are believed to implement the mechanisms as shown in Fig. 21 ; ii Fig. 24 shows a flowchart of a process called 'session' which involves a card and a 12 terminal in a prefeσed embodiment, in accordance with the teachings ofthe present 13 invention; 14 Fig. 25 shows a flowchart of a detail process called 'start session and proof keys', is involving actions by a terminal, actions by a card and communication between said card and ιβ said terminal, in accordance with the teachings ofthe present invention, which, together i with Fig. 26 and 27 are believed to implement the process of Fig. 24; is Fig. 26 shows a flowchart of a detail process called 'command and exchange data', i9 involving actions by a terminal, actions by a card and communication between said card and 20 said terminal, in accordance with the teachings ofthe present invention, which, together 21 with Fig. 26 and 27 are believed to implement the process of Fig. 24; 22 Fig. 27 shows a flowchart of a detail process called 'commit session and end session', 23 involving actions by a terminal, actions by a card and communication between said card and 2 said terminal, in accordance with the teachings ofthe present invention, which, together 25 with Fig. 26 and 27 is believed to implement the process of Fig. 24, 2β Fig. 28 shows a flowchart of an EMV transaction process, involving actions by a 27 terminal, actions by a card, actions by an issuer and communication between said card and 2β said terminal and between said terminal and said issuer in a prefeσed embodiment, in 2 accordance with the teachings ofthe present invention; so Fig. 29 is a flowchart showing all possible successful executable series of commands, 3 issued by a terminal and performed by a card in a preferred embodiment, in accordance 2 with the teachings ofthe present invention; ι Fig. 30 shows a flowchart of a Commit-Challenge-Response process involving 2 actions by a terminal, actions by a card and communication between said card and said 3 terminal, in accordance with the teachings ofthe present invention; 4 Fig. 31 shows a flowchart of a non single execution path process and a single execu- 5 tion path process, both assigning values to variables depending on a conditional in β accordance with the teachings ofthe present invention, which are believed to have the same 7 result on the assigned variables; β Fig. 32 shows a flowchart of a 'Get Proof process in a prefeσed embodiment, 9 involving actions by a terminal, actions by a card and communication between said card and ιo said terminal, in accordance with the teachings ofthe present invention; i Fig. 33 shows a flowchart of a process of performing a 'script' in a prefeσed embodi- 12 ment, involving actions by a terminal, actions by a card and communication between said is card and said terminal, in accordance with the teachings ofthe present invention; 14 Fig. 34 shows five detail flowcharts of processes called 'start session 1 ', 'start session is 2', 'get frame', 'put frame' and 'kill frame' in a prefeσed embodiment, involving actions by 16 a terminal, actions by a card and communication between said card and said terminal, in 1 accordance with the teachings ofthe present invention in accordance with the teachings of ιβ the present invention; 1 Fig. 35 shows five detail flowcharts of processes called 'debit frame', 'redebit frame', 20 'public debit', 'commit' and 'done' in a prefeσed embodiment, involving actions by a 21 terminal, actions by a card and communication between said card and said terminal, in 22 accordance with the teachings ofthe present invention in accordance with the teachings of 23 the present invention; 24 Fig. 36 shows five detail flowcharts of processes called 'get proof, 'select file " , 25 'manage application 1 ', 'manage application 2' and 'get data' in a prefeσed embodiment, 2β involving actions by a terminal, actions by a card and communication between said card and 27 said terminal, in accordance with the teachings of the present invention in accordance with 2β the teachings of the present invention; 29 Fig. 37 shows five detail flowcharts of processes called 'get file', 'generate AC 1 ', so 'generate AC 2', 'external authenticate' and 'verify' in a prefeσed embodiment, involving 31 actions by a terminal, actions by a card and communication between said card and said 32 terminal, in accordance with the teachings ofthe present invention in accordance with the 33 teachings ofthe present invention; — 12 — ι Fig. 38 shows a detail flowchart of a process called 'get last AC in a prefeσed 2 embodiment, involving actions by a terminal, actions by a card and communication between 3 said card and said terminal, in accordance with the teachings of the present invention in accordance with the teachings of the present invention; s Fig. 39 shows a combination block and functional diagram of a prefeσed embodiment β of a compact endorsement signature system involving four sets of parties in accordance 7 with the teachings ofthe present invention; β Fig. 40 shows the non-volatile memory contents in accordance with the teachings of 9 the present invention ofthe prefeσed exemplary compact endorsement signature structure ιo of Fig. 5 by means of a tabular aσangement of town values, notations and actions; ii Fig. 41 shows the operational steps in accordance with the teachings ofthe present 12 invention ofthe preferred exemplary compact endorsement signature structure of Fig. 5 by 13 means of a tabular aσangement of town values, notations and actions; 1 Fig. 42 shows a combination block and functional diagram of an exemplary embodi- ιs ment of an endorser party in accordance with the teachings ofthe present invention; i6 Fig. 43 shows a flowchart of a general endorsement scheme process in accordance 17 with the teachings ofthe present invention; iβ Fig. 44 shows an exemplary one-time signature structure in accordance with the 19 teachings ofthe present invention; 20 Fig. 45 shows a prefeσed exemplary endorsement structure in accordance with the 21 teachings ofthe present invention, in which Fig. 45a-45d are exemplary first level cascade 22 structures and Fig. 45e is an exemplary second level cascade structure; 23 Fig. 46 shows the operational steps in accordance with the teachings ofthe present 24 invention ofthe exemplary structures of Fig. 45 by means of a tabular aσangement of 25 registers names and notations; 2β Fig. 47 shows a combination block and functional diagram of the interaction between 27 a card and the issuer in the prefeσed embodiment of a system like Fig. 1, with details added 2β to card entity concerning some registers, and details added to the issuer entity concerning 29 maintained databases in accordance with the teachings ofthe present invention; 30 Fig. 48 shows a block diagram of a prefeσed embodiment of a record in a card 3i database of Fig 47 in accordance with the teachings ofthe present invention; 32 Fig. 49 shows a block diagram of a prefeσed embodiment of a record in a event 33 database of Fig 47 in accordance with the teachings ofthe present invention; ι Fig. 50 shows a flowchart of a prefeσed embodiment of a issuer process that mainly 2 synchronizes the issuers known balance with a card balance during an on-line transaction, 3 in accordance with the teachings ofthe present invention; 4 Fig. 51 shows a flowchart of a prefeσed embodiment of a issuer process that mainly s synchronizes the issuers known balance with a card balance during the clearing process of β off-line transactions, in accordance with the teachings ofthe present invention; 7 Fig. 52 shows a flowchart of an exemplary implementation ofthe process Fig 50, in β accordance with the teaching ofthe present invention; and 9 Fig. 53 shows a flowchart of an exemplary implementation ofthe process Fig. 51, in ιo accordance with the teaching ofthe present invention. BRIEF SUMMARY OF THE INVENTION ii In accordance with the forgoing and other objects ofthe present invention, a brief 12 summary of some exemplary embodiments will now be presented. Some simplifications and 13 omissions may be made in this summary, which is intended to highlight and introduce some ι« aspects ofthe present invention, but not to limit its scope in any way. Detailed descriptions is of prefeσed exemplary embodiments adequate to allow those of ordinary skill in the art to ιβ make and use the inventive concepts are provided later. 17 An endorsement scheme that allows preferably hundreds of endorsements to be is stored in less than a thousand bytes on a simple microcontroller smart card would be i commercially interesting, but cannot be achieved by techniques known in the prior art. The 20 present invention overcomes these limitations ofthe prior art. 2i The inventive concept provides hierarchical structuring of multiple one-time 22 signatures within a single public key signature. The hierarchy is formed from compressing 23 one-way functions, also sometimes known as hash or message digest functions, serving as 24 the internal "nodes" in a special tree structure. The tree's "leaves" are the one-time 25 signatures and its "edges" are values that are inputs and sometimes outputs of the 26 compression functions. Thus the root represents the final compression of all the one-time 2 signatures in the structure, and the output of this compression is signed by the digital 2β signature technique. 2β Each endorsement involves a subset ofthe tree including the single one-time so signature that is used in, and only in, that endorsement. Also in the subset is the public key ι signature and a path of edges from the leaf to the root The values represented by all edges 2 incident on the nodes ofthe path, apart from those edges on the path, are included. 3 The endorsements are made in an order that, in cooperation with the structuring, lets 4 the card use a relatively small number of non-volatile registers at each stage. Furthermore, s the amount of computation required between each endorsement is also limited to a small β amount. Moreover, stepping from the last one-time signature in one digital signature to the 7 first ofthe next digital signature requires essentially only the same resources as stepping β between any two one-time signatures within the same digital signature. 9 One ofthe particular prefeσed embodiments, which is disclosed in detail later, uses a ιo "cascade" of two-argument compressing functions as a building block The first ii compressing function in the cascade takes two inputs from outside the cascade. All i2 subsequent compresses in the cascade take one argument from the previous compress and 13 one from outside the cascade. Thus, with only an output of one compress in a cascade 14 along with all subsequent inputs to the cascade, the output of the entire cascade can be is verified. iβ The cascades are structured into a low hierarchy, preferably only two high, although 17 any hierarchy could be used. The cascades at the low level, called "streets," take their iβ inputs directly from one-time signatures, called "houses." The cascades at the higher level, i9 called "towns," take their inputs from the outputs ofthe cascades at the lower level. Thus, 20 a complete ordering is imposed on the houses of a street and the streets of a town. 21 Roughly stated, in the prefeσed embodiment, the endorsements may be thought of as 2 proceeding from house to house in order. When a house is visited, its one-time signature is 23 used in an endorsement. In addition to this "actual" traversal for endorsements, there are 2 two "preparatory" traversals conducted in parallel. 2s The first preparatory traversal moves down the next street visiting almost all the 2β houses. (If there is a next street in the cuσent town ordering, this is traversed; if there are 27 no more streets in the cuσent town, then the first street in the next town is traversed). The 2β puφose ofthe first preparatory traversal is to obtain and store the leaf edges for a street so 29 that they are ready when that street is entered and the first house is used in an endorsement. ao The second preparatory traversal moves through the next town. The puφose of this 31 traversal is to obtain and store the edges coming from all the streets ofthe next town, 2 except the first street. These will be needed in endorsements when the new town is initially 33 entered by the actual traversal and endorsements are coming from its first street. ι Tamper resistant devices often store some information in non-volatile memory The 2 prefeσed embodiment is capable of atomic multi-updates allowing several modifications in 3 the non-volatile memory to be done all at once, even under arbitrary interruptions Secrecy 4 of critical data is maintained under attacks involving UV iσadiation ofthe smart card chip, 5 while at the same time allowing recovery in the case of technical failures. β Sessions are introduced which cryptographically link the actions that make up a transaction, ensuring that the constituent actions are all performed in order and without any β other actions in-between. The sessions also provide a single proof system for an entire transaction, eliminating the need for specialized elementary actions for specific transactions. ιo Even under arbitrary interruption the sessions ensure that either the transaction is ii completed and the cryptographic proofs exchanged properly, or the transaction is not 12 executed at all. 13 In the prefeσed embodiment the tamper-resistant device does not reveal any informa- 14 tion to the terminal in addition to the information explicitly communicated with the is terminal, even if the terminal performs any or all of a general set of additional iβ measurements on the card while it is in operation. 17 Several clearing methods are described which allow adequate clearing and settlement is of financial and other transactions to occur without the need for a tamper-resistant device i in the terminal or the need to communicate full transaction data form the terminal to the 20 acquirer/issuer. 2 The EMV system is extended and generalized. The terminal's interests are properly 22 protected by including a proper off-line authentication ofthe transaction data. The EMV 23 system is generalized to provide all the functions needed for implementation of a wide 24 variety of payment applications. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 25 The drawing figures and the detailed descriptions provided later make a number of 2β simplifying assumptions for concreteness and for clarity in exposition. It will be 27 appreciated, however, that these should not be taken to limit the scope of the invention. 28 Some lines and aσows in the drawing figures represent messages, which may be held 29 initially or delayed on their way, passed through various parties, encoded and decoded so cryptographically or otherwise to provide their authenticity and or secrecy and/or eσor 31 detection and/or eσor recovery. Thus the particular means or methods whereby messages ι are transferred are not essential to the present invention, and it is anticipated that any 2 technique may be employed in this regard. 3 As will be appreciated, someone of ordinary skill in the art would be familiar with 4 Bruce Schneier 1994 "Applied Cryptography, Protocols, Algorithms, and Source Code in 5 C" and with the references contained therein. As will also be appreciated, someone of β ordinary skill in the art would be familiar with Donald E. Knuth 1981, "The art of computer 7 programming" parts 1 "Fundamental algorithms" and 2 "Seminumerical algorithms", and β with the references contained therein. 9 Some background on the parameter values that are believed to apply, as will be ιo appreciated, serves as a basis for some ofthe tradeoffs made in the prefeσed embodiment. ii A typical user transaction should, it is believed, not introduce more than roughly a i2 second of delay if it is to be perceived as acceptably fast. Of course, highway-speed road 13 tolls, and even mass transit situations, may require substantially faster transactions. The i4 endorsement signatures are well suited to such high-speed transaction, as has been is illustrated in the second above included reference. iβ An RSA signature today is minimally 64 bytes. Other digital signatures might be one 17 third the size. The output of a compressing one-way or hash function is typically 16 bytes, iβ A one-way function input or output can typically be 8 bytes. A smart card of one kilobyte i9 non-volatile memory, already mentioned as a cuσently commercially interesting target for 20 the invention, typically has various competing uses for its non-volatile storage. It is 21 believed that less than the whole amount would be available for storage of signatures and 22 other values needed in endorsement. Examples include identification data related to 23 manufacturing and distribution, cryptographic keys for securing communication with an 2 issuer, registers to hold card balance(s), transaction records, public key certificates ofthe 25 issuer, key validity data, and so forth. 26 A blockcipher operation that might typically be used in constructing a one-way 2 function can, it is believed, typically be done by a smart-card microcontroller between 100 2β and 400 times per second, depending on a variety of factors. At least several applications of 29 such a blockcipher are anticipated to be required to implement a hash or compression 30 function. A reading device can use special circuitry to compute blockciphers, it is believed, 31 about two orders of magnitude faster. ι Transmission of data between a smart card and the reading device is believed 2 typically to be at about 1000 bytes per second, but can be sped up by at least a factor of 4 3 under some standard protocols. 4 Some general notions regarding cryptographic techniques will now be presented. 5 Assigning a variable a "random" value performs the function of creating a value that e should not be readily determined by at least some party. Many means and methods are 7 known in the art for generating such unpredictable quantities, often called keys. Some are β based on physical phenomena, such as noise in semiconductors, or patterns detected in 9 humans pushing buttons, or possibly deterministic cryptographic techniques sometimes ιo called pseudorandom generators. It is well known in the art that these various techniques ii can often be combined, and that post-processing can often improve the results. Thus the i2 particular means or methods whereby random values are derived is not essential to the 13 present invention, and it is anticipated that any technique may be employed in this regard. 1 A "compression" function, as has already described, is an example of a technique is very well known in the art as a hash or message digest function. Such a function takes an iβ input larger than its output. It is believed computationally prohibitive, given the output, to 17 find back any input that would yield it, even if some ofthe inputs are known. iβ The term "party" is used herein to indicate an entity with control over at least the 1 secrecy of some information, usually at least one key. It is anticipated that a plurality of 20 people may each know all or in effect part of some key, and they might be thought of 21 collectively as a party. In other cases, a key may be substantially unknown to people, and 22 reside in some physical device, and then the device itself or those who control it from time 23 to time may be regarded as parties. 24 The method or means whereby information is transfeσed between parties is not 25 essential to the present invention, and may be accomplished in any suitable way. For 2β instance, output and input means may be brought into physical proximity with each other, 27 or they may communicate remotely by any kind of communication network or technique. 2β The information may be encoded in various forms, some of them cryptographic, and 2β decoded and transformed between coding on its way. Similarly the information may be 3o stored and/or detained in various forms and by various parties along the way. 3i The choice of party names, forms, and the number of parties are examples of choices 32 made for clarity and convenience. Naturally, the inventive concepts disclosed here should — 18 — ι not be inteφreted as limited to a particular type, grouping, or multiplicity of parties nor 2 should there be any other implications of naming conventions or the like. 3 Turning now to figure 39, general descriptions ofthe interconnections and 4 cooperation of the constituent parts of some exemplary embodiments of the inventive 5 concepts will now be presented, β Signature issuer party 3941, refeσed to for simplicity as the issuer, has at least a 7 private key. A coσesponding public key is made known at least to endorsee 3943 (as will a be more fully described) and to any additional verifiers 394 9 Signature transporter and endorser party 3942, herein refeσed to simply as endorser, ιo receives the signatures from issuer 3941 as shown by line 3951. Endorsee and verifier ii 3943, refeσed to for simplicity as endorsee 3943, receives an endorsement from endorser 12 3942 as indicated by line 3952. Additional verifier 3944 may also verify the endorsement, is shown for simplicity as coming form endorsee over line 3953. 14 As will be appreciated, but is not shown for clarity, there may be plural instances of is each party type. For example, there may be multiple endorsers, each endorsing signatures iβ issued by the same issuer. There may be multiple endorsees, each capable of receiving an 17 endorsement from any one of plural endorsers. There may be multiple additional verifiers, iβ any one of which may be capable of verifying endorsements received from plural endorsees 19 or others. Moreover, there may be plural issuers, some of which are capable of issuing 20 identical signatures as well as others of which that are not. 2i Each signature is related to a message, the origin of which is not essential to the 22 inventive concepts. Messages could, for example, come from the issuer 3941, the endorser 23 3942, endorsee 3943, or verifier 3944, random sources, external events, or combinations of 24 these. Any ofthe aforementioned parties may be aware ofthe message before they 25 cooperate in an endorsement, or one or the other of them may supply all or parts ofthe 2β message to the other, which is not being shown for clarity. 7 Turning now to figure 42, general descriptions of the interconnections and 2β cooperation ofthe constituent parts of some exemplary embodiments of the inventive 29 concepts will now be presented for endorser 3942. ι A smart card 4200 or other portable data carrier, as will be appreciated, may perform 2 the role of endorser 3941. It may be considered to be composed of several interconnected 3 parts. The i o interface 4201 communicates with the outside world, such as issuer 3941 and 4 endorsee 3943 through interface link 4206, which may be galvanic contacts or contactless 5 technology, as are well known in the smart card art. Also there may be special circuits or β firmware for computing cryptographic functions 4204. Furthermore, control means 4202 7 manages the operation and coordination of the other parts. Most important for the present β puφoses are registers 4203 for storing values. These may be regarded as of two types, nonvolatile and temporary. All these components may cooperate together and/or with the ιo i/o interface 4201, through mutual interconnection means shown for simplicity as bus 4205. ii An example embodiment would be in the Motorola SC-24 smart card chip, or near 12 equivalents manufactured by Thompson Semiconductors for instance, and these may be 13 embedded in industry standard smart cards. 14 Turning now to figure 43, general descriptions ofthe function and process steps of is some exemplary embodiments ofthe inventive concepts will now be given, iβ The first step, as shown by flowchart box 4301, is the issuing of a compact endorse- 17 ment signature by the issuer 3941 to the endorser 3942. This entails creating in turn all the iβ houses and the edges. Then a digital signature is formed on the root output as already 1 described. Although not shown explicitly for clarity, it will be understood that blind 20 signature techniques could be used in the issuing process. For instance, it will be readily 21 understood by those of skill in the art, an intermediary party not shown for clarity could 22 form the one-time signatures and compression tree, provide it to a signer in a blinded form, 23 and supply an unblinded form ofthe result to the endorser. Related techniques are also 24 disclosed in the second above included reference. 25 Dashed box 4302 shows the endorse function. One component is box 4321 which 2β forms a one-time signature that coσesponds to the message. This is done by developing 27 each digit to the point in the cascade required to encode the part ofthe message or the 2β control, as is well known in the one-time signature art and as will also be described in more 2β detail with reference to figure 44. This signature is given from the endorser to the endorsee ao 3943 for verification. The transfer of at least the edges needed to verify the signature, as ι already mentioned, is shown in box 4322 The digital signature is also provided from the 2 endorser to the endorsee as shown in box 4323. 3 Dashed box 4303 represents the verification function performed by the endorsee on 4 the compact endorsement signature provided as a result ofthe already mentioned dashed 5 box 4302. First the one-time signature is shown as expanded in box 4331, which would for e instance be the form with the most applications of the one-way function(s) applied. The 7 result of this can then be used together with the edges supplied in box 4322, already β mentioned, to traverse by application of compression function nodes all the way to the 9 root. This results in the value upon which the digital signature mentioned already with ιo reference to box 4321 is checked, as shown in box 4333. The signature need not be the ii type known in the art as that allowing "message recovery," since the edges of the 12 compression tree are provided. Of course if the signature verifies, then the endorsee is accepts it, otherwise not. i4 Dashed box 4304 depicts the preparation process. It may involve substantial is computation between each endorsement, but it may also involve no computation, as iβ indicated by the straight through return path. One aspect of preparation, indicated by box i7 4341, entails evaluating houses. These may for instance, and as already mentioned, be in iβ the next street or town. When houses are fully evaluated the results will serve as input 19 edges to compression nodes, as already mentioned. Box 4342 depicts the compression of 20 edges and the saving in registers ofthe results, which may free up the need to store 2 involved input registers or house outputs. Also as non-volatile storage becomes available to 22 store new values, the old values should be erased or at least written over by the new values, 23 as indicated by box 4343. 24 As would be appreciated by those of ordinary skill in the art, these various 25 preparation steps could be performed at various times and in various orders without 26 departing from the spirit ofthe present invention. For instance, in some settings the 27 preparation may produce exactly what is needed for the next endorsement; in other cases, 2β some preparation for a number of future endorsements may be made whenever there is time 2 to do so. Although such preparation for future endorsements is not shown explicitly for so clarity, it will be understood that employing some extra registers and storing in them the 3i values that would be calculated some steps in advance, allows for such steps to be taken 32 without requiring preparation. ι Preparation may be made just before an endorsement or just after an endorsement or 2 during an endorsement or while the endorser is idle. Another possibility, without 3 attempting to be exhaustive, may occur substantially soon after a signature issuing, or at another time when no preparation is needed and the whole preparation dashed box may be s passed through. β With reference to the above mentioned application of credit/debit card transactions 7 and the like, some novel extensions to the operation shown in figure 43 just described will β now be disclosed that are not shown for clarity but that will be understood by those of skill 9 in the art. ιo Both on-line and off-line transactions are considered here. In a first type of on-line ii transaction, there may be at least a challenge issued on-line to an endorser and a response ii back on-line from the endorser, the concept of such challenge response protocols being s well known in the art. The endorser might typically be a smart card. 14 In a second type of on-line application a transaction may comprise a single message is sent on-line from the terminal receiving the endorsing card and a single coσesponding iβ response received by the terminal on-line from a server. In this second type of transaction, 17 it will be understood by those of skill in the art that the message endorsed should contain a iβ challenge value and that this challenge value is preferably derived from a "challenge seed" 19 substantially at least influenced by a "modifier" sent in the substantially previous on-line 20 transaction. The seed as will be understood, could for instance be essentially a stored value 21 ofthe same type as would be used as a challenge in the first type of application, in which 22 case the modifier would be simply a stored challenge. Or, it could also be a value that is 23 updated in various ways, such as cryptographically, depending on the seed modifιer(s) sent 24 The seed thus allows the terminal to develop a valid challenge that would be unpredictable 25 even to someone with access to the terminal's inner workings. 26 In either type of on-line transaction, the response should depend on the challenge an 27 could be the endorsement as described here. Or the response could be a conventional 2β cryptographic authentication, as are well known in the art, and the full endorsement could 29 be stored at the terminal for later forwarding or audit. so In off-line transactions, a challenge value is believed preferable that is similarly si unpredictable as with an on-line transaction. A terminal that goes on-line sometimes, it will ι be understood, can update its challenge seed at those times and advance its challenge 2 values through a sequence at least depending on this challenge seed. The result, it will be 3 understood, is a sequence of challenge values that is unpredictable at least across on-line 4 transactions. s While it is believed that the notation of figure 44 and figure 45 would be clear to β those of ordinary skill in the art, it is first reviewed here for definiteness. Several symbols are used: circles stand for register values; house shaped blocks to be described with β reference to figure 44 indicate one-time signatures; round-corner rectangles symbolize 9 compression cascades; and diamond boxes are used to represent public key digital ιo signatures. The lines and aσows show the edges that define the flow of outputs to inputs; ii aσows entering or leaving a diagram of course show the inputs or outputs, respectively, of 12 the diagram. 13 The notation of figure 46 is a tabular arrangement of numbers and special symbols, i4 the meaning of which will be described later with reference to that figure. is Turning now to figure 44, a prefeσed embodiment of a one-time signature structure iβ will now be described in detail. i House shaped box 4401 shows the one-time signature itself Its shape is used in iβ figure 45, to be described, as an icon for the one-time signature. The particular dimensional i parameters, 4 inputs and 3 internal stages, are chosen as illustrations for clarity and 20 definiteness, but such choices are not intended to limit possible values or to imply the need 21 for such a rectangular structure. Some embodiments may use smaller parameter values and 22 others larger parameter values such as, for instance, 8 by 8 There are four input values, 23 4471 through 4474. Each input is mapped by a one way function, 4411 * through 4414*, to 24 produce an intermediate value 4411 through 4414, respectively. The next stage uses these 25 values, 4411-4414, as inputs to the one-way functions 4421*-4424*, respectively, whose 2β outputs define values 4421-4424, respectively. The final stage of one-way functions, 27 4431*-4434*, takes the values 4421-4424 as inputs and produces values 4431-4434, 2β respectively. 29 The outputs of the final stage of one-way functions are shown being compressed by a so hierarchy of two-input compressors for definiteness, although any suitable compressing 31 structure might be used. Values 4431 and 4432 are compressed by compressor 4451, ι whose output feeds compressor 4453; values 4433 and 4434 are compressed by 2 compressor 4452, whose output feeds the other input of compressor 4453. The output of 3 compressor 4453 is shown as the final output 4481 ofthe one-time signature. Two types of operations are performed on houses. One operation is computing there 5 output by taking the input values 4471-4474 through the chains of one-way functions and β through the compression hierarchy just described to produce output value 4481. The other operation is forming the one-time signature, as depicted in box 4321 already mentioned. a The message to be signed is taken as a set of digits, as is well known in the art, and the 9 one-way function chain coσesponding to each digit is evaluated to a depth coσesponding ιo to the value of that digit. The output values coσesponding to these one-way functions, one ii per digit, are the one-time signature. 12 Turning now to figure 45, a preferred embodiment of a compact endorsement 13 signature will now be described in detail. The particular dimensional parameters, 4 streets i4 each of 4 houses, has been chosen for clarity in exposition and definiteness, but such is choices are not intended to limit possible parameters or to imply the need for such a regular iβ structure. It is believed, however, that a roughly equal number of streets and houses does 1 represent a good tradeoff. Larger parameter values, such as 8 streets of 8 houses, are iβ believed also be a suitable choice in some circumstances. 19 The two level approach is believed best for the intended use. However, other struc- 20 tures can readily be derived from the inventive concepts disclosed here. Just to give one 21 further exemplary embodiment, although not shown explicitly for clarity, it will be 22 understood by those of skill in the art how a cascade can be split in two by a single 23 compress inserted above it, without changing substantially the computation or register 2 requirements, This would, for instance, allow the number of edges transfeσed to be 25 reduced substantially. 2β Round-corner box al** in figure 45A denotes a part ofthe structure refeσed to 27 again in figure 45e, and may be called a street of 4 houses all* through al4*, having 2β output values all through al4, respectively. Each house stands for a one-time signature, 29 as has already been described with reference to figure 44. Compressor bll* takes its inputs 30 from values all and al2 and produces output value bll. Compressor bl2* takes value si bll and value al3 as inputs and produces output bl2. Similarly compressor al* takes ι value bl2 and al4 as inputs and produces output value to be further described with ∑ reference to figure 45E. 3 In like manner, round-corner box a2** in figure 45B denotes a part ofthe structure 4 refeσed to again in figure 45E, and may be called a street of 4 houses a21* through a24*, s having output values a21 through a24, respectively. Each house stands for a one-time β signature, as has already been described with reference to figure 44. Compressor b21* 7 takes its inputs from values a21 and a22 and produces output value b21. Compressor b22* β takes value b21 and value a23 as inputs and produces output b22 Similarly compressor 9 a2* takes value b22 and a24 as inputs and produces output value to be further described to with reference to figure 45E. ii Again in the same way, round-corner box a3** in figure 45C denotes a part of the i2 structure referred to again in figure 45E, and may be called a street of 4 houses a31* 13 through a34*, having output values a31 through a34, respectively. Each house stands for a i4 one-time signature, as has already been described with reference to figure 44. Compressor is b31* takes its inputs from values a31 and a32 and produces output value b31. Compressor iβ b32* takes value b31 and value a33 as inputs and produces output b32. Similarly 17 compressor a3* takes value b32 and a34 as inputs and produces output value to be further is described with reference to figure 45E. 19 For the final similar street, round-corner box a4** in figure 45D denotes a part ofthe 20 structure referred to again in figure 45E, and may be called a street of 4 houses a41* 21 through a44*, having output values a41 through a44, respectively. Each house stands for a 22 one-time signature, as has already been described with reference to figure 44. Compressor 23 b41* takes its inputs from values a41 and a42 and produces output value b41. Compressor 24 b42* takes value b41 and value a43 as inputs and produces output b42. Similarly 25 compressor a4* takes value b42 and a44 as inputs and produces output value to be further 2β described with reference to figure 45E. 27 In figure 45E, the four round-corner boxes al ** through a4**, with their coσe- 2β sponding output values al through a4, respectively, are shown as inputs to a compression 29 tree. The first compressor bl* takes its input from values al and a2; its output is value bl. so Compressor b2* takes this output bl and combines it with value a3 to produce value b2. 3i In like fashion, compressor b3* transforms this output value b2 and value a4 into output ι b3*. Finally, this output value b3 serves as message input to public key digital signature 2 producer b4* to produce compact endorsement signature b4. 3 Turning now to figure 46, the exemplary inventive structure already described with reference to figure 45 will now be provided with an operational description. s Each row ofthe table shown in figure 46 coσesponds to a single endorsement. The β rows ofthe table are numbered outside the table. Each column in the table coσesponds to preferably nonvolatile register locations used to store values between endorsements. The β caσot symbol ">" marks entries whose value has changed from the last row A dot "." 9 marks the entry whose value is the output ofthe house used in the endorsement ιo coσesponding to that row. ii As will be appreciated, the first 4 columns are for clarity and convenience used to 12 store the street edge values always in their street order positions. Only the part ofthe row 13 from the entry marked by the dot up until and including the fourth column are needed for 4 the cuσent and any subsequent endorsements based on houses from the cuσent street, is except for a single output from any previous endorsement ofthe cuσent street. The entries iβ preceding the one marked by a dot are therefore largely available, are sometimes used to i7 hold intermediate values, and are ultimately prepared with the values that they will need to iβ contain when the next street is entered. 19 The last four entries in each row are used to hold the town edge values needed for 20 the cuσent endorsement. These values, as will be appreciated, are also always stored in 2i order positions. As the streets are traversed, the early town edge values coσesponding to 22 the streets cuσently and previously traversed no longer need to be stored. The entries that 23 they occupied may be used as temporary cells for developing and ultimately holding the 2 town edge values that will be needed when the next town is entered. 2s For clarity in exposition, the town shown in the first rows has lower-case letters in its 2β reference numbers, coσesponding directly with the notation of figure 45. The second town 27 shown appearing in later rows has all letters in the reference numerals shown in upper case. 2β Row 1 begins by showing the complete set of values for the first endorsement. Since 29 the dot is on a 1 1, the first house on the first street is used in the one-time signature. As will so be apparent, the edge value for the first street, al, is not needed since the first street is 3i used; the hyphen symbol "-" indicates the lack of significant value held in this entry. — 26 — ι Row 2 shows that no changes in the register values are needed for this endorsement. 2 All column entries except the second, which coσesponds to the one-time signatures used i 3 the endorsement, are explicitly transmitted by the endorser to the endorsee. 4 Row 3, the third endorsement, entails two changed register values, as indicated by 5 the caσots. The first is bl 1, which is calculated as the compress of al 1 and a 12. Such β compressions, as will occur later as well, may be taken as example ofthe "advance edges" 7 function/step 4342 already described with reference to figure 43. The second, a22, is β preparatory for the next street, and is calculated from the second house on the next street, 9 as also shown in figure 45B. ιo Row 4 is the final endorsement for the first street. It requires a compress of bl 1 and ii al3 to obtain bl2. Also the value of a23 is computed from the house a23*. 2 Row 5 is the first endorsement ofthe second street. The edge value a21 is shown as i3 computed. Since an endorsement with house a21 is made, less computation is needed to 14 complete the value of this edge. This extra efficiency is the reason that the first entry is le is to be filled in last. The edge value al or the first street is needed at this point and it is easil iβ calculated as the compress of bl2 and a 14. The value of register a24 is computed from th 17 coσesponding house. As endorsement has now moved to the second street, a2 is no longe iβ needed. 1 Row 6 indicates evaluation but not nonvolatile storage of two houses, A21 and A22 20 and compressing the resulting two edge values to form B21 shown as stored. 2i Row 7 forms b21 as the compress of a21 and a22 and stores the result in the first 22 house column. The second house column gets the edge value computed from the second 23 house on the third street. The value of B22 is computed in preparation for the second tow 2 First the value ofthe third house in the second street of the second town is computed and 25 then this is used together with the first edge value ofthe second street of the new town, 2β mentioned in row 6 above, to form by compression the value B22. ∑? Row 8 begins by taking the first column from b21 to b22 by compressing b21 2β together with a23. Then a33 is computed from its house. Finally the value of edge A2 is 29 developed, first from computing A24 from its house and then compressing this with B22. 30 Row 9 fills the first register with the edge formed from the first house on the third si street. The fourth column gets the value computed from the fourth house on the third 32 street. The edge needed for skipping the first two streets, bl, is formed by first ι compressing b22 and a24 to obtain a2 and then compressing this with al Because 2 endorsement is now in the fourth street, a3 is no longer needed 3 Row 10 involves constructing only the value B31 for the next town. This is the compress of A31 and A32 that are each computed from their respective houses. 5 Row 1 1 first takes the first column forward from a31 to b 1 by compressing the β former with a32 Then a42 is computed from its house and replaces the second column 7 value In preparation for the next town, B31 is move forward to B32 by compressing with β the value of A33 computed from its house. Row 12 begins by taking b31 into b32 in the first column by compressing with a33 ιo already stored Also a43 is computed from its house and stored. Also A3 is compressed ii from B32 stored and A34 computed from its house 12 Row 13 initially sets the first column to the value of house a41 Also house value a44 is is put in place To move bl to b2, first a3 is compressed from b32 and a34, both stored and 1 then this result is compressed with bl Since endorsement is now in the fourth street, a4 is is freed. iβ Row 14 only entails computing B41 from two values, A41 and A42, that are com- 17 puted directly from their respective houses iβ Row 15 starts out updating a41 into b41 by compressing the former with a42 stored 19 The second column is given the value of A12 computed directly To progress B41 into 20 B42, the value of A43 is computed directly from its house and then compressed with B41 21 Row 16 also updates its first column by compressing the former value b41 with a43 22 stored to yield b42 By computing directly from the house, A13 is obtained To compress 23 B42 into A4, the value of A44 is computed directly from its house. 24 Row 17 is the first endorsement from the second town. The value of Al 1 is 2s computed through the endorsement and stored in the first column. And A14 is computed 2β from its house value 27 Row 18 requires not register changes It is identical to row 2, except that it is for the 2β second town Thus the process between the first and second towns is ready to repeat again 29 between the second and third towns. OVERVIEW ι An overview of a second prefeσed embodiment is given in figure 1. Only a single 2 issuer 101, card 102, terminal 103 and acquirer 104 are shown, but the system can contain 3 a plurality of issuers, cards, terminals and acquirers, which are not shown for clarity. 4 There are four entities in the system, the issuer 101, the card 102, the terminal 103 s and the acquirer 104. The issuer is an organization, or a conglomerate of organizations that β issues the cards and guarantees the coσect operation of he card to the other participants, 7 for example, but without limitation, a bank. The card is a tamper-resistant computer device β that is trusted by the issuer, for example, but without limitation, a smart card. The terminal 9 is a computing device capable of communicating with a card. The acquirer 104 is an ιo organization which helps to collect the data from the terminals. The acquirer, if it is a ii distinct entity from the issuer, typically works in close cooperation with the issuer. 12 When a card is first produced, it is typically initialized by, or on behalf of, the issuer 13 This is called personalization, and is done using a data channel 110, 111 The i4 personalization might for example, but without limitation, involve giving the card a set of is cryptographic keys and system configuration parameters. Once personalized, the card can iβ be used to perform transactions. 17 Before a transaction is made, a data channel 112, 113 is established between the card iβ and the terminal. There are various transactions that can be performed. Many of them do i not require that the card or the terminal communicate with either the issuer or the acquirer 20 during the transaction. We call those transactions "off-line". Some transactions require the 21 terminal to communicate with the issuer during the transaction. These kinds of transactions 22 are called "on-line". For these transactions a communication channel 118, 119 between the 23 terminal and the issuer is used. Some examples, without limitation, of transactions are: data 2 reading by the terminal, data writing by the terminal, payment from the card to the terminal, 25 reloading ofthe card with more electronic money, etc 2β The acquirer 104 is an entity that collects information from one or more terminals, 27 and optionally handles some or all ofthe clearing and settlement ofthe transactions. For 2β this puφose, the acquirer communicates with the terminal through the communication 29 channel 114, 115, and with the issuer through communication channel 116, 117. Some so examples, but without limitation, ofthe functions ofthe acquirer are: gathering information 31 about the transactions the terminal participated in, collecting the cryptographic proofs of 32 payments from the terminals, updating system parameters in the terminals, forwarding ι information regarding the financial transactions to the issuer, collecting the money for these 2 transactions from the issuer, distributing the money received to the owners of the 3 respective terminals. COMPACT ENDORSEMENT SIGNATURES 4 Compact endorsement signatures use disposable cryptographic elements which are s called "houses". Each house is used only once to sign or authenticate a message. Several β such houses are combined into a "town" for reasons of efficiency. A HOUSE 7 The basic construction of a 'house' in the prefeσed embodiment is shown in figure 2. β A house consists of a starting value called the house origin 201, a set of expansion β functions 202, a set of iterated oneway functions 203, an iterative cryptographic hash ιo function 204 and a house result value 230. ii A house contains a plurality of columns, two of which are shown explicitly in figure 12 2. The first one consists of items 210, 211, 212, 213, 214, 215, 216, and the second one of 13 items 220, 221, 222, 223, 224, 225, 226. The remaining columns are represented by 208 14 and are not shown in detail for clarity. is Considering the first column, this starts with a cryptographic oneway function 210 iβ that takes the house origin 201 as input and yields the first value in the column 211 as i7 output. This is then used as input to a chain of oneway functions. Each chain contains one β or more oneway functions. Only two oneway functions ofthe chain are shown in figure 2, 1 the remaining steps ofthe columns are not shown for clarity, and are represented by 209. 20 The first oneway function 212 takes the first column value 211 as input and yields the 21 second column value 213, which is the input to the next oneway function, etc. The last 22 oneway function in the chain 214 yields the last column value 215. 23 The iterative cryptographic hash function 204 consists of a publicly known starting 24 value 205 and a sequence of compression functions, one for each column. The starting 25 value 205 is one ofthe inputs to the compression function ofthe first column 216 that 26 takes the last column value ofthe last column 215 as the other input and yields the first 27 intermediate hash value. Each subsequent column ends with a compression function similar 2β to 216 that takes the previous intermediate hash value as one input, the last column value 2 of that column as the other input and yields the next intermediate hash value. ι The last column, consisting of 220, 221, 222, 223, 209, 224, 225, 226 is built in a 2 similar way as the first column, these items coσesponding to 210, 211, 212, 213, 209, 214, 3 215, 216 respectively. The compression function 226 ofthe last column takes the next to last intermediate hash value as one input, the last column value ofthe last column 225 as 5 the other input and yields the final hash value 230, which is called the house result value. β An exemplary house is shown in figure 9. The house origin value 901 coσesponds to 7 value 201. The set of expansion functions 902 consists of cryptographic oneway functions β 910, 920, 930, 940, 950, 960, 970 all of which use the house origin value 901 as an input, 9 and which yield the first value in the columns 903 (coσesponding to 203): 911, 921, 931, ιo 941, 951, 961 and 971 respectively. These values are used as inputs to the first oneway i functions in the chains 912, 922, 932, 942, 952, 962, 972 respectively, which yield the 12 second column values 913, 923, 933, 943, 953, 963, 973 respectively These are then the 13 input values for the second oneway functions in each chain 914, 924, 934, 944, 954, 964, i4 974 respectively, which yield the third column values 915, 925, 935, 945, 955, 965, 975 is respectively. These are then used as input values for the third oneway functions in each iβ column chain 916, 926, 936, 946, 956, 966, 976 respectively which yield the last column i7 values 917, 927, 937, 947, 957, 967, 977 respectively. These last column values form the iβ input to the cryptographic hash function 904 (coσesponding to 204), which starts with a 1 publicly known starting value 905 which is an input to the first compression function 918 20 which also takes the value 917 as an input and which yields the first intermediate hash value 21 919 as a result. The first intermediate hash value 919 and the final column value ofthe 22 second column 927 are the inputs to the second compression function 928 which yields the 23 second intermediate hash value 929. This chain continues in the same fashion with items 4 938, 939, 948, 949, 958, 959, 968, 969, 978, 979 respectively The last value 979 is the 25 house result value which coσesponds to item 230. 26 All the cryptographic oneway functions that start a column (such as 910, 920, 930, 27 940, 950, 960, 970) are different, so that they yield different result values even though they 28 have the same input value. As will be described more fully later, several houses may all use 29 the same house origin value. Within a set of houses that use the same house origin value, all 30 the cryptographic oneway functions that start a column are typically different. Furthermore, 3i these oneway functions are such that it is believed to be impractical to reconstruct the 32 house origin value given all the output values of these oneway functions. Such functions ι are used in other systems, among others in cryptographically strong pseudo-random 2 generators, well known in the art. 3 In the prefeσed embodiment, the oneway functions in the column chains (such as 4 912, 914, 916, 922 etc. to 976) are all different within a house. Furthermore, within a set of s houses that use the same house origin value, all the oneway functions in the column chains β are different. Each ofthe compression functions such as 918, 928, 938 etc. differs within a 7 set of houses that use the same house origin value. As will be obvious to a person β ordinarily skilled in the art, these functions can be made different in many ways, for 9 example, but without limitation, they can be made dependent on a counter which is ιo incremented at every function application, or the exact position within a house or set of ii houses could be used to differentiate the different functions. It is believed that using 12 different functions in different positions improves the security ofthe system. 13 The height of a column is the number of column values, which is one more then the i4 number of oneway function in the chain. is The house result 230 depends on the house origin 201. Even though it might involve iβ a large number of intermediate results, the result 230 can still be computed from the house i7 origin using only a fixed amount of memory, iσespective ofthe number of columns or the iβ height of each column. This is achieved by computing through each of the columns in turn, 19 and applying the compression function to the final value of each column before starting on 20 the next column. The details of this computation will be obvious to someone ordinarily 21 skilled in the art. A TOWN 22 As will be described later, the house output value will be signed using a digital 23 signature scheme and the card will store that signature. To reduce the storage requirements 24 several houses may be combined into a town, as shown in figure 3. 25 A town consists of a plurality of houses, three are shown in figure 3 as 321, 322, 323; ∑β the remaining houses are not shown for clarity and are represented by 302. Each ofthe 27 constituent houses of a town has a house origin value (coσesponding to 201 in figure 2); 2β 311, 312, 313 are the house origin values of 321, 322, 323 respectively. Each ofthe houses 2 also has a house result value, coσesponding to 230 in figure 2; 331, 332, 333 are the house result values of 321, 322, 323 respectively. All the house result values are used as inputs to 3i a cryptographic hash function 340 that yields the town result value 341. ι In the prefeσed embodiment all the houses in a town are ofthe same architecture- 2 they have the same number of columns, the same height for each column etc It is believed 3 that this gives the easiest implementation The construction of a town in the prefeσed embodiment may be described s recursively, as shown in figure 4 A singleton town 403 has a single constituent house 461 β The town origin value 460 is used as the house origin value (coσesponding to 201 in figure 2) ofthe house 461 The house result value (coσesponding to 230 in figure 2) is the town β result value 462. A general town 401 has a plurality of constituent towns, three of which are shown as ιo 421, 422, 423, the remaining are not shown for clarity and are represented by 402 Each of ii the constituent towns is either a general town or a singleton town The town origin value i2 411 is used as the town origin value for each ofthe constituent towns A sequence of 13 compression functions is used to combine the town result values ofthe constituent towns 1 and yield the town result value ofthe general town 453 is The town result value ofthe first constituent town 431 is the first input to a compres- i6 sion function 442 that takes the town result value ofthe second town 432 as a second input 17 and yields the first intermediate value 452 This intermediate value is then used as the first iβ input to the next compression function, which takes the result value of the next constituent 19 town as a second input and yields the next intermediate value This chain continues until the 20 last constituent town where compression function 443 takes the previous intermediate 2i value as a first input and the town result value ofthe last constituent town 433 as a second 22 input and yields the town result value ofthe general town 453 23 The compression functions such as 442 and 443 are chosen in such a way that the 24 result ofthe chain of compress functions is a cryptographic hash function Such iterative 25 hash functions are well known in the art. ∑β In the prefeσed embodiment, the recursion depth used in each ofthe constituent 27 towns is always the same, and the number of constituent towns in a general town only 28 depends on the recursion depth. It is believed that this results in the most practical 29 implementation. Each recursion level is called a dimension, and a town with n recursion so levels is called an n-dimensional town For example a general town whose constituent 3i towns are all singleton towns is a one-dimensional town A general town whose constituent 32 towns are all one-dimensional towns is a two-dimensional town, etc. This also allows an 33 easy characterization of a town configuration. For example, a 7x4x5 town is a three- ι dimensional town that contains 7 constituent two-dimensional towns, each of which 2 contains 4 constituent one-dimensional towns, each of which contains 5 constituent 3 singleton towns, each of which is made up of a single house. Thus, the total number of houses in this town is 7x4x5=140. The number of constituent towns in a general town at 5 each recursion level is called the size of that dimension. The singleton town is often β ignored, and we will say that a one-dimensional town contains a plurality of constituent 7 houses. In the prefeσed embodiment, the sizes ofthe dimensions are all the same, or differ β by at most one. It is believed that this gives the most efficient implementation. A prefeσed exemplary 3x4 town is shown in figure 5. The two-dimensional general ιo town 501 contains three constituent one-dimensional towns 502, 503, 504, each of which ii contains four constituent houses. The town origin 505 is used as the house origin of each of 12 the houses in the town 560, 561, 562, 563, 530, 531, 532, 533, 510, 511, 512, 513. These is houses each produce a house output value namely 564, 565, 566, 567, 534, 535, 536, 537, 14 514, 415, 516, 517 respectively. The house result values ofthe first one-dimensional town is 504 are combined by a chain of compress functions 568, 570, 572 that generates the iβ intermediate values 569 and 571 and the town result value 573 of town 504. The house 17 result values ofthe other one-dimensional towns are combined in a similar way, as shown iβ by 538, 540, 542, 539, 541, 518, 520, 522, 519, 521 which results in the town result values 1 543, 523 of towns 503, 502 respectively. The town result values 573, 543, 523 ofthe one- 20 dimensional towns 504, 503, 502 are combined in a similar way by functions 581, 583 and 21 intermediate value 582 which results in the town result value 584 of town 501. TOWN CREATION 22 For the description ofthe processes that involve a town we will use the example as 23 shown in figure 5. How these processes extend and generalize to a general town will be 24 obvious to someone ordinarily skilled in the art. 25 A town is created by choosing a town origin 505 and computing the town result 584 2β from that. The town result is computed using a straightforward, although extensive, 27 computation involving the origin. As an example, but without limitation, an elegant way of 2β computing the town result 584 is shown in the figure 41. The houses are computed in the 2 order shown in the first column. The second column shows which values will be in memory so after the house in the first column was computed. The last column shows which values are si in memory after applying any compression functions whose input values are both in ι memory. After applying any compression functions, the next house is computed as shown 2 in the first column ofthe next row The generalization to a general town is best described 3 recursively. It is believed that a singleton town like 403 can be computed with a fixed 4 amount of memory, as it basically only involves computing a house. To compute the 5 general town 401, we first recursively compute town 421, store the value 431, recursively β compute town 422 with result 432, combine values 432 and 431 using compression 7 function 442 to value 452, compute the next town recursively etc. It is believed that by β interleaving the applications of the compression function with the computation ofthe constituent towns, each recursion level uses a fixed amount of storage independent ofthe ιo number of constituent towns, so that the storage required to compute an entire town is only ii proportional to the number of dimensions of a town. 12 Once the town result 584 has been computed, the issuer signs this result using a i3 public key digital signature scheme. There are several ways in which this can be 14 accomplished. If the issuer is creating the town, then he just computes the digital signature is on the town result. This is shown in figure 10. The signing process 1002 takes two inputs iβ namely the message to be signed 1001, and the secret key used to create a digital signature 17 1004. The output value ofthe signing process 1003 is called the digital signature. By using iβ the town result 584 as the message input value 1001, the issuer can compute the digital 19 signature on the town result, which we call the town signature. The town origin 505 and 20 the town signature are then sent to the card 102 where they are stored in non-volatile 21 memory. It is anticipated that other data can also be included in the message being signed 22 as the town signature. 23 There are several other ways in which the town might be created. For example, but 24 without limitation, the card could choose a random town origin 505, compute the 2s coσesponding town result 584, and send the town result to the issuer together with a 26 cryptographic authentication that convinces the issuer that the town result he receives was 27 computed by a valid card. The issuer then signs the town result to get the town signature, 2β and sends the town signature back to the card. The card stores the town origin 505 and the 2 town signature in non-volatile memory. A blind signature scheme might also be used, 30 where the card first blinds the town result 584 before sending it to the issuer. Using a blind 31 digital signature scheme the issuer can sign the town result without ever learning the actual 32 value ofthe town result. ι Using some or all of these creation techniques, the card can acquire one or more 2 towns, each of which consists of a town origin 505 and a town signature Reloading a card 3 with more towns would typically be one of the transactions which the terminal might perform with a card. HOUSE SPENDING 5 The process of using the houses is called spending. In this process the card uses a β house to sign or authenticate a message, for example, but without limitation, the card can 7 use a house to create a message to the terminal which represents a certain amount of β money, which the terminal can verify for validity without having access to any secret 9 cryptographic keys. ιo The basic spending process is described in figure 30. This process is an example of a ii wide class of cryptographic protocols known as commit-challenge-response protocols. 12 These are well known in the art, and have been used in a variety of zero-knowledge 3 protocols, identification protocols, signature schemes etc. Some examples of such i4 protocols are the Guillou-Quisquater protocol, Feige-Fiat-Shamir protocol etc. A commit- i5 challenge-response protocol starts with one party (the prover) sending a commit message iβ to the other party (verifier). The verifier then chooses a challenge which it sends back to 17 the prover. Finally, the prover sends a response to the verifier. The prover will typically use iβ the commit value, the challenge value and some other (secret) data to compute the 1 response. The verifier will typically be able to verify that the response is coσect based on 20 the commit value and the challenge value. It will typically be the case that a cheating prover 2i can provide coσect commit and response messages if he can guess the value ofthe 22 challenge in advance. The number of different possible challenge values is thus an important 23 aspect of these kind of protocols. If the number of different challenge values is small, then a 24 single execution ofthe protocol process will not convince the verifier very much, and the 25 execution will have to be repeated to fully convince the verifier. This is used on many zero- 2β knowledge protocols. If the number of different challenge values is large, then the protocol 2 can be converted to a signature scheme by defining the challenge to be chosen as the 2β cryptographic hash ofthe message to be signed and the commit value sent by the prover. 29 This eliminates the need for interaction and allows the prover to send all the data in a single so message to the verifier. This conversion is again well known in the art, and is for example 1 used in the Fiat-Shamir signature scheme. In several schemes the amount of computational ι work increases when the number of possible challenge values is increased, making it 2 desirable to keep the number of challenge values to a minimum. The spending process will 3 now be described, which is a specific embodiment of a commit-challenge-response protocol 4 in which the card is the prover and the terminal is the verifier. 5 The process in figure 30 starts at step 3000 at the card which sends a commit value β to the terminal in message 3001. The puφose ofthe commit value is to fix the house the card will use in the spending. For example, but without limitation, the commit value could β consist ofthe town signature, the town result value and an identification ofthe house 9 within the town. When message 3001 is received by the terminal, the terminal starts ιo execution of process step 3002. The terminal stores the commit value, and chooses a ii random challenge c. As the last action of step 3002 the terminal sends the challenge c to the i2 card in message 3003. The terminal might use various means to generate the random 13 challenge c. For example, but without limitation, this could include a real random number i generator, a pseudo-random number generator etc. The challenge chosen could also is depend on information sent by the acquirer or issuer to the terminal, thus taking away some iβ freedom from the terminal which is believed to make some attacks harder to perform. 1 When message 3003 is received by the card, it starts execution of process step 3004 in iβ which the card computes the response associated sends the response to the terminal in i message 3005 When message 3005 is received by the terminal, it starts execution of 20 process step 3006 in which the terminal verifies that the response matches with the commit 21 value and the challenge. 22 The commit value must uniquely identify and authenticate the house that will be used 23 by the card in this process. This typically involves identifying the town and the house within 24 the town. The town is authenticated by the town signature. To properly authenticate the 25 house, several intermediate values in the town must also be sent to the terminal, either in 2β the commit message or in the response message. For example, in figure 5 if house 532 is 27 used, the following values are sent to the terminal: 536, 539, 537, 573, 523 (Value 536 is 2β not strictly necessary as it can be computed from other response data, but in the prefeσed 29 implementation it is sent as it is believed that this is easier.) Using these values, the terminal 30 can verify that the house with house result value 536 is indeed a constituent house ofthe 3i town 501. The terminal applies the various compression functions to compute the town 32 result value 584, and then verifies the town signature using a signature verification process. 33 The signature verification process is shown in figure 7. The verification function 712 takes — 37 — ι three inputs: the signature 711, the message 710, and the public key 714, and yields a single 2 bit result 713. The result indicates whether the digital signature was indeed the signature on 3 message 710 with respect to the public key 71 . 4 Having authenticated the house, the house can now be used. We will use the house in 5 figure 9 as an example. The response data that the card sends includes exactly one value in β each ofthe columns. In the first column, that is one ofthe values 911, 913, 915, or 917. In 7 all the other columns, one ofthe four column values is included in the response data. The β terminal receives these column values, and applies the necessary oneway functions to 9 compute the final column values in each ofthe columns 917, 927, 937, 947, 957, 967, 977. ιo The compression function 904 is then applied to these values which yields the house result ii value 979. The terminal verifies that this matches the house result value used earlier to i2 authenticate the house in the town, or uses the house result value to authenticate the house 13 in the town. The choice of which value in each column is sent encodes the challenge c. For 14 ease of reference, each ofthe column values has an associated digit value. The digit value is ofthe last column value is 0, the digit value ofthe next to last column value is 1 etc.. In iβ figure 9 the first column value has a digit value of 3, in the actual prefeσed embodiment the 17 column height is 8, so that the digit values 0, 1, 2, 3, 4, 5, 6, 7 are used. It is believed that iβ using a power of two for the column height allows easier encoding/decoding of actual data 19 into the column digit values. The challenge c is thus converted into a sequence of digits, 20 which indicate the column values included in the response data. In this way a card can use a 21 house to perform a commit-challenge-response protocol with the terminal. It is believed 22 that this protocol by itself convinces the terminal ofthe fact that the card is genuine in the 23 sense that it has a valid town, which was originally signed by the issuer, which only gives 2 such valid towns to genuine cards. 25 Figure 6 shows a number of digit values (digits) which are used to encode c and any 2β extensions which we will describe fully later. Each square, such as 600, 602, 604, 606, 608, 27 610, and 612 represents a single digit, with 603, 607 and 611 representing any number of 2β additional digits. The boundaries 601, 605 and 609 separate the digits into different fields 29 which will be discussed fully later. A (sub)sequence of digits usually encodes an integer, so using the standard encoding of integers into digits ofthe appropriate radix, well known in 31 the art. If the columns are of different heights, then the maximum digit value varies over the 32 digit position. In this case a mixed radix encoding ofthe integers is used, which is also well 33 known in the art. ι For each ofthe column values given to the terminal, the terminal can of course 2 compute the subsequent column values This corresponds to a lowering of the 3 coσesponding digit value. This would allow the terminal to modify the digits unless precautions were taken. The control value is used to protect against this. A subset of the s columns (and thus ofthe digits) are designated as the protected columns (digits). The β control value, seen as an integer, encodes some constant minus the sum of all the digit 7 values in the protected columns. The control value itself is also coded into some columns, β For example, but without limitation, the control value could be coded into digits 610, 611, 9 612 and the protected digits could consist of 600, 602, 603, 604, 606, 607, and 608. The ιo terminal can only apply more oneways to a column chain and thus only lower the value of ii any one digit. If the terminal tries to lower the value in any of the protected digits, then the i2 control value increases, which means that at least one of the encoding digits of the control 13 value increases. This would require the terminal to invert one ofthe oneway functions in 14 the column ofthe increasing control digit, which is presumed to be impractical. In the is prefeσed embodiment the range of control values is fixed at 0-63, which allows for 9 iβ protected columns. (All columns have height 8, so each protected digit has a value of at 1 most 7, so 9 columns lead to a maximum sum of 63. Using 63 as the constant to subtract iβ from gives exactly the range 0 to 63 to the control value, which can be encoded in two 1 digits of radix 8.) It is believed that the most significant control digit is the most attractive 20 digit to try to increase by inverting the appropriate oneway function, as increasing this digit 2i gives a lot of flexibility in changing the protected columns. The most significant digit ofthe 22 control value is therefore duplicated in two separate columns, for a total of three control 23 columns. It is believed that the double encoding ofthe most significant digit provides extra 24 security against an attack which attempts to invert a oneway function with the aim of 25 increasing one of the control digits. It is furthermore believed that the number of control 26 columns increases only logarithmically with the number of protected columns. 27 The spending protocol implements a commit-challenge-response protocol between 28 the card and the terminal in which the number of different challenge values depends on the 2 number of columns in a house and the height of each column. The challenge value is so encoded in the protected columns, and the control columns are added as described above. 31 This can now be used to sign messages. For short messages where there are at most as 32 many possible messages as there are challenge values, the message itself can be used 33 instead ofthe challenge value. However, most applications need to sign larger messages — 39 — ι then would be practical here, among others to prevent replay attacks This method of using 2 a commit-challenge-response protocol is well known in the art. 3 A more general scheme is the direct conversion ofthe commit-challenge-response 4 protocol to a signature protocol by choosing the challenge to be the hash ofthe commit s message and the message to be signed. This requires a challenge value of approximately β 128 bits or more, which can be achieved using 43 protected columns of height 8 plus 3 control columns for a total of 46 columns. This method of using a commit-challenge β response protocol is well known in the art. It is believed that including the commit message in the hash used to compute the challenge is not even necessary for these house based ιo systems. ii A commit-challenge-response protocol can also be used to authenticate messages in i2 those cases where the effective contents ofthe message to be authenticated is small. By 13 effective contents we mean the data in the message except for the data that is used to 1 prevent playback attacks etc. For example, but without limitation, in payment systems the is only important piece ofthe message being signed is the amount ofthe payment. The iβ challenge can now be chosen in two parts, the first part being the message that is i7 authenticated, and the second part being a value chosen by the verifier in a manner not iβ predictable by the prover. It is believed that this method provides full authentication ofthe i message and at the same time protects the verifier from playback attacks. This use ofthe 20 commit-challenge-response protocol will be refeσed to as signing a short message. A 21 typical exemplary application is the case of payments (i.e. payments from the card to the 22 terminal). The challenge c is divided into 4 sequences of digits, as shown by the separators 23 601, 605 and 609 in figure 6. The first digit 600 encodes the cuσency ofthe payment. The 2 4 digits 602, 603, and 604 encode the amount ofthe payment. The digits 606, 607, 608 are 25 chosen randomly by the terminal, and finally digits 610, 611, and 612 encode the control 2β value. The protected digits are 600, 606, 607, and 608. A typical configuration has 1 2 cuσency column, 5 amount columns, 7 random columns and 3 control columns, which 2β accommodates 8 cuσencies, 15 bits resolution ofthe amount ofthe payment and 21 29 random bits. Using an ordinary digital signature, the 21 random bits would not be enough 30 to protect the terminal from playback attacks. However, it is believed that in a commit- 31 challenge-response protocol, and in this specific instance of a commit-challenge-response 32 protocol in particular, this does protect from such attacks, as the card must commit to the 33 house to be used in the first message, and cannot change that based on the value ofthe ι random part ofthe challenge. The amount digits are not included in the protected digits, 2 which allows the terminal to arbitrarily decrease any of the amount digits. It is believed that 3 this only decreases the amount encoded in the signature, which is not in the interest ofthe terminal. s Another method allows the use of commit-challenge-response protocols with a small β set of possible challenge values to be used to authenticate arbitrarily long messages. This is 7 done by choosing the challenge value as a uniformly distributed function ofthe β cryptographic hash ofthe message where the message is extended with a number that was » generated in a mutually random fashion (also known as a fair coin flip). Such a mutually ιo random number is a number which is constructed in a cooperative process between two ii parties in such a way that both parties are ensured that the number is in fact random. At the i2 start of the process in figure 30, both the card and the terminal know the message m to be i3 signed. In process step 3000 the card generates a random number a, and computes a i4 commit value A on it, for example, but without limitation, A can be formed by hashing a is and a large enough random string of bits. In message 3001 the card sends A to the terminal, iβ along with the rest ofthe commit message. The puφose of A is for the card to show the 17 terminal that it has fixed it's choice of a without revealing a to the terminal. Such bit is commitment schemes are well known in the art. The terminal then chooses a random 1 number b in process step 3002, and sends b to the card in message 3003. In step 3004 the 20 card computes the mutually random number d as a function of a and b, for example, but 21 without limitation, d can be computed as the exclusive or of a and b. The actual challenge 22 value c is then computed by first computing a cryptographic hash ofthe message m 23 concatenated with d, and then applying a function that maps the hash value uniformly to the 24 set of possible challenge values, for example, but without limitation, the challenge c could 25 be chosen as the least significant bits ofthe actual hash value. The value c is then coded 26 into the protected digits of a house, the control digits are added and the card sends the ∑? response data associated with those digits to the terminal in message 3005. The card also 2β includes the value a plus any information necessary to verify the commit value A in message 2 3005 which allows the terminal to reconstruct d and thus c, and also allows the terminal to so verify that a is indeed the value committed to by the card in message 3001 by checking that si the values a and A are consistent with each other. This use of a commit-challenge-response 32 protocol will be refeσed to as authenticating an arbitrarily long message. The message m 33 does not have to be known by both parties at the start of the process, but can also be ι included in message 3001 to the terminal. It is anticipated that part ofthe message might 2 also be chosen by the terminal in step 3002 and communicated to the card in step 3004, in 3 which case the card has the choice of accepting that part ofthe message or replacing it by a 4 fixed value. It is believed that this authentication method provides authentication ofthe s message to the terminal. It is believed that the probability of successfully cheating the β terminal is in the order of one over the number of possible challenge values. 7 It is believed that compact endorsement signatures provide a high degree of β flexibility; using a large house, the card can sign any message, using a more efficient smaller 9 house, the card can sign a small message, or authenticate an arbitrarily long message. ιo When the house is used to authenticate an arbitrarily large message to the terminal, ii the card can at the same time send a secret-key authentication on the message for use by i2 the issuer. (As the issuer originally produced the card, we assume that the card and the i3 issuer have a secret key in common.) The secret-key authentication is first appended to the 14 message, and the combination ofthe two is then authenticated to the terminal using a is house. It is believed that this provides the benefit of a public-key signature to the terminal, iβ with the speed and storage advantage of a secret key signature to the issuer. The terminal 1 can namely discard the house and all associated data and only store the message and the iβ secret-key authentication. TOWN PRECOMPUTATION 1 The card must send several intermediate values ofthe town to the terminal during the 20 spending process. To save computations these values are precomputed. As an example we 21 will use the town of figure 5, the precomputation steps are shown in figure 40. The 22 precomputations schedule shown in figure 40 are believed to be suboptimal in the sense 23 that they require more storage on the card then the optimal precomputations schedule, but 24 it is also believed that this schedule yields the easiest implementation. 25 Figure 40 shows the values stored in memory at any step. The first column contains 2β the number ofthe house in the town that is being spent, the second column the set of value 27 that is precomputed in the cuσent town (called A), the third column the set of values that is 2β precomputed in the next town (called B). The next town is the town that will be used after 29 the cuσent town has been exhausted, in the sense that all the constituent houses have been s used. For clarity all items referring to the next town are shown in slanted font in figure 40. ι The fourth column the set of values needed for the authenticating the house indicated in the 2 first column within the town and the last column the number of values stored in memory 3 The first row of figure 40 shows that when house 560 is being spent, the values 523, 543, 564, 565, 566, 567 are being used in the spending process (As mentioned before the 5 house result value of the cuσent house is used in the prefeσed embodiment Although this β is not necessary from a functional point of view, it is believed that this provides for the 7 easiest implementation.) The value 534 is computed (by computing the house result value β of house 530) and stored. 9 The second row of figure 40 shows the situation when the next house 561 is spent ιo The same values as in the previous step are being used, and one more value is precomputed ii namely 535 When, in the third row, house 562 is being spent, the values 564 and 565 are 12 no longer necessary for the spending process, but are combined using the compression i3 function into value 569 This saves a storage space, which is used to precompute the next 1 value 536 The next line shows a repeat of this process when house 563 is being spent the is values 569 and 566 are combined into value 571 and the free storage space is used to iβ compute value 537 When spending house 530, the values 571 and 567 are combined into i 573, the value 543 is no longer necessary and is replaced with the already precomputed iβ values 534, 535, 536 and 537 which are now used in the spending process. The value 514 19 is precomputed in this step This is also the point in which we start precomputing the next 20 town When all houses in the current town (A) have been spent, we obviously need the 2i intermediate values ofthe next town (B) that are needed for the spending process for the 22 first house in B At this point we precompute value 534 in town B by computing the house 23 530 in town B which is the first step in computing 543 of town B When spending house 24 531 the same set of values is used for the spending, the value 515 is precomputed, and in 25 town B the house value 535 is precomputed, combined with the already stored value 534 to 2β yield value 539 Only value 539 of town B is stored This process continues as shown in the 2 table W en spending house 533 the values 523, 541, 537 and 573 are being used, the 2β values 514, 515, 516, and 517 have been precomputed in town A In town B the value 537 2 is computed, combined with the value 541 which was already precomputed in town B and so the result value 543 stored When the next house 510 is being spent, the values 573 and 31 541 and 537 in town A are no longer necessary, they are combined using the appropriate 32 compression functions into value 582 The values 514, 515, 516 and 517 which had already 33 been precomputed in town A are now being used. Two new values are precomputed in — 43 — ι town B namely 514 and 564. In the next rows the spending situations for houses 511, 512 2 and 513 is shown. The original values that were used for the spending 514, 515, 516, and 3 517 are step by step combined to 521 and 517 for the spending ofthe last house 513. The 4 precomputations in town B involve precomputing 565, 566 and 567, and the s precomputation of value 523 in steps with intermediate values 519 and 521. After the last β house 513 has been spent, we switch to the next town. What used to be called town B now 7 becomes town A. The values that were precomputed in town B during the spending of β town A are exactly those necessary for the spending ofthe first house 560 in town B as 9 shown by the next row ofthe table. Of course, the remaining values 521, 517 and 582 of ιo the old town A are discarded as they are no longer needed. When all houses in a town have ii been spent, the town origin and the town signature are also discarded, as they will not be i2 used again. i3 It is believed that this method of precomputations requires storage space proportional i4 to the sum ofthe sizes of each ofthe dimensions of a town. Furthermore, it is believed that is the precomputation involves computing at most as many houses as there are dimensions if β multiple towns are used, and one less if only a single town is used. In figure 40 at most 2 17 houses are precomputed at any step, and of these at least one is in town B. If town A were iβ to contain enough houses so that a second town is not necessary, then no precomputations 19 in the next town need to be done. It is believed that this further reduces the necessary 0 precomputations. It is believed that it is possible to load additional towns into the card. 21 These can either be without any precomputation (e.g. the next town after town B), with 22 (partial) precomputations (e.g. add a town B with the coσect precomputations to an 23 already existing town A), or existing towns and precomputations can be discarded and 2 replaced with new town(s) with the right precomputations. These extensions will be 25 obvious to someone ordinarily skilled in the art. 2β The precomputations mentioned above can of course be done by the card itself. An 2 alternative is for the terminal to do manage the precomputations. The house result values in 28 a town are not secret, so the card can compute those on demand and send the result to the 29 terminal. A refinement is to let the card not compute the house result value, but just the last so value in each column, send those column values to the terminal and let the terminal 3i combine them to get the house value. The terminal can now manage the precomputations, 32 reading, writing and deleting the necessary values in the card's memory. For example, but 33 without limitation, when spending house 562 (see figure 40, third row) the terminal can ask ι the card to compute the house result value 536. The card can either store this as a 2 precomputed value by itself, or send it to the terminal which then stores it back in the card 3 as a precomputed value. The terminal furthermore reads the values 564 and 565 which are 4 stored in the card's memory, deletes those values in the card's memory, computes the value s 569 form the values 564 and 565 and writes the value 569 in the card as a precomputed β value. In a similar manner all the other precomputation actions can be managed by the 7 terminal. The terminal might do all these actions itself, or might contain a tamper-resistant 8 device which performs and manages the precomputations. It is believed that this 9 precomputation management system simplifies the implementation ofthe card. It is believed ιo that any eσor by the terminal in managing or performing the precomputations does not lead ii to a security weakness, but can at most lead to a failure to properly authenticate a house in 12 a town, thereby rendering the compact endorsement signature scheme ineffective until a 13 recovery has been performed. It is believed that a terminal that detects an inconsistent 14 precomputation state in a card can recover the card and bring it in to a consistent state with is respect to the precomputations. SECURE DATA STORAGE iβ Figure 12 shows the basic layout ofthe non-volatile and volatile memory ofthe card 17 in the prefeσed embodiment, iβ The volatile memory 1240 holds the variable 1241, called VNIU, which is described 19 in detail below. Field 1242 holds the volatile memory variables that are not part ofthe 20 Secure Data Storage. These are not shown for clarity. 2i The non-volatile memory 1200 is divided into three areas. Area 1201 is used to store 22 the global non-volatile variables. Area 1203 is set aside for other applications or puφoses, 23 as known in the art. Area 1201 is shown in more detail as 1230, the dotted lines denoting 24 an enlargement. The fields 1231, 1232, 1233, 1234, 1235 and 1236 are global non-volatile 25 variables called NIU, COM, NDONE, NBROK, CLCOM and CLCAN respectively, and 2β are described in more detail below. Part 1237 are global non-volatile variables that are not 27 part ofthe Secure Data Storage system, which have not been shown for clarity. The 2β NDONE variable is used in the session proofs, which will be described more fully later. 29 Area 1202 is shown in more detail as 1210, the dotted lines denoting an enlargement. so This area is divided into a plurality of fixed-size smaller areas called frame slots. All frame 3i slots have the same size and the same internal organization. One ofthe frame slots 1211 is ι showed enlarged as 1220, the dotted lines denoting an enlargement. Each frameslot 2 consists of four fields, each of which can store a variable. The field 1221 is called the tag 3 field, and holds a variable called 'tag'. Field 1222 is called the access field, and holds a 4 variable called 'access'. Field 1223 is called the data field and holds a variable called 'data', s Finally, field 1224 is called the checksum field and holds a value (called the checksum) that β serves as a checksum over the other three fields. The function to compute the checksum 7 from the other three fields can be chosen in many ways, for example, but without limitation, β it can be chosen as the number of zero bits which occurs in the other three fields, coded as g a binary number. The four values tag, access, data and checksum are together refeσed to as ιo a 'frame'. ii The tag functions much like a filename in ordinary computers. It is used as a unique i2 name to refer to the frame. All frame slots are the same size, thus the a frame fits in any of 1 the frame slots. The inteφretation ofthe data in a frame slot is solely dependent on the 1 value ofthe tag field, and not on the position in the non-volatile memory the frame appears is in. Whenever information about specific frame is needed, the non-volatile memory is iβ searched for a frame slot with the proper tag value in the tag field. The other fields of that i7 frame slot contain the other data of that frame. A value of zero in the tag field is used to iβ indicate that a frame slot does not contain any valid frame data, and is therefore empty. 1 Thus, a frame slot is the actual location where a frame is stored in the non-volatile memory. 20 A frame is a set of values which is stored somewhere in the frame slots, which is identified 21 by its tag value. 22 The access field is used to store data regarding the conditions that should be met 23 before the data ofthe frame can be accessed. This coσesponds with access rights 24 associated with files in many operating systems. The data field contains data for the 25 applications, the inteφretation and formatting of this data depends on the applications. 2β In the prefeσed embodiment, the tag field is 2 bytes long, the access field 1 byte long, 27 the data field 16 bytes long and the checksum field 1 byte long. A MODEL FOR NON- VOLATILE MEMORY. 2β For reliable and secure operations the card would typically require a reliable and 2 secure non-volatile memory system. A typical smart card uses EEPROM technology for so non- volatile storage of data. Inherent in this technology, and in many other non-volatile 31 storage technologies, is that writing data is not instantaneous. There are two basic ι processes for EEPROM memory writing and wiping During wiping, a block of bits is 2 cleared to the default position, which we will without loss of generality denote by a binary 3 0 (although in some implementations wiped bits read as 1 's) The block size for wiping is 4 implementation dependent and might actually be 1, but typical minimum block sizes are 8 s or 32 bits This means that it is often not possible to wipe individual bits but only blocks of β bits 7 Writing is also done in blocks, but usually allows individual bits to be set to 1 (in our β representation) In a typical implementation, when writing data to a memory block the bits 9 that are written with a 0 value are not affected while those that are written with a 1 value ιo are set to 1 ii Both the writing and wiping process take time, typically on the order of a few 12 milliseconds If the operation is aborted for some reason within this time, the results are 13 usually unspecified It is believed that irradiating the EEPROM memory with UV light has 14 similar effects as a partial or full wipe ofthe bits that are iσadiated is A functional model of a typical EEPROM memory is shown in figure 1 1 This figure iβ gives the state diagram for a single bit of EEPROM memory Each bit has three possible 17 states labeled 1100, 1101, 1102 The state 1100 is what we call the 0 state In this state the iβ bit has a stable zero value, and will always be read as a zero In state 1101, also called the 1 1 state, the bit has a stable one value, and will always be read as a one In state 1102 the bit is 20 in an intermediate state, called the n state In this state the value ofthe bit is not defined, 21 and the result of a read operation is undefined Although most implementations will at any 22 specific read attempt return either a zero or a one value, we assume that it is not possible to 23 predict what value is returned As the value returned might aiso depend on other factors, 24 including factors external to the card, such as temperature, supply voltage etc , we make no 25 assumptions whatsoever about the values returned by read attempts 26 The state transitions are also shown in figure 1 1 A bit in the 0 state 1100 will 27 transition to the state 1102 through state transition 1110 at the start of a write operation 2β which attempts to write a 1 into this bit The bit remains in the 9 state for the duration of 2β the write operation A bit in the state 1102 will transition to the 1 state 1101 via transition so 1111 at the end of a write operation which attempts to write a 1 into this bit A bit in the 1 3i state 1101 transitions to the 9 state 1102 via transition 1112 at the start of a wipe operation 32 on a block of bits that contains this bit A bit in the 9 state 1102 transitions to the 0 state 33 1100 via transition 1113 at the end of a wipe operation on a block of bits that contains this ι bit. If the write or wipe operation is interrupted for any reason, the transitions 1111 and 2 1113 respectively are not made and the bit remains in the ? state 1102. 3 Under influence of UV radiation, any bit in the 1 state 1101 can also transition via 4 1112 to the 9 state 1102, and from the ? state 1102, via 1113, to the 0 state 1100. s As will be obvious to someone ordinarily skilled in the art, this model applies, or can β be applied to a wide variety of non-volatile memory technologies. BROKEN MODE 7 In the prefeσed embodiment, the card has two basic modes, which we call 'broken' β and 'not broken'. This mode is indicated by the NBROK variable 1234. This is a single-bit 9 variable in non-volatile memory which occupies a whole block of bits so that it can be ιo wiped without influencing any other variables in memory. Under normal circumstances, the ii card is in the 'not broken' mode, and the NBROK variable 1234 contains a value of 1. 12 During the personalization ofthe card, this variable is set to a l value. The 'broken' mode is when the NBROK variable 1234 is zero will described more fully later. MULTI-UPDATES 1 The variables CLCOM (1235) and CLCAN (1236) each consists of an aσay of bits, is one bit for every frame slot on the non-volatile memory. In the default state all the bits are iβ 0. The variables NTU (1231) and COM (1232) are both single-bit variables which occupy 17 an entire block of bits so that they can be individually written and wiped. The VNIU (1241) iβ variable is a single bit variable in volatile memory. 19 Figure 18 shows the process of finding a frame in the prefeσed embodiment. At the 20 start 1800 the variable 't' contains the value ofthe tag ofthe frame to be found in the non- 21 volatile storage. First, in step 1801 two new variables are initialized: a counter 'nr_found' 22 which indicates how many frames were found, which is initialized to zero, and an index 23 counter 'idx' which will run over all frame slot indexes, which is initialized with the index 24 value ofthe first frame. Next is a loop, comprising items 1802, 1803, 1804, 1805 which 25 searches for frame slots with a tag value equal to 't', for which the associated bit in the 26 CLCOM variable is 0. First, in step 1802 the frame slot with index 'idx' is inspected to see 27 if the tag field contains the value 't', and whether the bit associated with that frame slot in 2β the variable CLCOM is 0. If this is not the case, the process continues at item 1804. If this 29 is the case, a frame slot has been found and the process continues at item 1803. At step 30 1803 the counter 'nr_found' is incremented by one, and the cuσent value of 'idx' is ι assigned to a variable called 'store_idx', after which the process continues at step 1804. 2 Step 1804 checks whether the frame just inspected by step 1802 was the last frame. If this 3 is the case, the process continues at step 1810, otherwise it continues at step 1805. At step 4 1805 the 'idx' variable is incremented by one to the next index value, and processing s continues at step 1802. The result ofthe process so far is that the variable 'nr_found' β contains the number of frame slots that exist in the non-volatile memory whose tag value is 7 equal to 't' and whose representative bit in the CLCOM variable is zero. If the 'nr_found' s variable is greater then zero, then the 'store_idx' variable contains the index of one ofthe 9 frame slots found. ιo Steps 1810, 1811, 1820, 1830, 1840 decide which action should be taken based on ii the results ofthe earlier loop. In step 1810, the counter 'nr_found' is checked for a zero 12 value. If 'nr_found' is zero, the process continues at step 1820 which sets the return value 13 to indicate that no frame was found. If step 1810 determines that 'nr_found' is not zero, i4 the process continues at step 1811 which checks whether 'nr_found' is greater then one is and 't' is unequal to zero. If this is the case, the process continues at step 1840 which 16 wipes the NBROK variable to 0 to enter the 'broken' mode, and jumps to the reset process i7 for proper 'broken' mode processing. If in step 1811 the condition is false, the process 18 continues at step 1830 which sets the return value to indicate that a frame was found. The 19 process of finding a frame is terminated at step 1850 which occurs after either step 1820 or 20 step 1830. 21 The process of reading a frame in the prefeσed embodiment is shown in figure 19. At 22 the start 1900 the variable 't' contains the frame to be read. The first step 1901 consists of 23 executing the find frame process (as shown in figure 18) to search for a frame with tag 't'. 24 Next, step 1902 determines whether a frame was found. If no frame was found, the process 25 continues at step 1910 which sets the return value to indicate that no frame was found. If 2β step 1902 determines that a frame was found, the process continues at step 1903. This step 27 retrieves the data from the frame slot, using the variable 'storejdx' which was set by the 2β 'find frame' process of step 1901 to locate the proper frame slot. It then checks whether 29 the checksum field has the right value. If this is not the case, the process continues at step 30 1930 which wipes the NBROK variable to 0 to enter the 'broken' mode, and jumps to the 3i reset process for proper 'broken' mode processing. If step 1903 finds the right checksum 32 value, the process continues with step 1920 which sets the return value to the frame data ι and indicates that the frame was found. The process of reading a frame is terminated at step 2 1940 which occurs after either step 1910 or 1920. 3 Figure 13 shows the process of starting an update sequence in the prefeσed embodi- 4 ment. At the start of this process 1300 another update can already be in progress, in that 5 case both updates are combined into a single multi-update. In step 1301 the variable VNIU β is inspected. If it is not equal to 1, then another update is already in progress, and no new 7 update needs to be initialized; the process continues at step 1310. If step 1301 finds that β the variable VNIU has a value of 1, it continues processing at step 1302. Step 1302 sets 9 both NTU and VNIU to zero, after which it continues with step 1310. Step 1310 terminates ιo the process. i Figure 14 shows the process of deleting a frame in a frame slot in the prefeσed 12 embodiment. At the start 1400 the variable 'i' contains the slot index number of the frame i3 slot in which the frame to be deleted resides. The first action 1401 is to execute the 'start 14 update' process as shown in figure 13 to be sure an update is in progress. In next step 1402 is the i'th bit of the CLCOM variable is set to 1 , after which the process terminates in step iβ 1410. i7 Figure 15 shows the process of writing data in a frame in the prefeσed embodiment. iβ At the start 1500 the variable 't' contains the tag value ofthe frame to be written, the i9 variable 'access' contains the access control code for the frame to be written, and the 20 variable 'data' contains the data for the frame to be written. The first step 1501 executes 21 the 'start update' process shown in figure 13. The next step 1502 executes the 'find frame' 22 process of figure 18 to locate any existing frame with the same tag value. The next step 23 1503 inspects the return value ofthe 'find frame' process to determine whether a frame 24 was found. If this is not the case, the process continues with step 1506. If step 1503 2s determines that a frame was found, the process continues with step 1505. Step 1505 2β executes the 'delete frame' process for the frame slot which contains the frame that was 27 found in step 1502. The index value ofthe frame slot that was found was stored in the 2β variable 'store_idx' by the 'find frame' process and is used here as an input to the 'delete 2β frame' process to indicate which frame slot should be deleted. After step 1505 the process so continues at step 1506. Step 1506 consists ofthe 'find frame' process of figure 18 to 31 search for a frame slot with a tag field value of zero. The next step 1507 inspects the result 32 of step 1506 to determine if such a frame slot was found. If no frame slot was found, the 33 process continues with step 1520 which jumps to the cancel process of figure 8, which will ι be described more fully later. If step 1507 determines that a frame slot was found, the 2 process continues with step 1508. In step 1508 the bit coσesponding to the frame slot that 3 was found by step 1506 is set in the CLCAN variable. The index number ofthe frame that 4 was found by step 1506 was stored in the 'store dx' variable, which is now used to set the 5 proper bit. The next step 1509 writes new data in the frame slot which was found by step β 1506. The tag field, access field and data field are written with the value ofthe 't' variable, 7 'access' variable and 'data' variable respectively. The checksum field ofthe frame slot is β written with the proper checksum value. The next step 1552 terminates the process. Figure 17 shows the 'commit' process in the prefeσed embodiment. The process o starts at step 1700 and continues at step 1701 which determines whether the VNIU variable ii is equal to 1. If this is the case, the process continues at step 1730. If step 1701 finds VNIU 12 to be equal to zero, the process continues at step 1710 In step 1710 the first action is to 13 set the COM variable to l . The CLCAN variable is then wiped to 0. Next, for each bit in 14 the CLCOM variable which is equal to 1, the frame slot that is associated with that bit is is cleared. Clearing a frame slot consists of wiping the tag field to a 0 value. Subsequently, i6 the CLCOM variable is wiped to 0, after which the COM variable is reset to 0. Processing i7 the continues at step 1721 which sets the NIU variable to 1. The next step 1722 sets the iβ VNIU variable to 1, and the process continues at step 1730. Step 1730 terminates the i9 commit process. 20 Figure 8 shows the 'cancel' process in the prefeσed embodiment. The process starts 21 at step 1750. The next step 1751 determines whether the VNIU variable is equal to 1. If 22 this is the case, the process continues at step 1770. If step 1751 determines that VNIU is 23 not equal to 1, it continues at step 1751. In step 1751, the first action is to wipe the COM 2 variable to 0. Then the CLCOM variable is wiped to 0. Next, for each bit in the CLCAN 25 variable which is equal to 1, the frame slot that is associated with that bit is cleared. 25 Clearing a frame slot consists of wiping the tag field to a 0 value. The last action in step 27 1751 is wiping the CLCAN variable to 0. After step 1751 the NIU variable is set to 1 in 2β step 1761. The next step is 1762 where the VNIU variable is set to 1. The process then 29 continues at step 1770. In step 1770 the 'cancel' process is terminated. ao Figure 16 shows the 'reset' process in the preferred embodiment. The process starts 31 at 1600. The next step 1601 inspects the NBROK variable to determine whether its value is 32 equal to 1. If this is not the case, the process continues with step 1610 in which the 33 NBROK variable is wiped to zero. After step 1610 the next step is 1611 which sends all ι public data in the non-volatile memory to the terminal. After step 1611 the process 2 continues again at step 1611 in an infinite loop. If step 1601 determines that NBROK is 3 equal to 1, the process continues at step 1602. Step 1602 inspects the NIU variable to 4 determine whether it is equal to 1. If this is the case, the process continues at step 1641. If 5 step 1602 finds that NIU is not equal to 1 the process continues at step 1603. Step 1603 β inspects the COM variable to determine whether it is equal to 1. If this is the case, the process continues at step 1630. If this is not the case, the process continues at step 1620. β In step 1620 the first action is to wipe the COM variable to 0. Then, the CLCOM variable 9 is wiped to 0, after which all frame slots whose representative bit in the CLCAN variable ιo are 1 are cleared. Clearing a frame slot consists of wiping the tag field to a 0 value. After ii this, the CLCAN variable is wiped to zero, and the process continues at step 1640. In step i2 1630 the first action is to set the COM variable to 1 Then, the CLCAN variable is wiped to is 0, after which all frame slots whose representative bit in the CLCOM variable are 1 are i4 cleared. Next the CLCOM variable is wiped to 0, and finally the COM variable is wiped to is 0. The process continues at step 1640. In step 1640 the variable NIU is set to 1, and the iβ process continues at step 1641. In step 1641 the variable VNIU is set to 1, after which the 17 process is terminated in step 1650 The 'reset' process functions either as a 'cancel' iβ process if no commit was in progress, or as a 'commit' process if a commit was in 19 progress. 20 The 'commit', 'cancel' and 'reset' processes together also keep counters which 21 indicate how many times a 'commit' process was completed, and how many times a 22 'cancel' process was completed. These counters are stored in a frame, which is updated 23 after each 'commit' or 'cancel' process (this includes the 'commit' and 'cancel' parts ofthe 2 'reset' process). The details of these counters and their updates have not been shown for 25 clarity. The counters are used to generate unique challenges. 2β In the prefeσed embodiment, the 'reset' process is executed after any interruption. 27 For example, but without limitation, when the card is powered up, or after a reset ofthe 2β card. A multi-update typically consists of a sequence of 'read frame', 'delete frame' and 2 'write frame' processes in any order. A multi-update is usually terminated with a 'commit' so process or a 'cancel' process. If the card is interrupted during a multi-update, it will resume 31 with the 'reset' process after the interruption. 32 It is believed that the processes shown in figures 8, 13, 14, 15, 16, 17, 18, and 19 33 together provide the following functionality: Frames can be read using the 'read frame' ι process at any time. The data returned will always be the data that was last written with 2 that tag value. The first 'delete frame' or 'write frame' process starts a multi-update. After 3 a 'delete frame' process, the frame that was deleted can no longer be read using the 'read 4 frame' process. After a 'write frame' process, the data returned by the 'read frame' process 5 is the data last written with that tag value. If a 'cancel' process is executed, all β modifications done in the multi-update are reversed. The 'read frame' process will now return the same information as it did before the start of the multi-update. If the multi- β update is interrupted, then the 'reset' process which is executed after each interruption has Θ the same effect as a 'cancel' process would have had before the interruption: all ιo modifications to the data in the storage system are reversed. If a multi-update is terminated ii with a 'commit' process, then all modifications are retained, and it is no longer possible to i2 reverse the modifications. If a 'reset' process is executed after a 'commit' process, the 13 modifications are all retained. Assuming a non-volatile memory model as shown in figure i4 1 1, if the card is (possibly repeatedly) interrupted at arbitrary moments during the is processes mentioned, it is believed that the effect will either be that of a 'commit' process iβ at the end of a multi-update, or that of a 'cancel' process at the end ofthe multi-update. 17 Furthermore, unless the 'commit' process was already started, the effect will always be that iβ of a 'cancel' process. This provides what is usually called an atomic update of a database. 19 Either all the changes are made, or none ofthe changes are made. This property is retained 20 even under arbitrary interruptions. 2i It is believed that the effects of UV erasing as shown in figure 1 1 are limited to the 22 following effects: Frames can be erased, and in any multi-update the update of any one 23 frame can be prevented. This implies that the atomic update property is lost under UV 24 erasing. However, it is believed that any practical UV erasing will result with high 2s probability in the card entering the 'broken' mode It is furthermore believed that UV 26 erasing can never be used to create new frames, or alter the data of a frame SESSIONS 27 The basic structure of a session as implemented in the prefeσed embodiment is 2β shown in figure 24. A session starts of with a 'start session & proof keys' process 2401. 29 Then follows one or more 'command & data exchange' processes 2402, after which the so session is terminated by a 'commit session & end session' process 2403. Both the card and 31 the terminal are involved in a session. Each of these participants keeps a session state as ι will be described more fully later. Throughout the session, the session states kept by the 2 card and the terminal should be identical. As will be described more fully later, the session 3 states on both sides are updated using a chaining function which has been chosen in such a 4 way that it implements an iterative cryptographic hash function. The puφose of a session is 5 to link several independent actions together in such a way that they behave as a single β indivisable action. An independent action can be any type of action, and could even be a 7 session itself. Typically an independent action would be a fairly simple actions, such as β reading or writing a frame, but it is believed that some applications require the use of fairly complex independent actions. ιo The 'start session & proof keys' process as implemented in the prefeσed embodiment i is shown in figure 25. This process involves the terminal 103 which executes steps 2501 12 and 2505, and the card 102 which executes steps 2503 and 2507. The process starts at step 13 2501. The terminal selects which keys will be used in the session, and chooses a terminal 14 challenge value. As the last action of step 2501 the terminal sends the terminal challenge is value and the choice of keys to the card in message 2502. When message 2502 is received iβ by the card, the card starts execution of process step 2503. The first action in step 2503 is i7 to choose a card challenge. Next the session state is initialized to a known value to start the iβ chain. Next, all the keys selected by the terminal in step 2501 and indicated in message 19 2502 are chained. As described more fully later, the chaining involves using a chaining 20 function to update the session state based on the other data (in this case the keys). The next 21 action is to chain the terminal challenge, and then the card challenge. As the last action of 22 step 2503 the card sends the card challenge in message 2504 to the terminal. When 23 message 2504 is received by the terminal, the terminal starts execution of process step 24 2505. In step 2505 the first action is to initialize the session state to the same starting value 25 as used by the card to initialize the session state. Next, all the keys selected in step 2501 are 2β chained, the terminal challenge is chained, and the card challenge is chained. This should 27 result in the session state ofthe terminal having the same value as the session state ofthe 2β card at the completion of step 2503. The next action in step 2505 is to encrypt an 2 authentication code which functions as proof that the terminal has indeed chained the 30 proper keys. The last action in step 2505 is for the terminal to send the proof in message 31 2506 to the card. When the card receives message 2506 it starts execution of step 2507 of 32 the process. The card decrypts the proof sent by the terminal and verifies it against the 33 cuσent sessions state. If this verification fails, the process is aborted. If the verification is ι successful, the card sets a state indicator 'in session', and the process is terminated. The 2 card retains the information regarding which keys were chained during this process, so that 3 it can be used to determine access rights to different frames in this session. The terminal and card challenge values will typically vary over time and can, for example, but without 5 limitation, be chosen using a random generator. In the prefeσed embodiment the card β challenge consists ofthe 'cancel' counter and the 'commit' counter. 7 The keys mentioned above are stored in frames in the card. Each frame that contains β a key is partitioned into two halves. The first half usually contains a diversification number, 9 the second half contains the secret key data. The frame can be read using the standard 'read ιo frame' process, provided the terminal has access as specified by the access field ofthe ii frame. When a frame containing a key is read, the part containing the secret key is replaced 12 by zeroes, preventing the secret key data from being read. For some applications, the key is 13 diversified: the secret key used by the card (and stored in the second half of the key frame) i4 is a function of a master key and the diversification number stored in the first half of the is frame. A terminal with access to the master key first reads the diversification number by iβ reading the key frame, computes the secret key used by the card and can thus start a 17 session with this key. Note that access to the diversification number can be protected by iβ another key by setting the access field ofthe key frame to a proper value. 19 The 'command & exchange data' process as implemented in the prefeσed 20 embodiment is shown in figure 26. Each 'command & exchange data' process consists of 2i an elementary function, for example, but without limitations, reading a frame and writing a 22 frame. The first step ofthe process 2601 is executed by the terminal. The first action is for 23 the terminal to select a command. The last action of step 2601 is for the terminal to send 24 the command data to the card in message 2602. When message 2602 is received by the 25 card, it start execution of process step 2603. The first action in this step is for the card to 26 check whether it is in a session. If this check fails, the process is aborted, otherwise the 2 process continues with the next action The command data received in message 2602 is 2β chained (thus updating the session state) and the command is executed. Execution of the 29 command can involve several actions, for example, but without limitation, the reading, 30 deleting and writing of frames, as shown in figures 19, 14, and 15. Any response data from 3i the card to the terminal is then chained. As the last action of step 2603 the card sends the 32 response data in message 2604 to the terminal. Upon reception of message 2604 the 33 terminal starts execution of process step 2605. The first action is to chain the command ι data originally sent to the card. The next action is to chain the response data ofthe card. 2 The process is then terminated. The command data and the response data are also 3 encrypted using the then-cuσent session state as a key, but this is not shown for clarity. If 4 the command involves access to frames, then the card verifies whether the key which is 5 required for that operation was used in the 'start session & proof keys' process of this β session. For example, if the terminal reads a frame, the card ensures that the keys used to 7 create the session state allow read access to the frame using the 'access' field ofthe frame. β A similar verification is made for writing and deleting frames. 9 The 'commit session & end session' process as implemented in the prefeσed embodi- ιo ment is shown in figure 27. In the first step of this process 2701 the terminal chains the ii command code for this process. It then encrypts a proof using the cuσent session state. As i2 a last action in step 2701 the terminal sends the proof to the card in message 2702. Upon 13 reception of message 2702 the card starts execution of process step 2703. The card also i chains the command code for this process, and the decrypts the proof sent by the card in is message 2702. If the proof is invalid, the process is aborted, otherwise it is continued. The iβ card then increments a commit counter and encrypts a second proof using the session state. 17 Optionally the card also creates a public proof 'proof P\ and stores these proofs in non- ιβ volatile memory. The last action in step 2703 is to send a message 2704 to the terminal i9 indicating the card is ready to commit to the session. Upon reception of message 2704 the 20 card starts execution of process step 2705. The only action in this step is for the terminal to 21 send a message 2706 to the card indicating it should commit to the session. Upon reception 22 of message 2706 the card starts execution of process step 2707. The first action is to set 23 the COM variable to one. This is in fact the first action of step 2710 in figure 17 which 24 shows the 'commit' process, all other actions already explained in figure 17 not being 25 shown for clarity. At the same time the NDONE variable is set to one, indicating that the 2β proof of this session has not successfully been sent to the terminal. Setting the NDONE 27 variable and the COM variable should be atomic, which is achieved by setting the NDONE 2β variable in the 'commit' process, in the 'reset' process if it finds the COM variable to be 29 one. The NDONE bit is set to zero during the 'cancel' process and the 'reset' process if it so finds the COM variable to be zero. The card then sends the second proof, and optionally 31 the public proof to the terminal in message 2708, after which the card completes the 32 'commit' process of figure 17. Upon reception of message 2708 the terminal starts 33 execution of process step 2709. This involves decrypting the second proof, and optionally ι the public proof. If the proofs are satisfactory, the terminal sends a message 2710 to the 2 card. Upon reception of message 2710 the card starts execution of process step 2711 3 which clears the NDONE bit to 0. As will be obvious to someone ordinarilly skilled in the art, the NDONE bit can also be stored in a frame which is always updated during a session, s This automatically solves the problem of setting the NDONE and COM variables at the β same time. 7 This process is only relevant for sessions in which a frame was written or deleted. An β update ofthe frame system, as described earlier, will start at the first write or delete 9 operation. The 'commit session & end session' process is the usual way in which the ιo 'commit' process of figure 17 is executed which then terminates the update. ii As long as the NDONE bit is one, the terminal can ask the card to re-send the second i2 proof, and optionally the public proof, both of which are still retained by the card. This is i3 shown in figure 32. The process starts at step 3200 in which the terminal sends the 'Get 1 Proof command to the card in message 3201. Upon reception of message 3201 the card is starts execution of process step 3202. If the NDONE bit is still one, and thus the proofs are 16 still available, the card sends the proofs to the terminal in message 3203. If the NDONE bit i7 is zero, then no proofs are sent. When the terminal receives message 3203 it starts iβ execution of process step 3204 in which it verifies the proofs and sends the 'Done' 19 command to the card in message 3205 Upon reception of message 3205 the card starts 20 execution of process step 3206 in which it sets the NDONE bit to zero. This implies that 21 the proofs can no longer be read by the terminal. 22 It is believed that step 2705 and the messages 2704 and 2706 allow the terminal to 23 bring the card to the very edge ofthe commit without actually doing it. It is believed that if 24 at this point the terminal resets the card, then all frames revert to the value they had before 25 the session, as the COM variable has not yet been set. It is believed that the additional step 2β 2705 decreases the amount of time between the final message from the terminal to the card, 27 and the sending ofthe proof in message 2708 It is believed that the setting ofthe COM bit 2B in step 2707 has the result of both updating all the frames to their new value and enabling 29 the proof to be sent. so The session state, which is maintained both by the card and the terminal, is used to 31 link all the actions in a session together. Figure 20 shows the basic idea. Suppose the 32 terminal wants to read a specific frame from the card in a 'command & exchange data' 33 process of figure 26. The actions of the card are shown in as item 2000 and the actions of ι the terminal are shown as item 2020. The card takes the existing session state 2011 and the 2 data read from the frame 2013 as inputs to a function 2010. This function combines the 3 existing session state 2011 with the data 2013 and yields a new session state 2012. The 4 same two inputs are also combined in a different way to yield the encrypted data 2014 5 which the card sends to the terminal. The terminal has a similar process in which the β existing session state ofthe terminal 2031 and the encrypted data just received from the card 2033 are used as inputs to a function 2030 which yields both a new session state 2032 β and the decrypted data 2034. These functions are chosen in such a way that if the existing session states 2011, and 2031 are identical, then the two new session states 2012, and 203 ιo are identical, and the decrypted data 2034 is identical to the original data input 2013 Whe ii the terminal sends data to the card, the same system with the roles reversed is used. The 12 updating of the session state is the chaining refeσed to earlier. The functions 2010 and 13 2030 are chosen in such a way that they implement an iterative cryptographic hash functio 14 on the data that passes through them, the session state being the hash output. is In figure 20 there are two functions 2010 and 2030. As the card can be both sender iβ and recipient, it would need an implementation of both functions. To simplify this, the i7 prefeσed embodiment uses the solution in figure 21. The card has an implementation ofth iβ function 2110, and the terminal an implementation of box 2130 The existing session state 1 is still used as inputs 2111 and 2131 to the functions, and both yield the new session state 20 2112 and 2132 as outputs. When the card wants to send data to the terminal, it uses the 21 data input value 2113. Function 2110 updates the session state, and encrypts the data 22 depending on the session state and outputs the encrypted data as 2114. This value is sent t 23 the terminal, which uses it as input 2133 to function 2130 which also updates the session 24 state and decrypts the data to provide output value 2134. Functions 2130 and 2110 are 2s such that, if the existing session states 2111 and 2131 are identical, the output data 2134 is 26 equal to the input data 2113, and the new session states 2112 and 2132 are also identical. I 27 the terminal wants to send data to the card, it uses the data as input 2133, and the existing 2β session state as input 2131. The function 2130 has two output values, 2132 which is the 29 new session state, and 2134 which is the encrypted data. The terminal sends the encrypted so data to the card, which uses it as input 2113 to function 2110 (which takes the existing 31 session state as input 2111). Function 2110 yields two outputs, the new session state 2112 32 and the decrypted data 2114. Functions 2110 and 2130 are such that in this case too, if the ι existing session states 2111 and 2131 are identical, then the data output 2114 is equal to 2 the data input 2133, and the new session states 2112 and 2132 are also identical. Thus, the 3 same function is used for both sending and receiving 4 The construction of function 2110 in the prefeσed embodiment is shown in figure 22. s Item 2200 corresponds to function 2110. It takes two inputs, the existing session state β 2201 and the data input 2202, and yields two result values, the new session state 2204 and 7 the data output 2203. The session state 2201 is used as input to a cryptographic oneway β function 2210 marked 'ksb' which produces the encryption/decryption value 2211. This is xoσed with the data input 2202 by function 2212 which yields the data output value 2203. ιo The data output value 2203 and the existing session state 2201 are then used as input to the ii chain function 2213 which yields the new session state 2204 as an output. In the prefeσed 12 embodiment, both the oneway function 2210 and the chain function 2213 are different 13 functions every time this function is computed in a session. 14 The construction of function 2130 in the prefeσed embodiment is shown in figure 23 is Item 2300 corresponds to function 2130. It takes two input values, the existing session iβ state 2301 and the data input 2302 and yields two result values: the new session state 2304 17 and the data output 2303. The existing session state 2301 is used as input to a iβ cryptographic oneway function 2310 marked 'ksb' which yields the encryption decryption i9 value 2311 which is xoσed with the data input 2302 by function 2312, yielding the data 20 output 2303 The existing session state 2301 and the data input 2302 are used as input to 2i the chain function 2313, which yields the new session state 2304 as output. The constituent 22 building blocks of function 2300 and 2200 are identical in their functionality. 23 It is believed that the session system provides the following functionality: The 24 terminal can only start sessions with a keyset for which the terminal has access to all those 25 keys. If the terminal does not have access to the keys, the verification in step 2507 will fail 26 with high probability. If an adversary that has access to only a proper subset ofthe keys in 2 use tries to eavesdrop, she will not be able to read the actual data being exchanged between 2β the card and the terminal as the data is all encrypted using the session state. It is believed to 29 be impractical for the attacker mentioned before to reconstruct the session state without 30 access to all ofthe keys used. If an attacker tries to add certain commands to a session, 3i then the session state ofthe card and the terminal will no longer be the same. This results 3: with high probability in a failed proof in step 2703, which in turn results in an aborted 33 transaction This automatically results in a cancellation of any multi-update that is in ι progress. The session system links all actions together, and ensures that if any data in the 2 card is modified, it is done by exactly the commands chosen by the terminal, and that the 3 commands are executed in order. The terminal can still choose in step 2705 whether to 4 complete the session and commit to all the updates, or to abort the session, and thereby the 5 associated multi-update. If the card is interrupted at any point during a session, the β associated multi-update has not finished which results in the card reverting back to its 7 original state. If the card is interrupted after setting the COM variable to 1 in step 2707, for β example by an inadvertent power down, then the terminal can still recover the second proof (called 'proof 9 ' in figure 27) and the optional public proof. If the card is interrupted before ιo the COM variable was set, the proofs cannot be retrieved from the card. This implies that, ii even under arbitrary interruptions ofthe card, either the multi-update happens and the 12 terminal can read the proofs, or the multi-update is canceled and the terminal does not get i3 the proofs. i4 It is anticipated that the card can store data about past transactions. This information is can later be used for many puφoses, for example, but without limitation, for accounting iβ and testing puφoses, or to possibly reverse the effects of a completed transaction. SECRET KEY DEBIT/REDEBIT i Apart from reading and writing frames, the prefeσed implementation also supports a iβ debit redebit process which makes for an easier implementation of a pre-paid card for 1 payments. This allows a balance register (sometimes called a balance) stored in a frame to 20 be decreased (debited) by a specific amount using a different access key then the key used 2i to write that frame. The redebit process allows the terminal to decrease the previous value 22 ofthe register if, and only if, that terminal was the last one to perform a debit or redebit 23 process on that register, this being protected by some simple authentication codes. During a 2 redebit process the terminal must send the session state that was in use during the previous 25 debit/redebit process on that balance register. As the debit/redebit process usually uses the 2β session proof as a proof that the debit was performed, the usual aσangement is for the 27 terminal to have a tamper-resistant device which has the keys necessary for this process, 2β which keeps track ofthe total amount that has been debited in this way, and which securely 2 stores the temporary key which allows the terminal to execute a redebit process with the so card. A typical application for the redebit function would be for a coffee machine. Once the 31 user has selected the required drink, the terminal debits the card for the amount ofthe drink ι and starts the machine. If the machine fails to provide the drink (for example due to a 2 malfunction) the terminal can do a redebit command with a 0 decrement effectively giving 3 the money back to the owner ofthe card. As both the debit and the redebit process require 4 a different access key then the write-frame process requires, the terminal in the coffee s machine does not need to have access to a key which would also allow the terminal to β increase the value of a card. The details of this process are not shown, and will be obvious 7 to someone ordinarily skilled in the art. CONSTANT TIMING β The main use of tamper resistant computational devices, such as the card in our system, is to keep certain data secret and to securely execute some processes. Even if the ιo function is only to execute some processes securely, the only way for the outside world to ii know that the card actually performed the process and that the results are genuine is for the 12 card to authenticate the results ofthe process. This is generally done using cryptographic is authentication systems, which require the storage and use of some secret key information. 14 Most designs take proper care to ensure that the secret keys are kept secret and not sent is out by the card. However, most designs are done on the level ofthe communication iβ between the card and the interfacing device (terminal). i7 For this section we will assume that the terminal is trying to extract additional iβ information from the card by any means. Apart from the standard communication, the 19 terminal can measure several other things, such as the time between a command and its 20 reply, or the power supply cuσent that the card draws at any moment. These measurements 21 have the potential of revealing more information about the internal operations in the card. 22 It is believed that at least one actual implementation of a smart card suffers from 23 these problems. The card in question has a special co-processor on chip to allow it to do 24 RSA signatures. It is believed that the terminal can determine when the co-processor is 25 being used by measuring the power supply cuσent as a function of time and the electro- 2β magnetic field around the smart card chip. The RSA algorithm involves an exponentiation 2 with a secret exponent. The exponentiation is, in this implementation, done using a square- 2β and-multiply algorithm well known in the art. This algorithm involves a large number of 29 squarings interlaced with a smaller number of multiplications. Measuring the activation 30 times ofthe co-processor allows the terminal to deduce whether the next step is a 31 multiplication or a squaring. With this knowledge the actual secret key used by the card in 32 creating the RSA signature can easily be recovered ι It is believed that public-key algorithms are generally more susceptible to this kind of 2 attack then secret key algorithms, but many secret key based systems still suffer from these 3 attacks. If, for example, a PIN verification routine in a smart card compares each digit in 4 succession and aborts the comparison as soon as a mismatch is found, then the time s between the start ofthe verification command and the 'PIN incoσect' response reveals β which of the digits is wrong. It is believed that this reduces the average number of attempts 7 that have to be made before the right PIN is found in an attack from 5000 to less then 40 β for a 4-digit decimal PIN. Similar attacks are believed to work against certain secret-key 9 based implementations. An obvious solution is to ensure that all processes which might ιo reveal additional information to the terminal are executed in a fixed amount of time. It is ii believed that this can be achieved by inserting properly timed delay loops at appropriate 12 places. 13 It is believed that many existing smart card implementations will reveal the presence i4 of a file or directory on the card by the timing differences of the responses. Even in cases is where the terminal does not have access to said file or directory, the timing ofthe response iβ will differ depending on whether the file or directory exists or whether it does not exist. 17 Furthermore, several smart card implementations will reveal the presence of files and/or iβ directories to any terminal, even if the terminal has no access to the related smart card 19 application It is believed that it is standard practice for a smart card to reveal its identity 20 number to any terminal. It is believed that terminals might use this information to invade 2i the privacy ofthe owner ofthe smart card. 22 It is believed that for least one specific smart card chip it is possible to determine 23 which instruction is being executed by detailed measurements ofthe power supply cuσent 24 as a function of time, allowing the terminal to determine which half of an IF statement was 25 executed, even if the time taken for both branches was the same. As is usual in the art of 2β cryptography, we always assume that the actual code used in the card is known to any 2 attacker. It is a well established principle of cryptography and security systems that the 2β security should only rely on the secrecy of key material, and not on the secrecy ofthe 29 processes applied to the keys. so In the prefeσed implementation the card is careful not to reveal any additional 31 information under these attacks. To ensure security against these attacks the card uses a 32 single execution path. This means that for any process involving information which is not 33 already known to the terminal, and to which the terminal might not have access, the same ι sequence of instructions is always used For example, in the computation of a house such as 2 figure 9, the architecture (number of columns and height of each column) is not secret from 3 the terminal, but the actual values are. For any given architecture, the card always uses the same sequence of instructions to compute the house result value 979 from the house origin s value 901, independent ofthe value ofthe house origin 901 β An example of how this is achieved is given in figure 31 The first process consisting 7 of steps 3100, 3101, 3102 and 3103 show a typical conditional execution sequence β Starting at 3100 the first step 3101 verifies a certain condition 'cond' If this condition is false the process continues at step 3103, otherwise it continues at step 3102. In step 3102 a ιo counter 'cnt' is incremented, and two variables 'savel ' and 'save2' are assigned with ii values 'x' and 'y' respectively After step 3102, processing continues in step 3103 where i the process is terminated The second process consisting of steps 3110, 3111, 3112 shows 13 a functionally equivalent process which does not use a conditional execution construction 14 After the process start in step 3110, the first action in step 3111 is to convert the condition is 'cond' to an integer value which is 0 if the condition is false, and 1 if the condition is true iβ There are standard techniques for converting conditions to such an integer value which are 1 widely used in certain higher-level language implementations In step 3111 the value 'cond' iβ is used to represent this value The counter increment is now replaced by an addition the 19 value 'cond' is added to the counter This has the same effect as incrementing the counter 20 only if 'cond' equals 1 If the condition was false, then 'cond' is 0 and the operation has no 21 effect If the condition was true, 'cond' has a value of 1 and the addition adds exactly one 22 to the value of 'cnt' The action 'savel=x' is converted to a more complex action 23 'savel =cond*x+(l -cond)* savel '. If the condition was false, then 'cond' is equal to 0, and 2 thus 'cond*x' is also equal to zero At the same time '(1-cond)' is equal to 1, and thus '(1- 25 cond)* savel ' is equal to 'savel ' The sum of both expressions is equal to 'savel ', so that 2β the assignment has no effect This is of course equivalent to the skipping of this action in 27 the first process If the condition is true, then 'cond' is equal to 1 and '( 1-cond)' is equal 2β to 0, so that the right hand side ofthe assignment has a value equal to 'x' This is of course 29 equivalent to the action 'savel=x' in the first process which is only executed if the 30 condition is true The third action shows another equivalent formulation, the variable 3i 'save2' is replaced by an aσay with indexes '0' and ' 1 ' The value of 'y' is assigned to 32 'save2[cond]\ which implies that if the condition is true then 'y' is assigned to 'save2[l ]' 33 and if the condition is false then 'y' is assigned to 'save2[0]' If the original 'save2' variable ι is put in the new 'save2[ l ]' and "save2[0]' is discarded after the process, then l save2[l]' 2 will have the same value as the variable 'save2' had after their respective processes, 3 assuming an equivalent starting state. These new actions in step 3111 are called 4 functionally equivalent to the actions in step 3102 which are only executed if the condition 5 'cond' is true. The process terminates in step 3112. β As a more detailed example we will discuss figure 18 which shows the 'find frame' 7 process discussed before. In the prefeσed implementation, this is one ofthe processes that β uses a fixed execution path. The loop consisting of steps 1802, 1803, 1804, and 1805 is g executed a fixed number of times, namely once for each frame slot. The number of frame ιo slots is not a secret, so no special care has to be taken. However, the conditional execution ii by steps 1802 and 1803 might reveal if and where in the memory the frame was found, i2 while this data might not always be available to the terminal. Thus, steps 1802 and 1803 are is implemented in a single execution path using the techniques shown in figure 31. Steps i4 1810, 1811, 1820 and 1830 are also implemented using a single execution path, this is involves rewriting the actions of steps 1820 and 1830 into a single sequence of actions iβ which depends on the values of two conditionals. This is a simple generalization ofthe i7 techniques shown in figure 31 and as will be obvious to someone ordinarily skilled in the iβ art. The jump to step 1840 is not done within the single execution path. This enters 1 'broken' mode, which basically prevents any further normal processing. It is believed that it 20 is unnecessary to hide this fact from the terminal, as it will be quite obvious to the terminal 21 that the card has entered 'broken' mode. 22 In the prefeσed embodiment the single execution path is used for all processes for 23 which the execution path taken might reveal any information to the terminal which the 24 terminal would otherwise not learn. It is believed that this provides the best security against 25 any ofthe attacks mentioned above. Obviously the single execution path does not imply 26 that the same data is always being used in the actions. It is believed that no implementation 27 using secret keys can be protected against an attacker which is able to determine both the 2β execution path, and the data being used in the process. EMV 2β The prefeσed embodiment includes an implementation ofthe EMV system. It is so appreciated that someone of ordinary skill in the art would be familiar with the 3i specifications ofthe EMV system which were referenced earlier. The prefeσed ι embodiment implements the EMV system and incorporates several improvements, among 2 others a dynamic off-line authentication ofthe data sent by the card to the terminal 3 The prefeσed embodiment is shown in figure 28 The process starts at the terminal in 4 step 2800, which is followed by step 2801 in which the terminal asks the card for the 5 application data This request is coded into message 2802 When message 2802 is received β by the card, it starts execution of process step 2803 In step 2803 the card sends the 7 application data requested to the terminal in message 2804 In the EMV system and in the β prefeσed embodiment this sending of application data is actually achieved using several 9 requests in sequence, these are not shown for clarity Upon reception of message 2804 the ιo terminal starts execution of process step 2805 Execution of steps 2805, 2807, 2808, 2809, ii 2811, 2812, 2814, 2816, and 2817 occurs only when the transaction is conducted on-line 12 In the off-line case these steps are omitted (see EMV specifications for more detail) It 13 constructs an authorization request and sends it to the issuer, or a representative ofthe i issuer in message 2806 When message 2806 is received by the issuer, it starts execution of is step 2807, in which it processes the authorization request. The next step 2808 consists of iβ the creation of a valid script for the terminal, after which both the authorization response i7 and the script are sent in step 2809 to the terminal in message 2810 When message 2810 is iβ received by the terminal it start processing of step 2811 In step 2811 the terminal 19 processes the script it received from the issuer, this involves sending the commands and 20 data given in the script to the card and awaiting any response The EMV specifications 21 allows the script to be executed before or after the external authentication in steps 2812, 22 2814 and 2815 Both possibilities are shown in figure 28, and a simple extension would 23 allow two scripts to be used Our prefeσed embodiment typically executes the script in step 24 2811 After step 2811 the terminal in step 2812 sends the authorization code to the card in 25 message 2813 The card verifies the code in step 2814 and sends the result ofthe 26 verification to the terminal in message 2815 Upon reception of message 2815 the terminal 2 executes process step 2816 in which it verifies the response The next step 2817 is again ∑s the execution of a script with the card (see comments for step 2811) All actions described 29 so far are an embodiment ofthe EMV specifications In step 2818 the terminal requests a 30 payment proof of the card, which it sends in message 2819 Upon reception of message si 2819 the card executes step 2820 in which it computes the appropriate payment proof and 32 sends the result to the terminal in message 2821 Upon reception of message 2821 the ι terminal starts execution of process step 2822 in which it verifies the proof of payment, 2 after which processing terminates at step 2823. 3 Most of the steps described above coσespond directly to actions specified in the 4 EMV specs. The prefeσed embodiment adds a dynamic authentication to the EMV s specifications. In the EMV system there is no provision for convincing the terminal of the β authenticity ofthe card and the messages the card sends in the off-line case. The proof of 7 payment of step 2820 (called TC in EMV) is based on a secret key proof, and it is believed s that it is not the intention to let the terminal verify the TC. Therefore, in the off-line case in 9 EMV the terminal is susceptible to replay attacks, as are well known in the art. The ιo prefeσed embodiment uses the compact endorsement signatures to rectify this. In step ii 2820 a second element is added to the payment proof. The TC is still sent, but in addition i2 the card authenticates all the data it sent to the terminal during the transaction using a 13 compact endorsement signature in the variant that can authenticate an arbitrarily long i message, as described earlier. If message 2821 is lost during transmission then the terminal is can ask the card to retransmit the data, in the same manner as the proofs) of a session can iβ be retransmitted, as shown in figure 32. It is believed that the terminal can verify the 17 compact endorsement signature and thus be assured ofthe authenticity ofthe data sent by iβ the card, and therefore also of the correctness ofthe TC. i9 The script that the issuer creates can be used to securely perform a variety of func- 20 tions, a typical application would be the increasing of a balance of some form. The scripts 21 are just a set of commands which the terminal sends to the card. These are chosen in such a 22 way by the issuer that they constitute a session, as described earlier. A direct session 23 between the card and the issuer to increase a balance would involve more then 2 messages 24 between the terminal and the issuer: the start session process alone would require 2 25 messages between the card and the issuer (and therefore between the terminal and the 2β issuer). The old limit would have to be read, and then the new limit written requiring more 27 messages. Most existing networks for financial transaction authorization are built upon a 2 8 message authorization, adding additional messages could lead to complications. The 2 prefeσed embodiment uses the sessions in a different way, allowing the increase to occur so using the existing sessions and using only 2 messages between the terminal and the issuer. 31 As mentioned before, the card challenge consists of some counters. These counter values 32 are included in the data sent in messages 2804 and 2806. The issuer now has enough 33 information to simulate the behaviour of the card in the session, specifically it knows the ι card challenge that the card will use. This allows the issuer to generate all necessary 2 messages for the successful completion of a session. Instead of a special 'add amount to 3 balance' function, the prefeσed embodiment uses the standard read frame and write frame functions. To this end, the cuσent value ofthe balance is also included in messages 2804 5 and 2806. The issuer includes a 'read frame' function in the script. The issuer already e knows the answer, but the answer is also chained into the session state, as described earlier. 7 If the balance was changed to a different value before the execution ofthe script, this will β result in a different chain state in the card, which results in a failed proof in the 'commit 9 session & end session' process. As an example, but without limitation, a complete script ιo would consist of a 'start session & proof keys' command, a 'read frame' on the balance, a ii 'write frame' on the balance, and a 'commit session & end session' command. To prevent 12 the terminal from withholding the script, the authorization code sent in message 2813 i3 depends on the data ofthe script, so that the authorization will fail if the terminal does not 14 execute the script. As will be obvious to someone ordinarilly skilled in the art, the is authorization code can also be used to notify the card that a script is to be performed in iβ step 2817. i7 The process of performing a script is shown in more detail in figure 33. The process iβ begins at step 3300 at the terminal and continues at step 3301 where the terminal sets an 19 index variable 'n' to zero. The next step 3302 checks whether the 'n'th command in the 20 script exists. If the 'n'th command does not exist, processing continues at step 3309. If the 2i 'n'th command does exist, processing continues at step 3303. In step 3303 the terminal 22 sends the command and associated data ofthe 'n'th command in the script to the terminal 23 in message 3304. Upon reception of message 3304 the card starts processing of step 3305 24 in which it performs the actions associated with the command and sends the response to the 25 terminal in message 3306. Upon reception of message 3306 the terminal starts processing 26 of step 3307, in which it checks the response message for an error code. If the card 27 reported an error, processing continues at step 3310 If the card did not report an eσor, the 2β process continues at step 3308, in which the terminal increments the 'n' variable by one. 29 The process then continues at step 3302. In step 3309 the terminal signals a successful 30 completion ofthe script process. In step 3310 the terminal signals a failure in the script 3i process. In either case the process continues with step 3311 where the process is 32 terminated. ι The EMV specifications include some unspecified 'risk management' which the card 2 performs, some specific 'risk management' which the terminal performs, an unspecified 3 authorization process which the issuer performs for on-line transactions. The prefeσed 4 embodiment uses a general structure which can be used to implement both credit card 5 transactions, pre-paid debit card transactions, ATM card transactions etc. The card keeps a β balance representing the amount that can still be spent using that application. In every 7 successful payment, the card decreases this balance by the amount ofthe payment. The 8 card will refuse an off-line payment for an amount that exceeds the balance in the card, and 9 will request an on-line transaction. To increase the balance of the card, the issuer can send ιo the appropriate commands in the script which increase the balance. In the prefeσed ii embodiment the card increases the ATC (Application Transaction Counter) only for 12 successfully completed transactions. 13 In the prefeσed embodiment, once the the card has issued an ARQC and thus asked 1 for an on-line transaction, the card will not perform any off-line transactions until a is successful on-line transaction has been completed. iβ In the prefeσed embodiment the issuer keeps a database of all on-line requests, and 1 of all the payment data it receives from the terminals (possibly through the acquirer) iβ relating to off-line payments. For any off-line or on-line payment, the ATC value ofthe i card is included in the data that reaches the issuer. For on-line transactions, the balance of 20 the card is included in the data that is sent to the issuer. The information related to different 2i transactions might reach the issuer in a non-chronological order. As the card increases the 22 ATC only for successful transactions, the issuer knows exactly how many 'previous' 23 transactions it can still expect. Specifically, in any on-line transaction, the issuer learns the 24 cuσent ATC ofthe card, and therefore knows how many off-line transactions the card 25 made since the previous on-line transaction. The issuer also learns the cuσent balance of 2β the card, and can thus determine the total amount ofthe off-line transactions since the 27 previous on-line transaction. It is believed that this provides adequate information to the 2β issuer to make the necessary decisions for the on-line transaction, and any possible script to 29 increase the balance on the card. so The interaction between the card and the issuer are shown in figure 47. This shows 3i the card 4700, the terminal 4704 and the issuer 4706. The card has a balance (CB) 4701, a 32 cryptogram counter (ATC) 4702 and some card counters 4703. In the prefeσed 33 embodiment there are two counters, one of them is incremented for each 'commit' process, ι the other is incremented during each 'commit' or 'cancel' process. These counters are used 2 as the card challenge in the sessions. The card and terminal communicate over 3 communication channel 4720; the terminal and the issuer communicate over 4 communication channel 4721. During a transaction the terminal typically sends a single 5 message to the issuer, which replies with a single message. The issuer uses three databases: β the card base 4708, the event base 4709 and the terminal base 4710, and communicates 7 with those data bases using communication channel 4722. The terminal base contains data β associated with each terminal, and is not shown in detail for clarity. Figure 48 shows the 9 data fields of a record in the card base. The first field 4800 contains the primary account ιo number (PAN) and the sequence number. This is a unique identification ofthe card, the ii primary account number usually corresponds to the credit card number, or bank account i2 number, while the sequence number distinguishes several cards that use the same PAN, for is example, but without limitation, two credit cards on the same account. The next field 4801 14 contains information about the card status and configuration, which is not shown in detail is for clarity. In field 4802 the highest known ATC ofthe card is stored. Field 4803 stores the iβ ATC value ofthe last completed on-line transaction, that is, for which the issuer has i7 received the coσesponding TC. In field 4804 the issuer stores the ATC value for the last iβ ARQC it received. In field 4805 the issuer maintains the known card balance KCB, which 19 is the issuers best approximation ofthe cuσent balance of the card. The last field 4806 20 contains a settling amount SA, which is the amount the issuer plans to add to the card's 21 balance in the next on-line transaction. Figure 49 shows the fields of a record ofthe event 22 base, each record representing an event. The first field 4900 contains the PAN and 23 sequence number, which uniquely identifies the card. The field 4901 contains the ATC of 24 the event, field 4902 the status ofthe event, field 4903 the amount ofthe event, field 4904 25 the card counter values for the event, field 4905 the card's balance during the event, and 2β finally field 4906 the settling data for the event. 2 Figure 50 shows a global overview ofthe issuer processing during an on-line transac- 2β tion. In the first step 5000 the issuer receives the authorization request for the transaction, 29 including terminal data and card data. The terminal data typically includes the terminal 30 identity; the card data typically includes the PAN and sequence number, the amount ofthe 31 transaction, the cuσent value ofthe card counters, the card balance, the cuσent ate etc. In 2 the next step 5001 the issuer makes some elementary checks on the validity ofthe data 33 received. In step 5002 the issuer updates the known balance KCB based on the actual care ι balance CB. In step 5004 the issuer checks for a settling amount for the card, and adds it to 2 the script amount. In step 5005 the issuer decides whether or not to accept the transaction, 3 and finally in step 5006 the issuer sends the authorization for the transaction to the 4 terminal, with an optional script to perform any necessary adjustments ofthe balance. s Figure 51 shows a global overview of the issuer processing when it receives the transaction β data relating to an off-line transaction from a terminal. In the first step 5100 the issuer 7 receives the transaction data, which typically includes a terminal identifier, card data, the β amount and a transaction cryptogram. In the next step 5101 the issuer checks the validity of the terminal and card data. In step 5102 the issuer checks the validity ofthe transaction, ιo among other things it checks that the cryptogram is coσect. In the final step 5103 the ii issuer updates the known card balance KCB based on the card balance given with the 12 transaction. i3 Figure 52 is in two parts, shown as figure 52 A and figure 52B. It shows a more i4 detailed description ofthe issuer processing during an on-line transaction shown in less is detail in figure 50. Some steps of this processing are not shown for clarity. The first step iβ 5200 is the start ofthe process. At this point the issuer has already received the i7 authorization request, including the card identity, the terminal identity, the ATC, the iβ ARQC, the amount, the card counters, the card balance CB etc. In the next step 5201 the 1 issuer sets a variables called 'script amount' to zero, and a variable called 'temp kcb' to the 20 given card balance CB. The 'script amount' variable will contain the amount for which a 21 script will be generated, the 'temp kcb' is used to update the KCB stored by the issuer. The 22 issuer looks up the record for the card in question in the card base, and also the record for 23 the terminal in question in the terminal base. The issuer verifies that the ARQC cryptogram 24 is valid, that the terminal is valid, that the card is valid, that the card has not exceeded its 25 expiration date and that the card has not been blocked. In the next step 5202 the issuer 2β checks whether the HATC (highest known ate) is less then the current ATC. If this is not 27 the case the process continues at step 5213, as indicated by the labels 5250 and 5212. In 2β this case the ATC of the card is lower then the highest known ATC from that card, so the 29 card's ATC must have decreased. A proper functioning card never decreases the ATC, so so this is classified as an 'card fraud detect', an attempted fraud by the card, which is practice 31 means that the tamper-resistance ofthe card must have been broken, that the card must 32 have malfunctioned, or that something else in the system is wrong. If the condition in step 33 5202 is true, the process continues at step 5203. In step 5203 the issuer checks whether the ι ATC is equal to the ATC ofthe last authorization request. If this is the case, processing 2 continues at step 5204, if this is not the case processing continues at step 5214. If the ATC 3 is equal to the LAATC, then the last transaction was not completed successfully, as the 4 ATC would have increased had it completed successfully. Thus, getting a second s authorization request with the same ATC value implies that the previous transaction was β not completed. It is, however, possible that the script was executed but the transaction 7 didn't complete. As all scripts in the prefeσed embodiment modify the card balance, the s issuer can detect whether the script was performed or not. It is anticipated that for scripts 9 that do not modify the balance, some other value will be used for this function. In the ιo prefeσed embodiment, the card will not perform an off-line transaction after a failed on-line ii transaction, so no off-line transactions can occur between a failed on-line transaction and i2 the next on-line transaction. In step 5204 the issuer checks whether a script was issued 13 during the last authorization request, by looking up the recorded events in the event base. If i4 no script was issued, and thus no update of the CB is still outstanding, the process is continues at step 5205, otherwise it continues at step 5206. In step 5205 the issuer checks iβ whether the balance recorded in the event base for the last authorization request is the same 17 as the cuσent card balance. If this is not the case, processing continues at step 5213 (via iβ 5210 and 5212). Otherwise, processing continues at step 5223 (via 5211 and 5222). In step i9 5206 the issuer checks whether the CB is equal to the balance recorded in the event base 20 during the previous authorization request. If this is the case, processing continues at step 21 5208, otherwise it continues at step 5207. In step 5207 the issuer checks whether the card 22 balance is the sum ofthe balance recorded for the previous authorization request and the 23 update amount ofthe script issued during that authorization process. If this is not the case, 24 the card balance has changed in an inexplicable way, and processing continues at step 5213 25 (via 5210 and 5212), otherwise processing continues at step 5209. In step 5208, the issuer 26 knows that the script ofthe previous on-line transaction was not completed, and adds the 27 update amount of that script to the 'script amount' variable. In the next step 5209 the ∑β issuer marks the record in the event base that contained the information about the script of 29 the previous on-line transaction as either 'completed' or 'incompleted'. That script is then so no longer outstanding. After step 5209 processing continues at step 5223 (via 5211 and 31 5222). In step 5213 the process stops and has detected an eσor. In step 5214 the issuer 32 checks whether the last authorization request ate LAATC is equal to -1. If this is the case, 33 processing continues at step 5219, otherwise it continues at step 5215. The value -1 is used ι to indicate that the last authorization request was part of a successful transaction. In step 2 5215 the issuer checks in the event base whether there is still an outstanding script to 3 update the CB. If this is the case, processing continues at step 5217, otherwise it continues 4 at step 5216 where the 'temp kcb' variable is set to the value ofthe balance during the last 5 authorization request. In step 5217 the 'temp kcb' variable is set to the sum ofthe balance β during the last authorization request and the amount ofthe update ofthe outstanding 7 script. In the next step 5218 the script in question is marked as 'completed', thus removing β it from the 'outstanding' state. In steps 5217 and 5218 there was an outstanding script, and 9 now a new ATC is seen by the issuer, thus the previous authorization transaction was ιo successfully completed. At the start of step 5219 the 'temp kcb' variable is an upper bound ii on the cuσent balance ofthe card, and in step 5219 the issuer checks whether the card i2 balance CB is larger then 'temp kcb'. If this is the case, processing continues at step 5213 is (via 5220 and 5212), otherwise it continues at step 5223 (via 5221 and 5222). In step 5223 i4 the issuer checks whether the settling amount is positive. If this is not the case, processing is continues at step 5225, otherwise it continues at step 5224 where the settling amount is iβ added to the 'script amount' variable, after which processing continues at step 5225. In 17 step 5225 the issuer first verifies that the amount ofthe transaction is at most the sum of iβ the cuσent card balance BC and the 'script amount' variable. If this is not the case, the card 19 balance is insufficient and the issuer does not give an authorization for the transaction. Next 20 the issuer checks whether the script amount is not zero. If this is not the case, processing 21 continues at step 5227, otherwise it continues at step 5226 in which the issuer creates a 22 script for the card using the data available, adds the essential script information to the event 23 base, and sets the settling amount in the card base to zero, after which processing continues 24 at step 5227. In step 5227 the issuer checks whether LAATC is not equal to -1, and 25 whether ATC is greater then LAATC. If this not the is the case, processing continues at 2β step 5229, otherwise the process continues at step 5228 where the LOATC value is set to 27 the LAATC after which processing continues at step 5229. In step 5229 the issuer adds a 2β record to the event base containing the essential information about this transaction. In the 29 next step 5230 the issuer updates the LAATC value to ATC, the HATC to ATC-1 and the so KCB value to CB, after which the process is terminated in step 5231. After the process the 31 issuer sends a reponse to the terminal, containing the authorization cryptogram, the 32 optional script etc. ι Figure 53 shows a more detailed description ofthe issuer processing when it receives 2 the transaction data of an off-line transaction, which was shown in less detail in figure 51 3 Before the start ofthe process, the issuer receives the transaction data, typically including 4 the card PAN and sequence number, the amount, the terminal id, the ATC, the card balance 5 etc The issuer retrieves the record associated with that card from the card base. The issuer β verifies the validity ofthe various identities, and checks that the transaction cryptogram TC 7 is valid. The issuer looks up the PAN/sequence number/ ATC combination in the event base β to check that this transaction number has not occuσed before. The process starts at step g 5300. In the next step 5301 the issuer checks whether ATC is greater than HATC the ιo issuer has for that card. If this is not the case, the process continues at step 5303, otherwise ii it continues at step 5302 in which the HATC value is set to the ATC value, after which the 12 process continues at step 5303 These steps ensure that the HATC value is maintained as is the largest ATC value for which a valid TC was received. In step 5303 the issuer checks 14 whether LAATC is equal to - 1 and ATC is greater or equal to LAATC If this is not the is case, the process continues at step 5309, otherwise it continues at step 5304. In step 5304 iβ the issuer sets the LOATC to LAATC, and sets the LAATC to -1. This serves to maintain 17 the LOATC value, which is defined as the last ATC value for which the issuer knows an iβ on-line transaction was successful with that card. In the next step 5305 the issuer checks i9 whether a script was issued during the last on-line transaction by looking in the event base. 2o If this is the case, processing continues at step 5307, otherwise it continues at step 5306. In 2i step 5306 the issuer sets the KCB value to the card balance that the issuer received during 22 the last authorization request, and continues at step 5309. This is an upper limit to the 23 cuσent card balance. In step 5307 the issuer sets the KCB value to the sum ofthe card 24 balance during the last authorization request and the amount ofthe update value used in the 25 script of that request. This again is an upper limit to the cuσent card balance. In the next 2β step 5308 the issuer marks the event record associated with that script as 'completed'. In 27 step 5309 the issuer checks whether ATC is greater or equal to LOATC, if this is the case 2β then the amount ofthe transaction is substracted from the KCB value in step 5310. The 29 process terminates in step 5311. 30 It is believed that the processes shown in figures 52 and 53 implement a secure 3i method for managing the card balances, ensuring that the card does not get a higher 32 balance than intended, and that any attempted increases in the balance ofthe card are 33 completed. ι The processes shown in figures 52 and 53 are fairly specific to the card as imple- 2 mented in the prefeσed embodiment. Depending on various implementation details, the 3 exact order and type of actions in the issuer processes might vary, as will be obvious to 4 someone ordinarilly skilled in the art. s For a credit card application the balance would be the OTB (Open To Buy). This is β the amount of money that the user can charge to the credit card before a transaction will be 7 refused. It is believed that most cuσent credit cards have such an OTB limit (sometimes β called the credit limit). It is believed that having the card maintain the OTB allows off-line 9 transactions to occur without the risk of exceeding the OTB. Under some circumstances, ιo the OTB should be increased, a typical example of such a circumstance is when the user has ii paced an outstanding credit card bill: the amount paid can be added to the OTB. Typically i2 this will not be communicated to the card directly, as there is no communication link 13 available. The card continues to use its old OTB value, until an on-line transaction occurs. i4 One ofthe possible reasons for an on-line transaction is that the OTB in the card is is exhausted. During that transaction the issuer can send a script to the card increasing the 16 OTB to the new value and allowing further off-line transaction to occur. It is believed that 17 the prefeσed embodiment can be used in this way with only a small fraction ofthe iβ transactions being on-line, and without compromising security. The credit card might also 19 be used to perform traditional credit card transactions, not using the EMV system. This 20 might result in the OTB being decreased without the card's knowledge. It is believed that 21 the issuer can use the script to reduce the OTB in the card. As will be obvious to someone 22 ordinarilly skilled in the art the issuer might also split the 'real' OTB ofthe credit card, and 23 give part of it to the card for use in off-line transactions, while keeping the other part in at 24 the issuer for use in traditional credit card transactions. It is believed that using the script, 25 the issuer can in such a setting increase or decrease the card's OTB depending on the OTB 2β remaining at the issuer, thus balancing the two OTBs in case one of them is depleted more 2 then the other. 2β For a pre-paid debit application the balance would represent the amount of money 29 stored on the card. During payments this amount typically decreases. Again the card can do so an arbitrary number of off-line transactions until the balance has been exhausted. In an on- 31 line transaction, the issuer can increase the balance using a script. In pre-paid applications 32 this would require the user to pay the issuer for the additional money that it puts on the 33 card. This might for example, but without limitation, be accomplished by integrating a bank ι account withdrawal (similar to the cash withdrawals at cuσent ATMs). During an on-line 2 transaction, the card has already been authenticated. The EMV specifications already allow 3 a cardholder verification procedure to be included, such as the entry of a PIN code. The 4 card authentication and the PIN code entry provide the same functionality as cuσent cash s withdrawals at ATMs, and could possibly be used in a pre-paid withdrawal where the β cardholders bank account is debited, and the balance on the card is credited. In the 7 prefeσed embodiment the card has an option to require a PIN during a transaction, in that β case the card will not complete a transaction without a valid PIN, such a mandatory PIN 9 enforced by the card is not included in the EMV specifications. As will be obvious to ιo someone ordinarilly skilled in the art, such mandatory verifications enforced by the card can ii also be applied to any other cardholder verification method. 12 For an on-line debit application the balance itself is not really necessary. The balance 13 can be rendered ineffective by various means, among others giving it a very large value. i The card authentication and the cardholder verification mentioned above can be used to is directly debit the cardholders bankaccount in an on-line transaction, which might also credit iβ the terminal owner's bankaccount at the same time. 17 It will be obvious to a person of ordinary skill in the art that a single card can contain iβ several EMV compatible applications, and can thus be used for several of these i9 applications. CARD INSTRUCTIONS 20 In the prefeσed embodiment the card is a smart card, and communicates with termi- 2i nals using the ISO 7816 standard protocol. In this protocol the terminal issuer a sequence 22 of commands to the card. Every command consists of a command header sent from the 23 terminal to the card, some optional data transfer from the terminal to the card and an 2 optional data transfer from the card to the terminal, and finally a result code sent by the 25 card to the terminal. An overview ofthe sequence in which the commands are meant to be 26 used is shown in figure 29. The card does not allow any other sequence. At any point in 27 time the terminal can start at step 2900, follow the aσows and issue the commands in the 2β order encountered. After step 2900 the terminal continues either at 2901, 2920, 2921 or 2 2930 30 In step 2901 the terminal sends the first of two command that together implement the 31 start session process of figure 25. Subsequently in step 2902 it sends the second command ι ofthe start session process. The terminal then sends one or more commands from the set 2 'get frame' 2903, 'put frame' 2904, 'debit frame' 2905, 'redebit frame' 2906, 'kill frame' 3 2907 and 'public debit' 2908. After this sequence of commands the terminal sends a 'commit' command which terminates the session, and executes the 'commit' process 5 described earlier. After a session the terminal can start again and issue the 'get proof β command 2920 to get the proofs from the previous session, and the 'done' command 2921 7 when the proof has been successfully read. The commands mentioned so far implement the β basic card functionality. 9 The EMV implementation is largely separate and conforms to the EMV specifications ιo mentioned above. It starts at step 2930 in which the terminal sends a 'select file' command, ii which is repeated any number of times. To start a new transaction, the terminal continues 12 with step 2931, to get the transaction proof of the last transaction again the terminal issues 13 the 'get last AC command 2940 after step 2930. In step 2931 the terminal issues the i4 'manage application 1 ' command, after which it enters a loop in which it executes either of is the commands get file' 2932 and 'get data' 2933 one or more times. After this loop, the iβ terminal sends the 'verify' command 2934 one or more times. (Execution ofthe verify 17 command is optional under some circumstances, but this is not shown here for clarity.) The iβ next step is for the terminal to send the 'generate AC 1 ' command. For an off-line 19 transaction the terminal continues at step 2939, for an on-line transaction the terminal 20 continues at step 2936 in which it sends a sequence of commands from a script to the card. 21 The commands that can appear here in 2936 are exactly those that appear in the dotted 22 frame 2910 and are not shown in detail for clarity. Execution of step 2936 is optional. The 23 next command is 'external authenticate' 2937, after which the terminal sends the 'generate 24 AC 2' command in step 2938. Command 2937 and 2938 are optionally. Finally the terminal 25 sends a 'manage application 2' command. 2β For an off-line transaction, the coσespondence between figures 28 and 29 are as 27 follows: The steps 2930 and 2931 are administrative and not shown in figure 28. The steps 28 2801 and 2803 are implemented using the commands 2932 and 2933. Command 2934 is 29 not shown in figure 28 for clarity. For an off-line transaction, steps 2805 till 2817 are not so executed. Steps 2818 and 2820 coσespond to command 2935, the next command the 3i terminal issues is 2939 which is not shown in figure 28 for clarity. 32 For an on-line transaction the coσespondence between figures 28 and 29 are as 33 follows: The steps 2930 and 2931 are administrative and not shown in figure 28 ι Commands 2932, 2933 and 2935 together implement steps 2801 and 2803, the command 2 2934 not being shown in figure 28 for clarity. The script of step 2811 coσesponds to 3 commands 2936 which basically involves an arbitrary session. The external authenticate 4 command 2937 coσesponds to steps 2812, 2814, 2816. Step 2817 is not supported in the s command set shown in figure 29. Steps 2818 and 2820 are implemented by command β 2938, while command 2939 is not included in figure 28 for clarity. 7 Figures 34, 35, 36, 37 and 38 show the detailed steps of all the commands. Every β command consists of three steps, we will use the 'start session 1 ' command as an example. 9 The first step 3400 is executed by the terminal The terminal sends a message 3401 to the ιo card which includes a command code to tell the card which command is being executed, ii and which might include some other data. When the card receives the message 3401 it i2 starts execution ofthe second step 3402. This involves the card sending a message 3403 is back to the terminal. This message consists of some optional data, plus a result code. When i4 the message 3403 is received by the terminal, the terminal starts execution of the third step is 3404. No action is taken in the third step apart form the analyses ofthe contents ofthe last iβ message. Each command coσesponds to a single APDU, but might be implemented as two 17 T=0 commands as described in the ISO 7816 standard. This same structure is repeated for iβ each ofthe commands. The same structure is repeated for all commands, the items (3400, 19 3401, 3402, 3403, 3404) corresponding with (3410, 3411, 3412, 3413, 3414), (3420, 20 3421, 3422, 3423, 3424), (3430, 3431, 3432, 3433, 3434), (3500, 3501, 3502, 3503, 21 3504), (3510, 3511, 3512, 3513, 3514), (3520, 3521, 3522, 3523, 3524), (3530, 3531, 22 3532, 3533, 3534), (3600, 3601, 3602, 3603, 3604), (3610, 3611, 3612, 3613, 3614), 23 (3620, 3621, 3622, 3623, 3624), (3630, 3631, 3632, 3633, 3634), (3700, 3701, 3702, 24 3703, 3704), (3710, 3711, 3712, 3713, 3714), (3720, 3721, 3722, 3723, 3724), (3730, 25 3731, 3732, 3733, 3734), (3800, 3801, 3802, 3803, 3804), (3810, 3811, 3812, 3813, 2β 3814), (3820, 3821, 3822, 3823, 3824), (3830, 3831, 3832, 3833, 3834), and (3930, 3931, 27 3932, 3933, 3934) respectively. We will refer to any one of these commands by the number 28 of their first step. 29 In the 'start session 1 ' command 3400 the terminal sends a bitmask which indicates 30 which keys will be used in the session, and the terminal challenge. This coσesponds to step 31 2501 in figure 25. The card sends the card challenge back, coσesponding to step 2503. In 32 the 'start session 2' command 3410 the terminal sends the card the proof that it knows the 33 keys, coσesponding to step 2505. The card responds with only a response code. In the 'get — 77 — ι frame' command 3420 the terminal sends the tag field of the frame to be read to the card, 2 and the card replies with the (encrypted) card data, plus an authentication (proof) of this 3 data. In the 'put frame' command 3430 the terminal sends the tag, the access field value, the data and an authentication proof to the card. The card sends a response code. In the 5 'kill frame' command 3500 the terminal sends the tag ofthe frame to be removed, and an β authentication proof to the card. The card responds with a response code. In the 'debit 7 frame' command 3510 the terminal sends an identifier ofthe balance to be debited, and an β amount to be debited. The card subtracts the given amount from the balance indicated and 9 sends a response code. In the 'redebit frame' command 3520 the terminal sends an ιo identifier of the balance to be redebited, the amount ofthe redebit, and the redebit key. The ii card replies with a response code. In the 'public debit' command 3530, the terminal sends 12 the balance indicator, the amount ofthe payment, and the random challenge to the card. 13 The card replies with a response code. In the 'commit' command 3600 the terminal sends 14 the session proof to the card, the card replies with a response code. In the 'done' command is 3610 no additional data is exchanged. In the 'get proof command 3620 the terminal sends iβ only the command header to the card. The card replies with the session proof, and 17 optionally the public proof In the 'select file' command 3630 the terminal sends an AID or iβ RID to the card which replies with an FCI. In the 'manage application 1 ' command 3700, 19 the terminal sends an 'ink' code to the card which replies with a response code. In the 20 'manage application 2' command 3710 the terminal sends an 'exit' code to the card, which 21 replies with a response code. In the 'get data' command 3720 the terminal sends a data 22 object tag to the card, which replies with the data object. In the 'get file' command 3730 23 the terminal sends the file number and the record number to the card, which replies with the 24 requested record. In the 'generate AC 1 ' command 3800 the terminal sends the requested 25 AC type and the TDOL values to the card, which replies with an AC type, the AC and the 26 ATC. In the 'generate AC 2' command 3810 the terminal sends the requested AC type and 27 the card replies with the AC type, the AC and the ATC. In the 'external authenticate' 2β command 3820 the terminal sends the authentication proof to the card, and the card replies 2β with a response code. In the 'verify' command 3830 the terminal sends the CVM method so and the CVM data to the card which replies with a response code. In the 'get last AC 3i command 3930 the terminal sends only the command code to the card, which replies with 32 the AC type, the AC and the ATC. CLEARING METHODS ι Once the transaction between the card and the terminal has been completed, there can 2 be a clearing process in which the information from different transactions are collected and 3 combined. The example of clearing we will use to describe the processes is the clearing of 4 financial payments. The card is used to perform payments to the terminal. One example of a 5 clearing system is for the terminal to send all the transaction data regarding the payments to β the acquirer/issuer which adds the amounts and credits the terminal's account with the total 7 sum. The role ofthe acquirer 104 is to collect information from several terminals, and β reimburse the terminals in 'real' money for the payments they received. As the issuer hands out the money and the acquirer receives it, there must be some kind of settlement between ιo the issuer and the acquirer. Typically the issuer and acquirer will be parts ofthe same ii organization, or organizations that work closely together. We will describe several different 12 clearing methods that can be used under different circumstances. 13 Full data. One ofthe simplest clearing methods is for the terminal to retain all the 1 relevant data from the payment transaction with the card. During clearing the terminal is sends all data to the acquirer which verifies every transaction certificate and then credits the iβ terminal. This gives the acquirer access to all transaction details, at the cost of handling i7 every transaction in full. iβ Truncating SAM. The terminal can also be equipped with a secure application 19 module (SAM). This is a tamper-resistant device made by the acquirer. The function ofthe 20 SAM is to verify the transaction data and add the value of all the received payments. The 21 transaction data is then discarded. This process is usually called truncation. During the 22 clearing process, the SAM informs the acquirer ofthe total amount received, and 23 cryptographically signs a message to this effect for the acquirer. 24 Truncating SAM with some individual payments. The terminal is again equipped 25 with a SAM. As in the truncating SAM option, the SAM verifies the transaction data and 26 keeps the totals. However, not all transaction data is discarded, but some or all of the 2 transaction data for some ofthe transactions is kept. During the clearing process this data 2β is also sent to the acquirer. The selection process that chooses for which transactions 29 transaction data is retained can be performed in various ways, by the terminal, by the SAM, so or by a combination ofthe two. 31 Truncating SAM with skeleton transactions. A SAM in the terminal is used to 32 verify all transactions. For each transaction, only skeleton transaction information is — 79 — ι retained by the terminal This would typically include the amount, date, time, card identity 2 (if available) etc The skeleton data is sent to the acquirer during the clearing process The 3 SAM ensures that the skeleton data sent to the acquirer is coσect (by signing it using a 4 digital signature scheme), and might optionally keep totals of the transactions and transfer 5 them separately to the acquirer β Skeleton transactions with statistical checking In this solution the terminal retains 7 all transaction data for all transactions During the clearing process the terminal first sends β skeleton information for every transaction This would typically include the amount and 9 some information which uniquely fixes the rest ofthe transaction data, such as a ιo cryptographic hash on the rest of the transaction data The acquirer then asks for the full ii transaction data for some ofthe transactions, which the terminal sends to the acquirer The i2 acquirer then verifies these transactions is Binary hash tree with statistical checking This method is similar to the previous i4 one in that the terminal retains all transaction data Instead of sending skeleton information is about all the transactions, the terminal now sends only a fixed amount of data to the iβ acquirer after which the acquirer can choose a subset ofthe transactions to inspect for 17 proper handling The terminal builds a binary tree, where each node contains two values iβ the amount and the hash. There is one leaf for every transaction, which contains the amount 1 ofthe transaction, and the hash of the transaction data The amount at each non-leaf node 20 is the sum ofthe amounts in the subnodes The hash value at each non-leaf node is a 21 cryptographic hash of all the data in the subnodes The terminal sends the number of 22 transactions (which also determines the structure ofthe tree), plus the amount and hash 23 value ofthe root ofthe tree to the acquirer. The acquirer then selects a subset ofthe 2 4 transactions, and sends the selection to the terminal The terminal responds by sending the 25 transaction data ofthe selected transactions, plus the amount and hash values at some of 2β the nodes The choice of which nodes to send depends on the selection by the acquirer The 27 nodes selected are those that are the root of a maximal subtree that does not contain a leaf 2β of a selected transaction In other words, those nodes whose hash does not depend on any 29 selected transaction, but whose parent node does depend on a selected transaction Given so these values the acquirer can verify the selected transactions, and verify those parts ofthe 3i binary tree that are on a path from the root to any one ofthe selected transactions 32 In some ofthe clearing systems the issuer can keep track of all transactions that have 33 occuσed Although cards are tamper-resistant they are not tamper-proof One attack is to ι 'break' a card, extract all secret information from it and create many duplicate cards, this ∑ attack is also called cloning. If each transaction has a unique number which the cards use in 3 sequence, then the issuer can detect the cloning as the cloned cards will either reuse old transaction numbers, or they will use the numbers out of order. As long as the transaction s numbers are all sent to the issuer, this allows detection of this fraud. Once the fraud has β been detected, the issuer can blacklist the cloned card. 7 If the card uses a general digital signature scheme, or a secret key based β authentication system, it is easy to include a transaction counter in the data being 9 authenticated. Most systems currently built and/or proposed actually have such transaction ιo counters. The compact endorsement signatures disclosed above do not have an inherent ii numbering, but this can be added The houses in a town have already a number, and are 12 always used in the same order The issuer can add a sequence number to each town it gives i3 to the card, and include this sequence number in the town signature. (This way, the town 1 signature is a signature on the sequence number and the town result value.) is The full data clearing system does not require a SAM but might lead to a large 16 amount of data being transmitted from the terminal to the acquirer. This can be costly 17 depending on the communication system used. iβ The SAM-based systems all need a SAM, which by itself can be an expensive piece of 19 equipment. In an environment with multiple issuers, either all issuers have to trust the same 20 SAM or each terminal needs a SAM for every issuer. 2i The last two clearing systems do not require a SAM, but let the terminal do most of 22 the truncation. If a terminal tries to defraud the acquirer/issuer then the terminal will be 23 caught with a certain probability by the statistical checking. Depending on the amount of 24 checking and the selection methods used by the acquirer the expected amount of successful 25 fraud by a terminal before being caught by the acquirer can be fixed. For example, but 2β without limitation, if the terminal sends skeleton data for each transaction to the acquirer, 2 the acquirer can use the following algorithm to select transactions for full review. If the ∑β amount of the transaction $100 or more then the transaction is selected. If the amount of 29 the transaction x is less then $100, then the transaction is selected with probability x%. so Thus, a transaction of $5 would be selected with a 5% probability It is believed that using 31 this selection method the acquirer is ensured that the expected amount of successful fraud 32 by a terminal before being detected by the acquirer is $100. ι As would be obvious to those of ordinary skill in the art, there are many essentially 2 equivalent ways to realize the inventive concepts disclosed. The particular choices that 3 have been made here are merely for clarity in exposition and are sometimes arbitrary. For instance, without attempting to be exhaustive, there are many one-time signature 5 structures, compression structures, hierarchical structurings, possible parameter values, and β so on. 7 It will also be obvious to those of ordinary skill in the art how parts ofthe inventive β concepts and protocols herein disclosed can be used to advantage without necessitating the 9 complete prefeσed embodiment. This may be more fully appreciated in light of some ιo examples, where in some uses ofthe inventive concepts, multiple parties may be combined, ii simple authorizations instead of actual messages may be used, implementations may involve 12 various hardware forms and memory types, and so forth. i3 Certain variations and substitutions may be apparent to those of ordinary skill in the 14 art. For example: most practical self-authenticating digital signature techniques could be is applied instead ofthe RSA systems used as an example; compression functions may take iβ more than two inputs; hierarchies of compression functions may take any other treelike 17 form; and register re-use patterns that more evenly distribute certain types of access may be iβ prefeσed for certain technologies. 19 While these descriptions ofthe present invention have been given as examples, it will be 20 appreciated by those of ordinary skill in the art that various modifications, alternate 21 configurations and equivalents may be employed without departing from the spirit and 22 scope ofthe present invention.

Claims: What is claimed is: 1. A method for public-key digital authentication of messages, comprising the steps of: creating a private key by a signing party; making a public key, coσesponding to said private key of said signing party, verifiable by at least a receiving party; creating a set of one-time signatures; forming a compression hierarchy of said one-time signatures; forming a public key digital signature, verifiable with said public key, on said compression hierarchy; storing edges of said compression hierarchy by an endorser; endorsing by signing with at least one of said one-time signatures and providing stored edge values; verification of said one-time signature and said edge values supplied and said digital signature on said compression values; and accomplishing the foregoing by said endorser storing substantially less than all edges and computing before each endorsement substantially less than all edges. 2. In the method of claim 1, using a cascade structuring of compression functions. 3. In the method of claim 1, preparing for future endorsements so that they will require substantially less computation. 4. In the method of claim 1, said one-time signature being constructed using different oneway functions in a chain of oneway functions. 5. In the method of claim 3, said preparations being done at least in part by a party different from the endorser. 6. Apparatus for public-key digital authentication of messages, comprising: means for creating a private key by a signing party; means for making a public key, coσesponding to said private key of said signing party, verifiable by at least a receiving party; means for creating a set of one-time signatures; means for forming a compression hierarchy of said one-time signatures; means for forming a public key digital signatures, verifiable with said public key, on said compression hierarchy; SUBSTITUTE SHEET (RULE 28) means for storing edges of said compression hierarchy by an endorser, means for endorsing, comprising means for signing with one of said one-time signatures and means for providing stored edge values; means for verification of a one-time signature and compression hierarchy values supplied and for verification of said digital signature on said compression value, and means for accomplishing the forgoing by said endorser storing substantially less than all edges and computing before each endorsement substantially less than all edges 7 In the apparatus of claim 6, means for forming a cascade structuring of compression functions 8 In the apparatus of claim 6, means for prepanng future endorsements so that they will require substantially less computation. 9 A method for financial transactions, comprising the steps of. maintaining a challenge seed by a terminal for use with respect to at least one subsequent transaction, issuing a challenge seed modifier by an on-line server to said terminal, modifying said challenge seed by said terminal at least responsive to said modifier; developing a challenge value for use in a subsequent transaction, where said challenge value depends oat least substantially on said challenge seed, and accomplishing the forgoing so as to make said challenge unpredictable even to someone privy to the secrets of said terminal 10. Apparatus for financial transactions, comprising means for maintaining a challenge seed by a terminal for use with respect to at least one subsequent transaction; means for issuing a challenge seed modifier by an on-line server to said terminal, means for modifying said challenge seed by said terminal at least responsive to said modifier; means for developing a challenge value for use in a subsequent transaction, where said challenge value depends oat least substantially on said challenge seed; and means for accomplishing the forgoing so as to make said challenge unpredictable even to someone privy to the secrets of said terminal SUBSTITUTE SHEET (RULE 28) 1 1. A method for public key digital authentication of a message, comprising the steps of: creating a private key for a signing party; making a public key, coσesponding to said private key, verifiable by at least a receiving party; generating the commit value of a commit-challenge-response protocol by said signing party; sending said commit value to said receiving party; forming a mutually random value by said signing party and said receiving party; choosing the challenge value of said commit-challenge-response protocol as the hash value of the concatenation of the message to be authenticated and said mutually random value; generating the response value of said commit-challenge-response protocol by said signing party; sending said response value to said receiving party; and verifying said response value by said receiving party. 12. In the method of claim 1 1, said commit-challenge-response protocol consisting of a compact endorsement signature protocol. 13. Apparatus for public key digital authentication of a message, comprising: means for creating a private key for a signing party; means for making a public key, coσesponding to said private key, verifiable by at least a receiving party; means for generating the commit value of a commit-challenge-response protocol by said signing party; means for sending said commit value to said receiving party; means for forming a mutually random value by said signing party and said receiving party; means for choosing the challenge value of said commit-challenge-response protocol as the hash value of he concatenation ofthe message to be authenticated and said mutually random value; means for generating the response value of said commit-challenge-response protocol by said signing party; SUBSTITUTE SHEET (RULE 28) means for sending said response value to said receiving party; and means for verifying said response value by said receiving party. 14. A method for storing data in non-volatile memory, comprising the steps of: initializing a commit value to a logical zero; storing one or more descriptions of modifications to be made; setting said commit value to a logical one; performing the modifications specified by said descriptions setting said commit value to a logical zero; and detecting interruptions in the above mentioned steps, and upon detection performing the steps of: a) inspecting said commit value; b) performing said modifications if said commit value is a logical one, c) setting said commit value to a logical zero 15. In the method of claim 14, with means for setting said commit value to a logical one value after an interruption and before said modifications are made. 16. In the method of claim 14, with improvements comprising the steps of: initializing an in-use value to a logical zero; setting said in-use value to a logical one before said commit value is set to a logical one; setting said in-use value to a logical zero after said commit value is set to a logical zero; and setting said commit value to a logical zero and then setting said in-use value to a logical zero if the in-use value is found to contain a logical one while the commit value is found to contain a logical zero after an interruption. 17. In the method of claim 14 or 16, with different commit values used for different modifications. 18. In the method of claim 14 or 16, each of said modifications consisting of a standard action on one of a given set of memory locations. 19 In the method of claim 18, said standard action consisting of setting s the location to fixed value. SUBSTITUTE SHEET (RULE 28) 20 In the method of claim 18, said retention means for modification descnptions consisting of a single bit for each of the possible locations for the modification 21 In the method of claim 14 or 16, with improvements comprising the steps of storing one or more reversion descriptions to be made, and performing the reversions specified by said reversion descriptions if the commit value is found to contain a logical zero after an interruption 22 In the method of claim 21, each of said reversions consisting of a standard action on one of a given set of memory locations 23 In the method of claim 22, said standard action consisting of setting the location to fixed value 24 In the method of claim 22, said retention means for reversion descnptions consisting of a single bit for each ofthe possible locations for the reversion 25 Apparatus for stoπng data in non- volatile memory, compnsing retention means for a single bit commit value, retention means for one or more modification descriptions to be made, initialization means to ensure that said commit value is a logical zero during a prefix ofthe card life, means for storing one or more modification descnptions to be made in said second retention means, means for setting said commit value to a logical one, means for performing the modifications specified by said descriptions, means for setting said commit value to a logical zero, and means for detecting an interruption of normal processing and triggering. a) means for inspecting said commit value, b) means for performing said modifications if said commit value is a logical one, and c) means for setting said commit value to a logical zero 26 A method for handling memory eσors in a computing device with non-volatile memory, comprising the steps of initializing a mode value to indicate a first mode, SUBSTITUTE SHEET (RULE 28) detecting the occuσence of an eσomous state of said memory, setting said mode value to indicate a second mode upon detection of said eσornous state, inspecting said mode value in at least one of the processes executed by said computing device, and modifying the behaviour of said process depending on the value of said mode value 27 In the method of claim 26, said modifying ofthe behaviour of said process including restriction of normal execution of said process to the first state 28 In the method of claim 26, said modifying of the behaviour of said process including including enabling a process in the second mode that allows recovery of application data 29 In the method of claim 28, said process restricting access to data that is non-secret 30 In the method of claim 29, the secretness ofthe data being determined by a coding which increases the secretness level if individual bits in said memory are changed from a logical "one" state to a logical "zero" state 31 In the method of claim 26, said detection of erroneous states using a coding of data to detect memory eσors with substantially high probability 32 Apparaturs for handling memory eσors in a computing device with non-volatile memory, comprising of means for initializing a mode value to indicate a first mode, means for detecting the occuσence of an- eσornous state of said memory, means for setting said mode value to indicate a second mode upon detection of said eσornous state, means for inspecting said mode value in at least one of the processes executed by said computing device, and means for modifying the behaviour of said process depending on the value of said mode value 33 A method for communicating and linking a plurality of indepent actions between a terminal and a card, with improvements comprising the steps of initializing a first hash state in said card to a known value before the start of the communication. LE 28 initializing a second hash state in said terminal to a known value before the start of the communication; updating said first hash state using a function which takes said first hash state and substantially the data associated with an independent action as input and yields the new value for said first hash state as output; updating said second hash state using a function which takes said second hash state and substantially the data associated with an independent action as input and yields the new value for said second hash state as output; and making at least some ofthe data communicated between said terminal and said card dependent on said hash states. 34. In the method of claim 33, an initial independent action updating said hash states using at least one secret key. 35. In the method of claim 34, an initial independent action including a proof by said terminal of possesion of said key 36. In the method of claim 33, 34 or 35, said independent actions including cryptographic confidentiality coding of data communicated between said card and said terminal based on said hash states. 37. In the method of claim 36, said confidentiality coding using the same coding function in said card for both directions of data communication. 38. In the method of claim 36, said confidentiality coding using the same coding function in said terminal for both directions of data communication. 39. In the method of claim 33, 34 or 35, said independent actions only making tentative changes to the state of said card until a final independent action which makes the tentative changes permanent. 40. In the method of claim 39, discarding said tentative changes upon detection of an interruption. 41. In the method of claim 39, said final action including a first cryptographic authentication by said terminal to said card on said second hash state to start the process of making said tentative changes permanent. SUBSTITUTE SHEET (RULE 28) 42. In the method of claim 39, said final independent action including a second cryptographic authentication by said card to said terminal on said first hash state to show that said tentative changes have become permanent. 43. In the method of claim 42, a resend process being executed on request of the terminal after said final independent action in which said card resends said second cryptographic authentication to said terminal. 44. In the method of claim 43, with improvements comprising the steps of: initializing a done value in said card to a logical zero state during said final independent action; inspecting said done value during said resend process; resending said second cryptographic authentication only if said done value is a logical zero; sending a request by said terminal to said card to set said done value to a logical one; and setting said done value to a logical one upon reception of said request. 45. In the method of claim 41, said last independent action including provisions for said card to wait for a signal of said terminal after having verified said first cryptographic authentication but just before said tentative changes become permanent. 46. In the method of claim 41, the data for said independent actions having been generated by an issuer and sent to said terminal, and where said terminal executes said actions with said card based on the data supplied by said issuer. 47. Apparatus for communicating and linking a plurality of indepent actions between a terminal and a card, with improvements comprising of: retention means for a first hash state in said card; retention means for a second hash state in said terminal, means for initializing said first hash state in said card to a known value before the start of he communication; means for initializing said second hash state in said terminal to a known value before the start ofthe communication, SUBSTITUTE SHEET (RULE 28) means for updating said first hash state using a function which takes said first hash state and substantially the data associated with an independent action as input and yields the new value for said first hash state as output; means for updating said second hash state using a function which takes said second hash state and substantially the data associated with an independent action as input and yields the new value for said second hash state as output; and means for making at least some ofthe data communicated between said terminal and said card dependent on said hash states. 48. A method for performing computations by a card which is communicating with a terminal comprising the steps of: sending a first message by said terminal; receiving said first message by said card; performing computations by said card on the data received in said first message and data stored in the memory of said card; sending a second message by said card; receiving said second message by said terminal, and inducing a delay between said first message and said second message, where the duration of said delay is determined solely by public information consisting of the contents ofthe messages received by said card before said delay, the contents of the messages sent by said card before said delay, and by data that said card would send to said terminal in subsequent communications given appropriate requests by said terminal. 49. In the method of claim 48, said delay being made constant by adding sufficient delays in each of the possible execution paths of said computations. 50. In the method of claim 48, said computations being implemented by a sequence of actions each of which induces a known fixed delay where said sequence is solely determined by said public information. 51. In the method of claim 50, said sequence of actions consisting of actions that are functionally equivalent to a set of actions that contains one or more actions that are executed conditionally. SUBSTITUTE SHEET (RULE 28) -91- 52. In the method of claim 50, said sequence of instructions implementing a conditional storage operation by executing a storage operation using an address whose value is computed as a function of the condition of said conditional storage operation. 53. Apparatus for performing computations by a card which is communicating with a terminal comprising of: means for sending a first message by said terminal; means for receiving said first message by said card; means for performing computations by said card on the data received in said first message and data stored in the memory of said card; means for sending a second message by said card; means for receiving said second message by said terminal; and means for inducing a delay between said first message and said second message, where the duration of said delay is determined solely by public information consisting ofthe contents of the messages received by said card before said delay, the contents of the messages sent by said card before said delay, and by data that said card would send to said terminal in subsequent communications given appropriate requests by said terminal. 54. A method for converting a set of instructions, comprising the steps of: inspecting said set of instructions; determining the conditions used in said set; adding instructions to said set which convert said conditions to values; and rewriting expressions contained in said set to an equivalent formulation using said values instead of conditional execution of instructions. 55. Apparatus for converting a set of instructions, comprising of: retention means for storing a set of instructions; means for inspecting said set of instructions; means for determining the conditions used in said set; and means for adding instructions to said set which convert said conditions to values; means for rewriting expressions contained in said set to an equivalent formulation using said values instead of conditional execution of instructions 56 A method for collecting transaction information related to one or more transactions from a terminal by an acquirer, compnsing the steps of computing by said terminal a first value from said transaction information, whose size is substantially smaller than the size of said transaction information, sending by said terminal to said acquirer a first message including an indication of the number of transactions, the applicable totals of the transactions, and said first value, receiving said first message by said acquirer, stoπng substantially the data from said first message by said acquirer for future computations, making a random selection from the set of transaction, and sending said random selection in a second message to said terminal, receiving said second message by said terminal sending by said terminal to said acquirer in a third message substantially the transaction information for the transactions in said selection 57 In the method of claim 56, said first message including skeleton transaction information about all transactions 58 In the method of claim 56, said first message including a cryptographic hash value on substantially the full the transaction data of all transactions, and said third message including data that allows said hash value to be verified by said acquirer 59 In the method of claim 58, said cryptographic hash value being computed using a tree structure 60 Apparatus for collecting transaction information related to one or more transactions from a terminal by an acquirer, compnsing means for computing by said terminal a first value from said transaction information, whose size is substantially smaller than the size of said transaction information, means for sending by said terminal to said acquirer a first message including an indication of he number of transactions, the applicable totals of the transactions, and said first value, means for receiving said first message by said acquirer, retention means for storing substantially the data from said first message by said acquirer for future computations. SUBSTITUTE SHEET RULE 28 means for making a random selection from the set of transaction, means for sending said random selection in a second message to said terminal; means for receiving said second message by said terminal; and means for sending by said terminal to said acquirer in a third message substantially the transaction information for the transactions in said selection. 61. A method for conducting finanancial transactions using a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements comprising the steps of: generating variable transaction data which is typically different for different transactions; constructing a message block whose value depends on at least some of said variable transaction data; generating by said card of an authentication based on public key cryptography on said message block; sending said authentication in a message to said terminal; receiving said message by said terminal; and verifying said authentication by said terminal. 62. In the method of claim 61, said message block including the transaction certificate TC. 63 Apparatus for conducting finanancial transactions comprising a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements characterized by: means for generating variable transactoin data which is typically different for different transactions; means for constructing a message block whose value depends on at least some of said variable transaction data; means for generating by said card of an authentication based on public key cryptography on said message block; means for sending said authentication in a message to said terminal; means for receiving said message by said terminal; and means for verifying said authentication by said terminal. 64 A method for conducting finanancial transactions using a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements comprising the steps of: maintaining a balance value in said card for all financial transaction applications, decreasing said balance value by the amount of each transaction; and refusing an off-line transaction if the amount of said transaction exceeds said balance value 65 In the method of claim 64, said issuer using the script feature ofthe EMV to modify said balance value stored on said card 66. In the method of claim 65, with improvements comprising the steps of storing information by said issuer related to said card, storing information by said issuer related to on-line transactions performed by said card, detecting by said issuer of failures to execute a first script issued by said issuer during an on-line transaction; creating a second script including substantially the actions of said first script sending said second script to said terminal; and executing said script by said terminal with said card 67 In the method of claim 66, with improvements comprising the steps of. detecting by said issuer after a period of time off-line transactions performed by said card but not presented to said issuer for clearing, estimating the total amount of said off-line transactions; and adding substantially said total amount to said balance value using a script 68 Apparatus for conducting finanancial transactions comprising a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements characterized by- retention means for a balance value in said card; means for decreasing said balance value by the amount of each transaction; and menas for refusing an off-line transaction if the amount of said transaction exceeds said balance value. SUBSTITUTE SHEET (RULE 28) 69 A method for conducting finanancial transactions using a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements comprising the step of incrementing the transaction counter ATC only for those transactions which are completed successfully 70 Apparatus for conducting finanancial transactions comprising a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements characterized by means for incrementing the transaction counter ATC only for those transactions which are completed successfully 71 A method for conducting finanancial transactions using a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements comprising the steps of making a decision by said card whether to allow an off-line transaction or require an on-line transaction in a fixed amount of time, and storing said decision in a fixed amount of time 72 Apparatus for conducting finanancial transactions comprising a card, a terminal, and an issuer substantially according to the EMV specifications, with improvements characterized by means for making a decision by said card whether to allow an off-line transaction or require an on-line transaction in a fixed amount of time, and means for storing said decision in a fixed amount of time SUBSTITUTE SHEET (RULE 28)

Inventors: CHAUM DAVID, FERGUSON NIELS, VAN DER HOEK JELTE, CHAUM, DAVID, FERGUSON, NIELS, VAN DER HOEK, JELTE
Applicants: CHAUM DAVID, FERGUSON NIELS, HOEK JELTE V D, CHAUM, DAVID, FERGUSON, NIELS, VAN DER HOEK, JELTE
Application year: 1995
Main classification: H04L9
IPC codes: G07F7, H04L9