EMV® Issuer and Application Security Guidelines
EMV<sup>®</sup> Issuer and Application Security Guidelines EMVCo, LLC Version 2.6 August 2018 © 1994-2018 EMVCo, LLC ("EMVCo"). All rights reserved. Any and all uses of this EMV Specifications ("Materials") shall be permitted only pursuant to the terms and conditions of the license agreement between the user and EMVCo found at http://www.emvco.com.
http://www.emvco.com. 5. 5. 5.2. 5.2. 5.2. 5.2. 5.2. 5. 5.3. 5.3. 5. 5.4. 5.4. 5.4. 5. 6. 6.1. 6.1. 6.1. 6.1. 6.1. 6.1. 6. 6.2. 6.2. 6. 7. 7. 7.2. 7.2. 7. 8. 8. 8. A. A. A. A. A. A. A. A.
http://www.emvco.com ii Scope 1
Scope
These Security Guidelines are designed to assist issuers of EMV payment cards with key management and issuance processes. The issuer is liable for both the accuracy and the protection of the data used in the provisioning of its cards. Such data includes, in addition to the cardholder and account information, cryptographic keys and other cardholder secrets, that, if revealed to unauthorised parties, could result in the creation of counterfeit cards and fraudulent transactions. To protect against the unauthorised disclosure of this information, issuers must create and manage these types of data in a secure environment. Such an environment is one where the appropriate physical and logical security controls have been implemented and where sufficient audit trails have been established to assure procedural consistency relative to the issuer's security objectives. The guidance presented in the following pages is applicable to all phases of card provisioning, authorisation, and transactional clearing. Where issuers use third party agents to perform these functions, the same principles are also applicable. Application of these principles may also be useful for other payment applications that require and use similar sensitive data. Some aspects of these Guidelines may also be applicable to the component that represents the card within a Mobile phone acting as a contactless payment card, but the Guidelines are not intended to address security that is specific to mobile technology as compared to contact or contactless cards. The Guidelines are not intended to cover EMV Tokenisation nor EMV 3D-Secure. The materials contained in this document are intended primarily for issuers and their agents. This document is not intended to supersede the requirements and specifications of any Payment System. The document is to be used as a "guideline", assisting the issuer, the issuer's agent and other third parties regarding the secure implementation of an EMV specification.
http://www.emvco.com. iii References 2
References
Throughout this document, the following references have been used. These references include the most current version at the time of preparation. For future use the most current versions of these documents should be used. EMV Version 4.3 EMV CPS PCI SSC CPPLS ISO 9564-1 ISO 11568 ISO 13491 ISO 16609 ISO 20038 ISO/IEC 18031 ISO/IEC 18032 Integrated Circuit Card Specifications for Payment Systems. Book 2 Security and Key Management EMV Common Personalisation Specifications PCI SSC Card Production Physical and Logical Security standards Financial Services – PIN management and security – Part 1: Basic principles and requirements for PINs in card-based systems. Financial Services – Key management (retail) Financial Services – Secure cryptographic devices (retail) Financial Services – Requirements for message authentication using symmetric techniques Financial Services
- Key Wrap using AES Information technology
- Security techniques – Random bit generation Information technology
- Security techniques Prime number generation http://www.emvco.com. iv Definitions 3
Definitions
Authentication Certificate (public key) Certification Authority Cryptographic Algorithm Digital Signature Dual Control Hash Function IC Card (ICC) Key Component Key Pair Key Space A cryptographic process that validates the identity and integrity of data. The public key and the identity of an entity together with some other information, made unforgeable by the signing of the certificate with the private key of the certification authority issuing the certificate. The entity that is trusted by one or more other entities to create and assign certificates. A set of rules, setting forth procedures necessary to authenticate or protect data, e.g. to perform encipherment and decipherment of data. The algorithm is specified in a manner that it is not possible to determine any of the secret control parameters; i.e., the secret or private key, except by exhaustive search. The cryptographic transformation of data which provides: origin authentication, and data integrity. The process of utilising two or more separate entities to protect sensitive information or functions, such that no single entity is able to access or utilise the information or functions. A function, which maps values from a large domain into a smaller one. The function satisfies the following properties: 1. It is computationally infeasible to find for a given output, an input that maps to this output. 2. It is computationally infeasible to find for a given input, a second input that maps to the same output. A card with an embedded integrated circuit (chip) that communicates with a point of interaction (terminal). One of at least two parameters having the characteristics of randomness and format of a cryptographic key that is combined with one or more like parameters, forming the cryptographic key. When used in public key cryptography, a public key and its corresponding private key. A set of all possible keys used by a cryptographic algorithm.
http://www.emvco.com. Keying Material Payment System Physically Secure Device Platform Private Key Pseudo-random Public Key Secret Key Secure Cryptographic Device Split Knowledge Definitions v The data (e.g. keys, certificates, initialisation vectors) necessary to establish and maintain cryptographic keys. A Payment System includes a number of participants where the issuer and the acquirer distribute responsibilities amongst the different parties according to Payment System rules and according to the allocation of risks. A module that has a negligible probability of entry without detection or erasure of its contents. An integrated circuit (chip) with its dedicated software, Operating System (OS), Run Time Environment (RTE), and Platform environment on which one or more applications (e.g., CPA) can be executed. In an asymmetric algorithm (public key) cryptosystem, the key of an entity's key pair that is known only to that entity. This is not the same as the secret key used in a symmetric algorithm. A process that produces numbers that are statistically random and essentially unpredictable although generated by an algorithmic process. In an asymmetric key system, the key of an entity that is publicly known. A key that is used in a symmetric cryptographic algorithm and cannot be disclosed publicly without compromising the security of the system. This is not the same as the private key in a public/private key pair. A device that provides physically and logically protected cryptographic services and storage (e.g. PIN Entry device or Hardware Security Module), and which may be integrated into a larger system such as a point of sale device. A condition whereby two or more parties; i.e., key custodians, separately and confidentially have custodial control of a constituent part of a cryptographic key that individually conveys no knowledge of the resultant cryptographic key.
http://www.emvco.com. vi Abbreviations and Notations 4 Abbreviations and Notations AC AES AIP ARPC ARQC ATC ATM CA CDA CDOL CPA CRL CRT DDA DES HSM IAD IC ICC IDN IIN IMKAC IMKSMC IMKSMI MAC MK MKAC MKSMC MKSMI PAN POS RSA Application Cryptogram Advanced Encryption Standard Application Interchange Profile Authorisation Response Cryptogram Authorisation Request Cryptogram Application Transaction Counter Automated Teller Machine Certificate Authority Combined DDA/Application Cryptogram Generation Card Risk Management Data Object List Common Payment Application Certificate Revocation List Chinese Remainder Theorem Dynamic Data Authentication Data Encryption Standard Hardware Security Module Issuer Application Data Integrated Circuit Integrated Circuit Card ICC Dynamic Number Issuer Identification Number, also known as Bank Identification Number (BIN) Issuer Master Key for Application Cryptogram computation Issuer Master Key for Secure Messaging for Confidentiality Issuer Master Key for Secure Messaging for Integrity Message Authentication Code Card Master Key Card Master Key for Application Cryptogram computation Card Master Key for Secure Messaging for Confidentiality Card Master Key for Secure Messaging for Integrity Application Primary Account Number Point of Sale Rivest, Shamir, Adleman algorithm
http://www.emvco.com. SCD SDA SDAD SKAC SKSMC SKSMI TC TDES TVR Abbreviations and Notations vii Secure Cryptographic Device Static Data Authentication Signed Dynamic Application Data Session Key for Application Cryptogram computation Session Master Key for Secure Messaging for Confidentiality Session Master Key for Secure Messaging for Integrity Transaction Certificate Triple DES (referred to as DES3 in EMV Book 2) Terminal Verification Results
http://www.emvco.com. EMV and Cryptography Overview 1 5 EMV and Cryptography – Overview 5.1
Introduction
The purpose of this overview is to provide a framework for the issuer security guidelines. The EMV payment system model is described together with an outline of the roles of the entities within the model.
5.2 Payment System Model The Payment System (as outlined in Figure 1) consists of the following types of entity: Cardholders, Merchants, Issuers, Acquirers, and Payment Systems (e.g. American Express, Discover, JCB, Mastercard, UnionPay and Visa). Figure 1 - System Model The main role of each of these entities is as follows.
http://www.emvco.com. 2 EMV and Cryptography Overview 5.2.1 The Cardholder The role of the cardholder includes the following: To obtain a chip card containing the payment product application by contracting with an issuer. To choose, remember and possibly update his/her PIN. To present his/her chip card to devices accepting the payment product for payment (ATM, Merchant POS, vending machines, payphones, etc.).
5.2.2 The Merchant The role of the merchant includes the following: To obtain payment terminals accepting chip cards by contracting with an acquirer. To accept chip cards containing the payment products for payment. To obtain reimbursement for the purchases by collecting and transmitting payment transaction details to the acquirer.
5.2.3 The Issuer The role of the issuer includes the following: To contract with the cardholder, and to provision and issue a chip card containing the application to the cardholder. This includes the generation and installation of the necessary cryptographic keys in the card to support the application. To process online transactions. This includes verification of the data and cryptogram from the card together with data from the terminal, plus generation of a cryptogram allowing the card to authenticate the issuer. It also includes verification of online cardholder PINs as part of standard authorisation processing. To generate update scripts to the card application when appropriate. To process clearing messages including verification of the data and associated Transaction Certificate, when appropriate. In some circumstances this could be deferred and only checked in the case of dispute. To reimburse the acquirer for payment transactions. To securely transmit to any other parties the necessary cryptographic keys needed for the correct operation of the system.
5.2.4 The Acquirer The role of the acquirer includes the following: To contract with merchants and to deploy payment terminals. This includes the installation and management of Payment System public keys, adequately protected for integrity.
http://www.emvco.com. EMV and Cryptography Overview 3 To process payment transactions and to pay the merchant for them. To transmit the completed transaction records to the issuer in order to obtain the settlement. To manage the risk conditions relating to online/offline acceptance.
5.2.5 The Payment System The role of the Payment System includes the following: To specify the system rules for the products and services and to verify compliance with them. To generate and distribute Payment System public keys. To certify Issuer Public Keys used within the system. To operate on-line communication networks between acquirers and issuers. To perform clearing and settlement for transactions on this network.
5.3 Cryptographic Basics Historically, cryptography has been used to provide data confidentiality and today includes additional cryptographic functions such as data integrity, authentication, and non-repudiation. International standards have been developed to facilitate interoperability of products and services between different vendors and various cryptographic implementations. The materials contained in these guidelines represent the best practices drawn from these different standards. Modern cryptography depends on two basic components: (1) the algorithm, and (2) the cryptographic key, with overall security dependant on public access to the algorithm and secure management of the secret and private keys over the key lifecycle. The algorithms define how ciphertext is obtained from plaintext and vice versa and how data is signed and verified. Algorithms are typically published and have been extensively studied by cryptographers – it is the use of unique keys for every user that ensures that unauthorised parties are unable to decrypt sensitive data or forge another parties' digital signature. There are two basic types of cryptographic algorithms: (1) symmetric or secret key algorithms, and (2) asymmetric or public/private key algorithms and both are used within the context of EMV.
5.3.1 Symmetric Algorithms Symmetric or ‘secret key’ algorithms require that the secret key used for the encryption process also be used in the decryption process. Therefore, the security of the encryption process depends entirely on protection of this secret key. The EMV application supports the use of the Data Encryption Standard (DES), a symmetric algorithm which is widely used in the financial services industry today. DES belongs to the family of encryption algorithms called "block" ciphers because
http://www.emvco.com. 4 EMV and Cryptography Overview they process data in blocks. The DES algorithm takes an input block of 64-bits and maps it to a 64-bit output block, using a 56-bit key in an iterative process of sixteen rounds. As an option, the more recent AES algorithm is also supported. The MAC length is retained at 8 bytes for backwards compatibility. All references in the text of this document regarding the use of the DES algorithm are to be read as references to the use of Triple DES (TDES), typically 2 key Triple DES or 3 key Triple DES if issuer chooses, in which a single DES encryption is replaced with three DES operations. Similarly, references to DES keys are to be read as pairs (or triples) of DES keys, as used in conjunction with Triple DES. Therefore, all EMV DES keys are 16 bytes or 128 bits in length (24 bytes or 192 bits in length). Whilst attacks on Triple DES have been published and therefore there is pressure to deprecate its use and replace it with AES, it is important to understand the context in which the identified weaknesses are relevant. If a single key is to be used to encrypt large volumes of data (of the order of 240 bytes) then Triple DES is a poor choice. However, in EMV session keys are specified to form a single cryptogram for the purposes of a one off real-time authorisation. Consequently the weaknesses do not apply in this environment and there is no urgent need for the industry to upgrade to AES, but rather to migrate as the opportunity arises. Potential risks to symmetric keys include: The physical compromise of the secret key. Side channel attacks on keys held in chip cards. Exhaustive key search attacks – currently computationally infeasible for TDES.
5.3.2 Asymmetric Algorithms Asymmetric or ‘public key’ algorithms require the communicating endpoints to use two different, but linked, keys: a "public" key and a "private" key. The RSA asymmetric algorithm is used by EMV to create digital signatures and for offline PIN encipherment. In a digital signature scheme the private key (sometimes referred to as the signature key) is used to generate the signature and the public key (sometimes referred to as the verification key) is used to verify the signature. For offline PIN encipherment, the public key is used for encipherment and the private key is used for decipherment. Public key algorithms are generally based on a "hard" mathematical problem and have a design goal that there should be no better way to attack the scheme other than solving the hard problem. RSA is based on the hard problem of factorisation; that is, for a number consisting of two prime numbers multiplied together, find the primes given only the product, known as the modulus. The longer the modulus (key length), the "harder" the problem of breaking the key.
5.3.2.1 Asymmetric (RSA) Keys The security of the private (signature) keys used with the RSA algorithm depends on a number of factors including: The length of the RSA key modulus; e.g. 1024, 1152, 1408, and 1984 bit keys. The physical security of the private (signature) key from unauthorised access and exposure/compromise whilst in storage, in transit or in use.
http://www.emvco.com. EMV and Cryptography Overview 5 The quality of the prime numbers making up the public/private key modulus. Potential risks to the private (signature) key include: Physical compromise. Factorisation of the RSA modulus. Side channel attacks on keys held in chip cards Collapse of the underlying algorithm – most unlikely after several decades of cryptanalysis. The EMVCo Security Working Group conducts an annual review of Payment System key lifetimes based on independent analyses by the participating Payment Systems. Using the recommendations from the review, the Payment Systems may update their Payment System key lifetimes. The lifetimes for the longer keys are currently considered to be ‘anticipated lifetimes’ in order to reflect the situation that when looking more than ten years into the future, the variation in prediction becomes too large for a reliable date to be given. Over time these dates are also expected to move out, until a lifetime of ten years or less is predicted at which time the date will be considered as an expiry date. Note that all key lifetimes are subject to change.
5.3.2.2 Certificates and Certification Authorities EMV follows the usual practice of certificates to validate the source of issuer and card public keys. A certificate is a form of digital signature designed to validate the origin and integrity of a public key. A certificate consists of a public key concatenated with other related data and signed with the private key of a trusted entity known as a Certification Authority (CA). Any entity with a trusted copy of the CA’s Public Key can then verify all certificates generated by that CA and thereby obtain trusted copies of other users’ public keys. In the EMV environment, the Payment System acts as a Certification Authority and creates Issuer Public Key certificates by signing each issuer public key. Issuers act as Certification Authorities and create ICC Public Key certificates by signing each ICC Public Key. The Payment Systems CA’s Public Keys are distributed to the terminals through the acquirers for verifying issuer certificates, thereby yielding trusted copies of issuers’ public keys, used in turn to verify ICC Public Keys.
http://www.emvco.com. 6 EMV and Cryptography Overview 5.4 EMV Card Authentication Methods EMV supports offline and online methods for authenticating that a card is genuine and that the data on the card has not been altered since it was provisioned by the issuer.
5.4.1 Offline Data Authentication The two methods of offline data authentication are Dynamic Data Authentication (DDA) and Combined DDA/Application Cryptogram Generation (CDA). This means that the terminal rather than the issuer uses these methods to locally authenticate the card and card data. With DDA the terminal verifies a dynamic signature (i.e. different for each transaction) generated by the card using its private key, in order to ensure that the card is not counterfeit and that the card data has not been altered. With CDA the card generates a dynamic signature of transaction data including the online cryptogram, in order to provide the protection of DDA while also ensuring that an intermediate (wedge) device has not altered important data going between the card and terminal. The specifications also include a version of offline data authentication called SDA (Static Data Authentication) which is a simple signature over static card data and was included as historically early cards did not have public key cryptographic capabilities. However it is not proof against cloning, meaning that the relevant data can be copied from a legitimate card and applied to a counterfeit product (blank stock). Such a cloned card will work in offline environments, but will fail if the transaction is sent online. Given the cryptographic capabilities of modern card products, SDA is no longer recommended and in addition Issuer Action Codes should be set to ensure that any SDA card product that appears in the field will have the transaction sent online, or be declined in an offline only environment.
5.4.1.1 Dynamic Data Authentication (DDA / CDA) DDA and CDA are mechanisms providing dynamic data authentication where the terminal uses a digital signature based on a private key internal to the card to authenticate the ICC and to confirm the legitimacy of critical ICC-resident data. This prevents the cloning of cards able to pass offline dynamic data authentication. The relationship between the data and the cryptographic keys is shown in Figure 2. For further information, please refer to EMV Book 2.
http://www.emvco.com. EMV and Cryptography Overview 7 Figure 2 - DDA / CDA CDA performs similar functions to DDA except that the Application Cryptogram and other transaction data (e.g. approval status) are included in the Signed Dynamic Application Data (the dynamic signature), rather than being returned in a separate operation. This allows the terminal to verify that the above information was generated by the card that produced the signature and to detect alterations made by an intermediate or ‘wedge’ device inserted between the card and terminal.
5.4.2 Online Authentication EMV’s online authentication methods are used to validate the card to the issuer and the issuer to the card as well as to prove the authenticity of received data. With Online Card Authentication (CAM) the issuer online system validates a cryptogram (an Application Cryptogram called an ARQC) generated by the card from important transaction data using its unique secret key, to show that the card is not counterfeit and that the data has not been altered. With Online Issuer Authentication, the card validates an issuer-generated cryptogram and then performs internal card management functions, such as the reset of offline counters. With secure messaging the issuer sends a script update to the card protected by a MAC. The card only applies the updates if the MAC is valid. Secure messaging is also used to encipher confidential data, such as a replacement PIN value during transport between the issuer and the card. For approved transactions the terminal sends a cryptogram (an Application Cryptogram called a TC) generated by the card with the clearing information for verification by the issuer as evidence of the validity of the completed transaction.
http://www.emvco.com. 8 EMV and Cryptography Overview 5.4.3 Cardholder Verification Methods EMV supports the following methods for verifying a legitimate cardholder: Signature Online PIN, where a cardholder-entered value is enciphered by the terminal/PIN pad and sent with an online authorisation request to the issuer for validation. Offline PIN, where a cardholder-entered value is sent to the card and the ICC compares this value to a reference PIN stored securely on the card. The terminal is informed of the success or failure of the verification. EMV provides for two types of offline PIN verification: Offline Plaintext PIN, where the cardholder-entered value sent to the ICC is unencrypted. Offline Enciphered PIN, where the cardholder-entered value is RSAenciphered by the terminal and deciphered by the ICC To prevent PIN probing attacks, dual interface (and contactless-only) cards should not respond to the VERFIY command over the contactless interface. Offline PIN encryption may be supported using either the DDA/CDA keys or dedicated keys. For security reasons the use of dedicated keys is a best practice, however dedicated keys may impact key management and transaction performance. The following tables illustrate the protections provided by these verification methods and the impacts to consider when choosing the methods to support. Signature Available with offline transactions Available at unattended devices PIN is always enciphered during transit Offline Plaintext PIN Offline Enciphered PIN Online PIN Table 3
- EMV Cardholder Verification Methods Issuers should be aware of the following statement made by EMVCo in early 2011: "The EMV Specifications for payment cards and terminals provide interoperability and security features, which act as building blocks for the payment systems and financial institutions to design their products and processes according to their wider risk management and acceptance requirements. In response to the report in March 2011 ‘Chip and PIN is Definitely Broken’, it is EMVCo’s view that when the full payment process is taken into account, suitable countermeasures are available. For example, it is well known that PINs can be stolen by the use of a variety of techniques (e.g. PIN pad overlays, hidden cameras, shoulder surfing, bogus terminals, social engineering). Using a rogue shim in a terminal supporting offline plaintext PIN (possibly subverting the card’s PIN encipherment preferences and causing an offline card authentication failure or even a decline) is another technique. The mitigation against this threat is that no transaction can be performed without also stealing the card where card cryptography operations are required for a successful transaction. This allows normal lost and stolen payment system protections to apply. Conversely the http://www.emvco.com. EMV and Cryptography Overview 9 mitigation against a genuine card being abused if lost or stolen is that the thief will not have access to the PIN, hence the PIN has a role to play despite the ‘eavesdropping threat’ and remains an important tool for protecting against lost and stolen fraud. " All of the PIN methods involve a precise interaction with the cardholder, the result of which is either right or wrong, whereas signature requires a human comparison that is subjective. The following table shows the impacts of each of these methods on the card, terminal, host processing, and transaction times. Card Terminal Acquirer Host Systems Issuer Host Systems Transaction Time Signature Must retain signature Signature collection and checking time. Offline Plaintext PIN Must support PIN pad Must provision card with PIN PIN entry time Offline Enciphered PIN Must support RSA Must support PIN pad and RSA Must provision card with PIN & ICC key PIN entry and RSA time Online PIN Must support PIN pad and be online capable Must support secure (enciphered) transport of Online PIN to authorisation system Must support online PIN verification as part of authorisation PIN entry and online authorisation time Table 4
- Impacts of EMV Cardholder Verification Methods 5.5 The Authorisation System Authorisation is a process whereby an issuer or a representative of the issuer approves or declines a transaction in response to an online authorisation request from a merchant via an acquirer. The online authorisation request includes a card generated authorisation cryptogram (ARQC) which the issuer validates to ensure that the card is authentic and the transaction data is unaltered. The online request also includes card and terminal indicators of the results of offline processing. In response to the ARQC, the issuer optionally creates an authorisation response cryptogram (ARPC). The card validates the ARPC to assure that the authorisation response came unaltered from the issuer. In addition to the ARPC described above, issuers can perform post-issuance updates of cards using issuer script commands. For example the issuer can change the Offline PIN or update a card’s risk parameters. The issuer protects these script commands from undetected alteration by generating a cryptogram (MAC) from the command data. The card validates the MAC before applying the changes. Confidential data is enciphered. http://www.emvco.com. 10 Issuer Transaction Processing 6 Security for EMV Card Issuance This section addresses the security related functions that need to be performed by an EMV card issuer. The focus is on the issuance of physical card products. Security measures for provisioning payment credentials to other form factors, such as mobile phones are not addressed. The generation, management and secure storage of the asymmetric issuer public/private key pairs. The transfer of the Issuer Public Keys to the Payment System CA for certification. The storage of Issuer Public Key certificates and the Payment System public keys for verification of these certificates. The generation of ICC public/private key pairs for use in DDA / CDA and offline PIN encipherment. The use of an issuer private key to certify ICC Public Keys or to sign application data for use in SDA. The optional use of the Certificate Revocation List (CRL) process. The generation and secure storage of symmetric Issuer Master Keys. The use of Issuer Master Keys to derive ICC Master Keys used for online authentication and secure messaging. The secure transport of keying material necessary for card provisioning, including the import/export of Issuer Master Keys (only necessary if other entities are to perform ‘on-behalf’ card verification services).
6.1 Issuing Portfolio Issuers perform the following activities during the life of a card issuance programme: Preparation - to be completed prior to any card issuance, Card production (SDA) - the steps for issuing cards employing Static Data Authentication, Card production (DDA and CDA) - the steps for issuing cards employing dynamic data authentication, Card issuance - the steps to provide cardholders with newly produced EMV cards, Online transaction processing - the procedures for supporting the ongoing use of EMV cards, including validation of the online cryptogram from EMV cards, verification of online PINs, and update of card application using issuer script commands. Transaction clearing - the processes for support of clearing and settlement of EMV transactions.
http://www.emvco.com. Issuer Transaction Processing 11 Obsolescence - during the life and at the end of a card issuance programme, various keys will become obsolete and should be destroyed.
6.1.1 Preparation The following activities need to be performed by an issuer prior to any card issuance. They also need to be performed when keys change or certificates expire.
6.1.1.1 Asymmetric (RSA) Keys Key Pair Generation
The issuer needs to securely generate and store one or more public/private key pairs. This requires the use of protected memory in a physically secure device, utilising a random or pseudo-random number generator and primalitychecking routines. Asymmetric Keys include: Issuer Key Pairs – the private key signs card static data and ICC Public Key certificates. The public key is sent to the Payment System CA to obtain an Issuer Public Key certificate. ICC Key Pairs – the private key is provisioned on the card and used for DDA/CDA and/or offline PIN decryption. The public key is signed by the Issuer Private Key to produce the ICC Public Key certificate. [6.1] The length |N| in bits of the RSA key moduli N (e.g. 1024, 1152, 1408, and 1984 bit keys) should be adequate for the planned active life of the cards to be issued under a given combination of scheme key, issuer key and card key. It is strongly recommended that Issuers select moduli of sufficient size that they are resistant to computational attacks, i.e., factoring of the public key modulus. For performance reasons it is recommended that the Payment System key chosen for certifying the Issuer Public Key be commensurate with the lifetime of the cards to be issued rather than the longest possible. The issuer key may then be the same length as the Payment System key or in accordance with the Bulletin recommendations for Payment System Public Keys and the card key length chosen to optimize performance balanced against risk. The minimum recommended key length for a card is 1024 bits for cards expiring prior to 2022. For cards expiring after this date a key length of 1152 is recommended, but 1408 is preferred. Issuers should note that TLV encoded templates need to fit within the 254 byte record limit and consequently for the record containing the ICC Public Key Certificate, accommodating the tags and lengths of the certificate and record template means that the size of the certificate has to be less than 254 bytes. For this reason the size is restricted to 247 bytes (1976 bits) which means that the Issuer Public Key which is the same length as the ICC Public Key Certificate is also restricted to a maximum of 247 bytes. [6.2] Issuers should periodically review the length of their RSA key pairs and when deemed no longer fit for service should move to a longer key. Equally, public exponents should also be reviewed, particularly with respect to card keys. Issuers should note that whilst it might be reasonably argued that it is unlikely that all the resources required to break a key would be brought to bear on a single card and
http://www.emvco.com. 12 Issuer Transaction Processing thus cards are not of high concern, an issuer with a large portfolio under a given issuer key would be a more attractive target, even if only in terms of causing reputational damage from what "might be done". Such reputational damage would not be solely restricted to the Issuer in question, but would reflect badly on the payments industry in general. [6.3] The generation of primes should be performed in accordance with ISO/IEC18032. [6.4] For RSA key generation the two primes p and q for any given key pair should differ by at least 2|N|/2 - 100. [6.5] When selecting the value of the public exponents consideration should be given to performance issues. In general terminals will take longer to compute when using e = 216 + 1 than when using e = 3 and this may be quite noticeable in lower end devices1. The formats used within EMV for both signature generation and PIN encryption are considered to be secure for both values of e when deployed in ICCs satisfying the current security evaluations. [6.6] The random or pseudo-random process should be such that it is not possible to predict any key or determine that certain keys within the key space are significantly more probable than any other. For further information on random or pseudo-random number generators see ISO/IEC 18031. [6.7] The physically secure device used to create the RSA key pairs and to secure the private key should be tamper responsive and satisfy the security requirements defined for HSMs (see Section 6.1.1.3). [6.8] Where the Payment System permits, it is recommended that the issuer should assign separate key pairs per Issuer Identification Number (IIN) to limit the number of cards using a single key pair2 and thus the number of cards impacted by a compromise. [6.9] The Issuer Public Key should be managed in such a way that it is unchanged when sent to the CA for certification. [6.10] Issuer public/private key pairs should be unique to each Payment System. Procedural guidance on key generation can be found in Section 8. Receive the Payment System Public Key(s). The issuer needs to receive and securely store one or more Payment System CA Public Keys. [6.11] The issuer should verify the integrity and origin of the CA Public Keys in accordance with the Payment System requirements. 1 Other values than 3 or 216 + 1 are mathematically acceptable, but EMV terminal type approval is limited to the two recommended values, carried in 1 byte and 3 bytes respectively and therefore acceptance of other exponents is not assured. 2 Also in the event of a single issuer private key compromise the number of cards impacted through the Certificate Revocation List (CRL) process is reduced.
http://www.emvco.com. Issuer Transaction Processing 13 Request and Receive Issuer Public Key Certificates. The issuer needs to transfer each Issuer Public Key to the Payment System CA and receive in return a signed public key certificate. [6.12] The Issuer Public Keys should be transferred in such a way that the Payment System CA can verify their integrity and origin. [6.13] Upon receipt of a public key certificate from the Payment System CA, the issuer should verify it using the relevant Payment System Public Key.
6.1.1.2 Symmetric Keys Issuer Master Key Generation
The issuer needs to securely generate and store one or more master derivation keys to be used to derive the ICC Master Keys unique to each card application. This requires the use of protected memory in a physically secure device, utilising a random or pseudo-random number generator. The choice of symmetric algorithm is at issuer discretion, however for historical reasons and for support of a common choice for stand-in services, DES (2TDES) has usually been selected. AES is the more recent recommendation and a gradual migration can be expected. DES/AES keys in the EMV specification are used for specific transaction functions. Card DES/AES keys are derived from an Issuer master derivation key at the time of provisioning. The resultant card level keys are unique. Issuer Master Keys include: Issuer Master Key (IMKAC) - used to derive the card keys that are used to generate MACs known as Application Cryptograms (AC). Issuer Master Key for Secure Messaging for Integrity (IMKSMI) - used to derive card keys used in the secure messaging for integrity of post issuance processes between the card and the authorisation system; e.g., card blocking, application blocking/unblocking, updating card specific data, and PIN changes. Issuer Master Key for Secure Messaging for Confidentiality (IMKSMC) - used to derive card keys used in secure messaging for confidentiality of post issuance processes between the card and the authorisation system; e.g. PIN change. Issuers may use several keys for the same purpose, for example across IIN ranges. Payment systems may provide for additional key separation per IIN using issuer Master Key sets containing multiple keys. The selected key used may be identified by means of an index, stored on the card and returned in the Issuer Application Data associated with the cryptogram. [6.14] DES/AES keys should be generated either inside a physically secure device protected by tamper responsive mechanisms, OR [6.15] by authorised personnel in component form through a process of combining components, each party generates a component that is as long as the key being generated. The key combination process takes place inside a physically secure device. Moreover, the method of combining the components must be such that knowledge of any subset of the components yields no knowledge about the key value. Where keys are generated in component form at a card provisioner, at least one component should be generated by an employee of the issuer.
http://www.emvco.com. 14 Issuer Transaction Processing [6.16] A random or pseudo-random process should be used such that it is not possible to predict any key or determine that certain keys within the key space are significantly more probable than any other. Further information concerning random or pseudo-random number generators can be found in ISO/IEC 18031. [6.17] It is recommended that issuers assign separate keys per Issuer Identification Number (IIN) in order to limit the number of cards using a single key. [6.18] A key should only be used for the cryptographic purpose for which it was intended and not for any other purpose, e.g., separate master derivation keys should be used to generate the card keys for application cryptogram generation, secure messaging integrity and secure messaging encryption. [6.19] Issuer symmetric master keys should be changed periodically (e.g. annually). This does not mean that keys must be updated in the deployed card base, but rather that the issuer must be able to manage several key versions at a time, each key version being destroyed once the last card containing its derived form has expired and disputes are no longer expected. Further general guidance on key generation is given in Section 8.1. Transfer of Issuer Master Keys. If the issuer delegates responsibility for card provisioning or generation and verification of online cryptograms to a third party, or to different systems within his own processing center, then the issuer needs to securely transfer the issuer master key(s) used to derive the ICC keys to the third party or other system (see also Section 8.3). Backup of Issuer Master Keys. In some situations it may be necessary to recover the issuer master keys used for the provisioning of cards and for the authorisation of card transactions. [6.20] When backing-up critical master keys it is recommended that a key either be enciphered under another key of at least equal cryptographic strength, or maintained as two or more components, secured using the principles of dual control and split knowledge. This process should be audited.
6.1.1.3 HSMs All key generation, key derivation and signing should be done in an HSM. For guidance on HSM security, see ISO 9564, ISO 13491 and PCI Security Standards Council www.pcisecuritystandards.org.
http://www.emvco.com. Issuer Transaction Processing 15 6.1.2 Security Counters If key use limits are provided by security counters then values need to be established to control the situation if cards are abused. [6.21] Recommended values for a typical CPA contact online-offline environment are: Offline PIN Decipherment Error Counter Limit = 500 ATC maximum usage = 20,000 AC Session Key Counter Limit = 20,000 SMI Session Key Counter Limit = 1,000. Note that individual Payment Systems may provide alternative values. The Offline PIN Decipherment Error Counter is only incremented when PIN decipherment fails and the counter is never reset. The AC Session Key Counter is incremented every time an AC session key is derived and is reset when an ARPC is successfully verified. The SMI Session Key Counter is only incremented when the verification of a Secure Messaging MAC fails and is never reset.
6.1.3 Card Production (SDA) The following security relevant steps need to be performed by an issuer for each SDA card issued. This section is retained for continuity – production of SDA cards is no longer recommended. Static data preparation. The issuer generates the data for card provisioning. The magnetic-stripe check value (CVC/CVV/CSC/CVN) in the Track 2 Equivalent Data should be calculated differently from the value on the magnetic-stripe in accordance with payment system rules. Signing of static data. The issuer signs selected card static data using an issuer private key to produce the Signed Static Application Data. Two of the important data elements to sign are the SDA Tag List (tag 9F4A) and consequently, the AIP (tag 82). [6.22] Issuers should follow Payment System recommendations and requirements for the data elements to be signed. It is strongly recommended that these include the SDA Tag List with AIP. ICC Master Key derivation. The ICC Master Keys for application cryptograms and script message security must be derived from the appropriate issuer master key using card data such as Application PAN and Application PAN Sequence Number. PIN generation. A Reference PIN must be generated for the IC Card if offline PIN is supported. Its value should be the same as the online PIN value. Provide data to card provisioning process. Make arrangements for the Issuer Public Key Certificate, the Certificate Authority Public Key Index, Signed Static Application Data, derived secret keys, the Derivation Key Index (if used), and Reference PIN to be provisioned on the cards.
http://www.emvco.com. 16 Issuer Transaction Processing All data for provisioning needs to be transferred securely to the card provisioner for writing to the IC Card. [6.23] All data should be protected (e.g. by a MAC or signature) from the point at which it leaves the system that created the data, to the point at which it is stored on the card. [6.24] Secret keys and PINs must in addition be kept confidential.
6.1.4 Card Production (DDA and CDA) The following security relevant steps need to be performed by an issuer for each card supporting dynamic data authentication or Offline Enciphered PIN. Static data preparation. The issuer generates the data for card provisioning. Signing of static data. Although not recommended, if the option to support SDA on a DDA/CDA card is chosen, then the issuer produces the Signed Static Application Data as per 6.1.3. Note that the same static data is also signed as part of signing the ICC Public Key (see below). ICC Key Pair generation. A unique public/private key pair must be securely generated for each ICC. If a separate key is to be used for offline PIN encipherment then this must also be securely generated. Signing of ICC Public Key to produce ICC Public Key Certificate. The ICC Public Key (and associated data) together with selected card static data must be signed using one of the Issuer Private Keys to form the ICC Public Key Certificate. The private key used for signing the certificate must correspond to the Issuer Public Key Certificate being provisioned on the card. A similar certificate is produced in the case that a separate key is used for offline PIN encipherment. ICC Master Key derivation. The ICC Master Keys for application cryptograms and script message security must be derived from the appropriate Issuer Secret Key using card data such as Application PAN and Application PAN Sequence Number. PIN generation. A Reference PIN must be generated for the IC Card if offline PIN is supported. Its value should be the same as the online PIN value. Provide data to card provisioning process. Make arrangements for Certificate Authority Public Key Index, Signed Static Application Data, Derivation Key Index (if used), Issuer Public Key Certificate, ICC Public Key Certificate, ICC Private Key, derived secret keys, and Reference PIN to be provided to card provisioning process. Card Signature Process – cards that use CRT (Chinese Remainder Theorem) for the signature calculation require a specific evaluation that it is implemented securely (see Section 6.1.6.2). All data for provisioning needs to be transferred securely to the card provisioner for writing to the IC Card. [6.25] All data should be kept confidential by procedural processes and in addition should be cryptographically protected for integrity (e.g. by a MAC or signature) from the point at which it leaves the system that created the data, to the point at which it is stored on the card.
http://www.emvco.com. Issuer Transaction Processing 17 [6.26] Secret and private keys and PINs must in addition be kept cryptographically confidential (e.g. by encryption). [6.27] After provisioning both the IC Card issuer and the provisioner must erase all records of the ICC private key 6.1.5 CVM Choice Issuers must provision each IC card with a prioritised list of CVMs supported by the IC card (e.g. online PIN, offline enciphered PIN, offline plaintext PIN, signature, No CVM). If the IC card supports offline PIN then the card should be provisioned with the value of the cardholder’s PIN (note that the PIN may also be loaded into the IC card postissuance using script commands). If the IC card supports offline enciphered PIN then the IC card must be provisioned with an RSA private key and public key certificate (see Section 6.1.4).
6.1.6 Card Issuance The provisioned ICC and PIN must be securely and separately transferred to the cardholder following the requirements of ISO 9564-1.
6.1.6.1 Card Lifetime Issuers are responsible for selecting an appropriate IC platform and corresponding ICC. To protect the interests of the Payment System and those of the issuer, EMVCo provides Security Approvals for ICs, Platforms (IC + OS) and CPA ICCs. Payment Systems provide their own security approvals for other ICCs. Unlike HSMs which are designed to be located within a secure environment, ICs are designed for use in an unprotected environment. In general they rely on tamper resistance to protect sensitive information. EMVCo provides IC Security Guidelines to all IC vendors that submit ICs for the Security Evaluation process. Due to advances in the threats to IC technologies, ICCs that are secure against known attacks when first designed may not remain secure against attacks discovered after issuance. The longer an ICC remains in the field, the more likely it is that an economically viable attack will become available to fraudsters. Therefore, EMVCo recommends that new ICs and Platforms are used.
- EMVCo IC and Platform security approvals are granted for a period of 1 year, and annually reviewed thereafter for a maximum approval period of 6 years (note also that Platform approval renewal is possible only if the underlying IC security approval is still valid), unless the approval certificate is withdrawn or the product is superseded by newer products This timeframe represents a balance between anticipated improvements in IC and Platform design, new threats, and commercial considerations.
- Additionally, EMVCo CPA/CCD security approvals are granted for a period of 3 years, and annually reviewed thereafter up to a maximum approval period of 6 years. A specific extension process has been put in place for expired IC and/or Platform certificates so that annual reviews of CPA/CCD products remain possible beyond expiry of these underlying http://www.emvco.com. 18 Issuer Transaction Processing certificates. Expired ICs and Platforms are still allowed to be updated, as well as their associated security guidance.
- When choosing an EMVCo-approved IC or Platform, the initial approval date of the product should be taken into careful consideration to ensure that the chosen product is suitable for the planned lifetime of the card. Card inventory, issuing cycles and other related production issues all impact the effective lifetime of a card. When these factors are taken into consideration, it could be as long as 6 years from chip design to actual issuance, which would mean that the chip in a 5 year card would be in the field for approximately 11 years. This recommendation becomes even more important in environments that use off-line authentication because of the increased incentive for successful attacks.
6.1.6.2 ICC and ICC Application Security Issuers are responsible for selecting an ICC product (built on an approved IC and Platform and hosting an ICC Application). To protect the interests of the Payment System and those of the issuer, EMVCo provides Security Approvals for ICs, Platforms and CPA/CCD compliant ICCs. Payment Systems provide their own security approvals for other ICCs. Unlike HSMs which are designed to be located within a secure environment, ICCs are designed for use in an unprotected environment. In general they rely on tamper resistance to protect sensitive information. EMVCo provides dedicated Security Guidelines to all IC, Platform and CPA/CCD compliant ICC vendors who submit their products for the Security Evaluation process. Management of the security for the card application includes the underlying IC and Platform (if applicable), application development security and post issuance application data security. Whilst it is beyond the scope of these guidelines to provide specific details, the following is a list of important considerations that should be used in the development and implementation of an EMV based application and that are addressed in the associated security evaluations. Application development will take place in a tightly managed and audited environment to eliminate undesirable features such as rogue code and unwanted test functionality. In case of a Flash memory product, this also includes the production environment at which the product will be programmed.
http://www.emvco.com. Issuer Transaction Processing 19 Cryptographic functions will be designed to minimize key leakage from timing measurements or power analysis. The use of individual keys will be restricted by means of session key processes and security counters. Post issuance functionality will be restricted to eliminate unauthorized data manipulation and cards will employ data integrity checks on a regular basis. Cards need to be resilient to a variety of attacks on the RSA calculations, targeted at disclosing the card private key. These include side-channel analysis, and perturbation attacks. From a security perspective, both the use of the Chinese Remainder Theorem (CRT) as a technique for improving calculation performance3 and the choice of public exponent have an impact. For example when using e = 3, the most significant half of the private exponent can be calculated mathematically and thus cards need to have high resistance to attacks which can reveal the remaining bits of the key. Cards using ICs and/or Platforms that are on the approved EMVCo security evaluation product list will have been rated "high assurance" for all RSA implementations and exponents that they support. Therefore issuers only need to concern themselves from the point of view of performance, not security. [6.28] Issuers should only use EMVCo approved ICs and Platforms. [6.29] Issuers should pay extra attention to the lifecycles of the IC and Platform to ensure they are appropriate for the desired lifetime of the card (refer to Section 6.1.6.1) [6.30] Application software should be developed and loaded in a controlled environment. This environment should not only be physically secure, but should be managed using procedures that ensure the integrity and confidentiality of the application and its source code. [6.31] Data to be used for provisioning should be managed in accordance with existing data and IT security policies of the issuer. Secret application data, including cryptographic keys, reference PINs and other data designated as secret, should never be accessible in plaintext form. [6.32] Secret application data should not be accessible outside the routines specified by the application. Consequently, no undocumented methods of updating, resetting or incrementing data should be permitted.
6.1.6.3 Privacy issues Issuers should be aware that there may be privacy concerns with data that is available over the contactless interface of a card (or mobile phone). It is therefore recommended that personal data is not sent over this interface as part of a normal transaction and should not be available using any command over the contactless interface. Payment systems may have specific local requirements regarding card data transmitted over the contactless interface. Experience indicates that particular attention should be paid to products that migrate from contact to contactless (including mobile devices). In many cases cardholder personal information is available over the contact interface for legitimate customer 3 CRT accelerates RSA operations by performing the modular exponentiations based on the two primes that make up the RSA modulus, rather than the modulus itself.
http://www.emvco.com. 20 Issuer Transaction Processing service reasons. Since this feature should not be available over the contactless interface, care needs to be taken that the transition from contact takes this into account.
6.2 Key Obsolescence This section provides guidance for the destruction of obsolete keys and associated keying material.
6.2.1 Key Retention The basic principle is that a key may be retained until it is known that it is no longer required. It should then be destroyed. [6.33] An Issuer Private key should be retained until no more cards will be provisioned using this key. [6.34] An Issuer master derivation key should be retained until no disputes may be expected from any card with a key derived with this key. Issuer keys – retain.
6.2.2 Key Destruction [6.35] Obsolete keying material should be destroyed using methods that are appropriate for the medium containing the keying material(s). For keying material stored on an ICC, the chip should be physically destroyed (e.g. by punching a hole) after using any available on-chip erasure methods. For keying material stored on magnetic media, the media should be purged to appropriate magnetic remanence standards. Removable media should be physically destroyed (e.g. shredded). Note that modern hard drives have sector remapping facilities that may reduce the effectiveness of purging so physical destruction of the platters as well as purging should be considered. For keying material stored on other electronic devices, the device should be purged by a security deletion method that ensures adequate deletion with no residual memory. Consideration should be given to the physical destruction of the device, including and in particular the memory chip or chips. Obsolete Keys stored in a SCD should be erased by the SCD security mechanisms. Issuers should encourage their cardholders to destroy expired cards (e.g. by shredding) but it must be expected that many cards will not be disposed of on expiry and they would continue to function if activated, although live terminals would not accept transactions from them. [6.36] An independent third party; e.g., an internal auditor, should witness the destruction of keying materials, documenting the process. The resultant documentation should be retained for a period consistent with the issuer's documentation retention policies.
http://www.emvco.com. Issuer Transaction Processing 21 6.3 Certificate Revocation Lists If an issuer private key is compromised, fraudulent cards that pass offline data authentication could be created using this key. They would be accepted at terminals for offline transactions until the certificate for the compromised key expires, which for some keys could be many years into the future. The impact of the issuer key compromise can be mitigated through the use of Certificate Revocations Lists (CRLs). With CRLs each EMV terminal is required to accommodate 30 negative certificate entries per Payment System. When processing the issuer certificate for offline data authentication, the terminal checks whether the certificate read from the card is listed amongst the CRL entries and if so, offline data authentication will fail. It should be noted that in addition to any fraudulent cards, all legitimate cards made with the key will also be identified by the terminal and rejected for offline working. Unless there is high confidence that terminals will be able to go online and maintain acceptance, the effected cards should be re-issued prior to adding the certificate to the CRL. [6.37] In the event an issuer detects that their private (signature) key corresponding to their Issuer Public Key certificate has been compromised, it is strongly recommended that the compromised key pair be replaced and re-issuance schedules for cards with public key certificates created by the compromised key be established and implemented to mitigate the issuer’s potential fraud risk. [6.38] The decision whether to request posting of a certificate on the CRL needs to be taken against the background of the level of fraud, the time before the compromised certificate expires and the card settings and terminal capabilities for going online when offline data authentication fails. Note that CRLs may not be universally available in the general acceptance environment.
http://www.emvco.com. 22 Issuer Transaction Processing 7 Issuer Transaction Processing 7.1 Online Transaction Processing The following security relevant steps need to be performed by an issuer for each online transaction. Cryptogram exchanges. As part of the security procedures surrounding a card transaction at a merchant (with on-line capability), the IC Card or the merchant terminal may require an online authorisation including card authentication. Card authentication involves passing an Application Cryptogram (ARQC) from the card to the issuer. The card generates the cryptogram by encipher
Shown in part. Read the original for the full text.