EMV SWG NH20r2a Issuer Security Guidelines For 1st Gen August2018
EMV SWG NH20r2a Issuer Security Guidelines For 1st Gen August2018
EMV SWG NH20r2a Issuer Security Guidelines For 1st Gen August2018
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Table of Contents i
TABLE OF CONTENTS
1 Scope .................................................................................................................................. ii
2 References ........................................................................................................................ iii
3 Definitions ........................................................................................................................ iv
4 Abbreviations and Notations .......................................................................................... vi
5 EMV and Cryptography – Overview ..............................................................................1
5.1 Introduction .............................................................................................................................. 1
5.2 Payment System Model ............................................................................................................ 1
5.2.1 The Cardholder ................................................................................................................. 2
5.2.2 The Merchant .................................................................................................................... 2
5.2.3 The Issuer ......................................................................................................................... 2
5.2.4 The Acquirer ..................................................................................................................... 2
5.2.5 The Payment System ........................................................................................................ 3
5.3 Cryptographic Basics ................................................................................................................ 3
5.3.1 Symmetric Algorithms ...................................................................................................... 3
5.3.2 Asymmetric Algorithms ................................................................................................... 4
5.4 EMV Card Authentication Methods ......................................................................................... 6
5.4.1 Offline Data Authentication.............................................................................................. 6
5.4.2 Online Authentication ....................................................................................................... 7
5.4.3 Cardholder Verification Methods ..................................................................................... 8
5.5 The Authorisation System ........................................................................................................ 9
6 Security for EMV Card Issuance ...................................................................................10
6.1 Issuing Portfolio ..................................................................................................................... 10
6.1.1 Preparation ...................................................................................................................... 11
6.1.2 Security Counters ........................................................................................................... 15
6.1.3 Card Production (SDA) .................................................................................................. 15
6.1.4 Card Production (DDA and CDA) .................................................................................. 16
6.1.5 CVM Choice ................................................................................................................... 17
6.1.6 Card Issuance .................................................................................................................. 17
6.2 Key Obsolescence ................................................................................................................... 20
6.2.1 Key Retention ................................................................................................................. 20
6.2.2 Key Destruction .............................................................................................................. 20
6.3 Certificate Revocation Lists ................................................................................................... 21
7 Issuer Transaction Processing........................................................................................22
7.1 Online Transaction Processing ............................................................................................... 22
7.2 Fraud Detection ...................................................................................................................... 22
7.2.1 By Issuer ......................................................................................................................... 22
7.2.2 By Card ........................................................................................................................... 23
7.3 Transaction Clearing ............................................................................................................... 24
8 Key Management Practices ............................................................................................26
8.1 Key Generation – General Guidance ...................................................................................... 26
8.2 RSA Key Transport and Storage ............................................................................................ 27
8.3 Symmetric Key Transport and Storage ................................................................................... 27
Annex A Cryptographic Algorithms – Worked Examples .................................................29
A.1 - Introduction ............................................................................................................................... 29
A.2 - Notation Used ............................................................................................................................ 30
A.3 - Purchase with Online Authorization.......................................................................................... 31
A.4 - PIN Change ............................................................................................................................... 36
A.5 - Static Data Authentication ......................................................................................................... 41
A.6 - Dynamic Data Authentication (DDA) ....................................................................................... 45
A.7 - Combined DDA / AC Generation (CDA) ................................................................................. 57
A.8 - Offline PIN Encipherment ......................................................................................................... 62
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
iv Definitions
3 Definitions
Authentication A cryptographic process that validates the identity
and integrity of data.
Certificate (public key) 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.
Certification Authority The entity that is trusted by one or more other entities
to create and assign certificates.
Cryptographic Algorithm 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.
Digital Signature The cryptographic transformation of data which
provides:
origin authentication, and
data integrity.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Definitions v
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
vi Abbreviations and Notations
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Abbreviations and Notations vii
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
EMV and Cryptography Overview 1
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
2 EMV and Cryptography Overview
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
6 EMV and Cryptography Overview
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
EMV and Cryptography Overview 7
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
8 EMV and Cryptography Overview
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
10 Issuer Transaction Processing
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
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
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
14 Issuer Transaction Processing
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Issuer Transaction Processing 15
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.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
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
18 Issuer Transaction Processing
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
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.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Issuer Transaction Processing 21
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
22 Issuer Transaction Processing
7.1.1.1 HSMs
Cryptogram and secure message processing should be done in an HSM.
For guidance on HSM security, see ISO 13491, ISO 9564 and PCI Security Standards
Council www.pcisecuritystandards.org.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Issuer Transaction Processing 23
Application Interchange Profile (AIP) should be checked to assure they match the
provisioned value.
[7.3] Issuers should proactively monitor EMV transactions to detect fraudulent
use of IC Cards and terminals and possibly counterfeit cards. Some areas to
monitor could include:
Offline indicators sent online – when making the decision regarding whether
to approve or decline the transaction, consider using indicators that are sent
online in the Issuer Application Data and other online data elements. These
may show offline data authentication failures, offline PIN failures, bypass of
PIN entry, and other offline occurrences that may be indicators of fraud.
Online cryptograms – validate the cryptogram for both the authorisation and
clearing messaging to assure the validity of the card. It is recommended that
an ARPC is only returned if the ARQC verification is successful. However if
an issuer still intends to return an ARPC when ARQC verification has failed,
then the ARPC should not be calculated from the ARQC received from the
network.
ATC – check for duplicate ATCs, ATCs that are smaller than the ATCs of
previous transactions and large gaps between the current ATC and the
ATCs of recent/previous transactions. Please note that duplicate ATCs may
legitimately occur with authorisation request repeats and authorisation
requests for subsequent validation of the online PIN when the previously
entered PIN has failed validation. An ATC received out of sequence may be
caused by a deferred authorization.
Magnetic stripe reads of chip cards at chip terminals – these can be an
indicator of fraud but also may be due to problems with the chip or chip
reader.
Inconsistent chip data – check that the chip data received in the
authorisation and clearing messages is consistent with what was
provisioned or updated on the card.
Script commands – assure that chip-read transactions are not being
received from cards or applications that were previously blocked using script
commands.
[7.4] The following actions should be taken to prevent fraud and credit losses:
Block the application or card when the card is stolen.
Adjust velocity limits to reflect the cardholder's current offline purchasing
power.
[7.5] To assist in dispute resolution, issuers should retain online transaction data
in accordance with payment system recommendations and requirements.
Issuers who have issued cards that log transaction data should consider
using these logs to assist in dispute resolution.
7.2.2 By Card
Issuers have the option to deploy card products that request transactional information
such as CVM Results which can then be checked against the card’s understanding of
the transaction status. The results can be used as part of the card’s risk management.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
24 Issuer Transaction Processing
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Issuer Transaction Processing 25
could be used in dispute resolution include ATC, TVR, CVM Results, and
Issuer Application Data.
6) to assist in dispute resolution issuers should retain online transaction data
in accordance with payment system recommendations and requirements.
Typically this will include ARQCs, TCs and supporting data.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
26 Key Management Practices
[8.7] The integrity of keys must be ensured. Check digits within an HSM and
MACs outside the HSM are suitable mechanisms for this purpose. If used,
check digits must be calculated for the full component or for the actual key.
Check digits calculated for components can be transferred with the
component.
[8.8] If any secret or private cryptographic keys are found to exist outside of a
physically secure device or the components of a cryptographic key are
known or suspected to have been under the control of a single individual,
then the keys are to be considered to have been compromised.
4Note that in case of an unintended deletion of an Issuer private key there need be no interruption for existing
cards and certificates, but the issuer will need to generate and certify a new key.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
28 Key Management Practices
In the form of two or more components using the principles of dual control
and split knowledge, or
As a cryptogram, created by a transport or storage key that has been
securely established by the parties. This process should use key wrap
techniques, see for example ISO 20038.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 29
A.1 - Introduction
This chapter provides examples of various cryptographic operations implemented in respect of CPA
applications. They include:
Purchase with Online Authorization:
Card key derivation
EMV common session key derivation
ARQC computation
ARPC computation
TC computation
PIN Change:
Card key derivation for encryption
EMV common session key derivation for encryption
PIN block encryption
Card key derivation for script MAC
EMV common session key derivation for script MAC
Script MAC computation
Static Data Authentication:
Verification of Signed Static Application Data (SSAD)
Dynamic Data Authentication:
Verification of ICC Public Key Certificate
Derivation of Card key for IDN
IDN computation
Generation of Signed Dynamic Application Data (SDAD) for DDA
ICC Public Key Certificate verification
Verification of SDAD for DDA
Combined DDA / AC Generation:
Encryption of offline counters
Generation of SDAD for CDA
Offline PIN Encipherment:
Verification of ICC PIN Encipherment Public Key Certificate
Encryption and Decryption of PIN
For definitions of the cryptographic functions see EMV Book 2.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
30 Annex A
DES3(K)[D] denotes the encryption of the data block D using key K and the Triple DES encryption algorithm
(in the Electronic Code Book mode of operation).
CBC_DES3(K)[D] denotes the encryption of the data D (which must be a whole number of blocks) using key
K and the Triple DES encryption algorithm (in the Cipher Block Chaining mode of operation).
MAC(K)[M} denotes the 8-byte MAC computed on the message M using key K and the MAC algorithm
specified in [EMV2} Annex A1.2 and ISO/IEC 9797-1 Algorithm 3 with DES as the block cipher. Note that
padding of M is performed as part of the MAC algorithm.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 31
Value:
9E 15 20 43 13 F7 31 8A CB 79 B9 0B D9 86 AD 29
Input
Output
MKAC = DES3(IMKAC)[Input] || DES3(IMK AC)[Input ‘FF FF FF FF FF FF FF FF’]
Although this does not affect the computations using this key, the result is submitted to the DES parity forcing
rule (each byte has an odd number of 1-bits, achieved by appropriately setting the least significant bit of each
byte). Some implementations will refuse a DES key that does not conform to this parity forcing.
08 DF 34 25 32 20 A7 20 EF F2 C1 34 38 52 E6 3D
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
32 Annex A
Key
The Issuer Master Key for AC computation: IMK AC
Value:
9E 15 20 43 13 F7 31 8A CB 79 B9 0B D9 86 AD 29
Input
Output
MKAC = DES3(IMKAC)[Input] || DES3(IMK AC)[Input ‘FF FF FF FF FF FF FF FF’]
Although this does not affect the computations using this key, the result is submitted to the DES parity forcing
rule (each byte has an odd number of 1-bits, achieved by appropriately setting the least significant bit of each
byte). Some implementations will refuse a DES key that does not conform to this parity forcing.
76 7C 58 7A 61 4C C7 29 97 2C 92 E3 92 EC A4 5B
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 33
Input
For AC computation, the input is the concatenation of:
The Application Transaction Counter (ATC):
34 56
Six zero bytes:
00 00 00 00 00 00
Concatenation:
34 56 00 00 00 00 00 00
Output
The concatenation of:
The Triple-DES Encryption of the input with the third byte replaced by ‘F0’
The Triple-DES Encryption of the input with the third byte replaced by ‘0F’
This amounts to:
SKAC = DES3(MKAC)[(ATC || ‘F0’ || ‘00’ || ‘00’|| ‘00’|| ‘00’|| ‘00’)] || DES3(MK AC)[(ATC || ‘0F’ || ‘00’ || ‘00’||
‘00’|| ‘00’|| ‘00’)].
18 20 25 BA 4F AB 32 F5 A6 3A 1B A5 E6 84 5D 4E
Note The result can be submitted to parity forcing, like the Card Master Keys. This
is not shown here as this is entirely internal to the ICC, and the computation is
not affected. This is not recommended for security reasons.
Input
The input is the concatenation of the values of:
Amount (Authorized):
00 00 00 01 00 00
Amount (Other):
00 00 00 00 10 00
Terminal Country Code:
08 40
Terminal Verification Results:
00 00 00 10 80
Transaction Currency Code:
08 40
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
34 Annex A
Transaction Date:
98 07 04
Transaction Type:
00
Unpredictable Number:
11 11 11 11
Application Interchange Profile (AIP):
58 00
Application Transaction Counter:
34 56
Issuer Application Data:
0F A5 00 A0 38 00 00 00 00 00 00 00 00 00 00 00
0F 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Concatenation:
00 00 00 01 00 00 00 00 00 00 10 00 08 40 00 00
00 10 80 08 40 98 07 04 00 11 11 11 11 58 00 34
56 0F A5 00 A0 38 00 00 00 00 00 00 00 00 00 00
00 0F 01 00 00 00 00 00 00 00 00 00 00 00 00 00
00
Output
ARQC = MAC(SKAC)[Input]:
C2 00 39 27 0F E3 84 D5
Input
The input is the concatenation of:
The ARQC:
C2 00 39 27 0F E3 84 D5
Output
ARPC = MAC4(SKAC)[Input], where MAC4 denotes the first 4 bytes of the MAC
90 EF 47 7F
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 35
A.3.5 - TC Generation
Key
The Session Key SKAC as derived above:
18 20 25 BA 4F AB 32 F5 A6 3A 1B A5 E6 84 5D 4E
Input
The input is the concatenation of the (current, refreshed) values of:
Amount (Authorized):
00 00 00 01 00 00
Amount (Other):
00 00 00 00 10 00
Terminal Country Code:
08 40
Terminal Verification Results:
00 00 00 10 80
Transaction Currency Code:
08 40
Transaction Date:
98 07 04
Transaction Type:
00
Unpredictable Number:
11 11 11 11
Application Interchange Profile (AIP):
58 00
Application Transaction Counter:
34 56
Issuer Application Data:
0F A5 00 62 38 00 00 00 00 00 00 00 00 00 00 00
0F 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
The concatenation:
00 00 00 01 00 00 00 00 00 00 10 00 08 40 00 00
00 10 80 08 40 98 07 04 00 11 11 11 11 58 00 34
56 0F A5 00 62 18 00 20 00 00 00 00 00 00 00 00
00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00
Output
TC = MAC(SKAC)[Input]:
60 2D 63 CC BF DE 58 FE
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
36 Annex A
Input
The concatenation of:
The rightmost 7 bytes of the PAN (format n; if it is short, left-pad with 0-nibbles to obtain 7 bytes).
For PAN
13 33 90 00 00 61 65
Output
MKSMC = DES3(IMKSMC)[Input] || DES3(IMK SMC)[Input ‘FF FF FF FF FF FF FF FF’]
Although this does not affect the computations, the result is submitted to the DES parity forcing rule (each
byte has an odd number of 1-bits, achieved by appropriately setting the least significant bit of each byte).
Some implementations will refuse to use a DES key that does not conform to this parity forcing.
DA 83 49 40 98 92 F2 31 61 52 BF 80 7F 46 B6 23
Input
The input is the last AC, in this case the ARQC:
14 1D 34 65 C6 85 7C 46
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 37
Output
The concatenation of:
The Triple-DES Encryption of X = “the input with the third byte replaced by ‘F0’ ”
The Triple-DES Encryption of Y = “the input with the third byte replaced by ‘0F’ ”
This amounts to:
SKSMC = DES3(MKSMC)[X] || DES3(MKSMC)[Y]:
F3 53 01 FF 7A CF 75 9C AC FF 35 56 01 D9 9E A4
Note The result can be submitted to parity forcing, like the Card Master Keys. This
is not shown here as this is entirely internal to the ICC, and the computation is
not affected.
Computation
The computation is described as a 2-block ECB (Electronic Code Book mode) Encryption of “X || Y”.
Input
For Secure Messaging for Confidentiality (Script Encryption), the input consists of the concatenation of the
plaintext command data, in this case the PIN block, padded according to ISO 9564-3. For PIN 12345:
25 12 34 5F FF FF FF FF 80 00 00 00 00 00 00 00
Output
The Triple-DES CBC encryption of the input:
EncData = CBC_DES3(SKSMC)[Input]:
DB 8D 1E 79 82 52 56 06 32 70 3D A7 2F B1 9B EA
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
38 Annex A
Input
The concatenation of:
The rightmost 7 bytes of the PAN (format n; if it is short, left-pad with 0-nibbles to obtain 7 bytes).
For PAN
13 33 90 00 00 61 65
Output
MKSMI = DES3(IMKSMI)[Input] || DES3(IMK SMI)[Input ‘FF FF FF FF FF FF FF FF’]
Although this does not affect the computations, the result is submitted to the DES parity forcing rule (each
byte has an odd number of 1-bits, achieved by appropriately setting the least significant bit of each byte).
Some implementations will refuse to use a DES key that does not conform to this parity forcing.
04 40 7F 0E 7F CD 4A 02 FD 7F 3B 75 EF 97 3E 52
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 39
Input
The input is the last AC, in this case the ARQC:
14 1D 34 65 C6 85 7C 46
Output
The concatenation of:
The Triple-DES Encryption of X = “the input with the third byte replaced by ‘F0’ ”
The Triple-DES Encryption of Y = “the input with the third byte replaced by ‘0F’ ”
This amounts to:
SKSMI = DES3(MKSMI)[X] || DES3(MKSMI)[Y]:
04 D0 C2 A0 12 07 D8 62 40 3C BA C9 7D 74 C0 2B
Note The result can be submitted to parity forcing, like the Card Master Keys. This
is not shown here as this is entirely internal to the ICC, and the computation is
not affected.
Input
For Secure Messaging Integrity (MAC computation), the input consists of the concatenation of:
For the first script command in a session, the last Application Cryptogram; for each subsequent script
command in the same session the latest full 8-byte MAC of the preceding script command. In this case,
it is the ARQC:
14 1D 34 65 C6 85 7C 46
The command header (CLA INS P1 P2), with padding. For PIN Change, this is:
8C 24 00 02 80 00 00 00
The script data. In this case, the encrypted PIN block (EncData) as computed above embedded in a TLV-
encoded data object:
87 11 01 DB 8D 1E 79 82 52 56 06 32 70 3D A7 2F
B1 9B EA
Note that the 5 padding bytes ’80 00 00 00 00’ for the above data object are added as the first step of the MAC
computation.
The concatenation:
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
40 Annex A
14 1D 34 65 C6 85 7C 46 8C 24 00 02 80 00 00 00
87 11 01 DB 8D 1E 79 82 52 56 06 32 70 3D A7 2F
B1 9B EA
Output
ScriptMAC = MAC4(SKSMI)[Input], where MAC4 denotes the first 4 bytes of the MAC:
21 9E 22 CD
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 41
Exponent:
03
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
42 Annex A
Signature Verification
The signature is verified. The first input for this recovery function consists of the Signed Static Application
Data (SSAD, tag ‘93’):
2C 67 B5 70 4E FE 94 FF 95 F3 28 28 A5 5E 1C EC
7C E8 71 FF D1 82 F0 6A 9B 50 86 30 75 EA 7F 01
9D C2 52 5D 60 B6 FD B5 9D 4B 20 76 51 B0 C9 07
F5 B9 7E 65 B0 40 AB CD 92 46 06 CF 27 44 43 C3
6B D2 EF CE 8B 5C E0 2D 0C B9 9D D9 EC 4F F6 9B
45 FD DE 6A 4E 0E DC 3A 5D 08 DD 21 EC BC 08 72
E8 4E C0 DA F2 1C 2A B8 00 14 7F 60 F0 6E B5 09
86 27 A7 F9 E1 B9 60 CA AA 3D DD 61 25 A3 CC 62
F8 F6 1F 8A F4 2D 41 99 3D 0D BC 70 2E 98 CE 81
74 0F 6F 1C BA 33 69 FB ED 1C 9A 9C 82 0A 3F BD
25 C6 58 31 E8 A5 9B C0 B5 D0 E8 11 2D 9E 6C CF
The following steps are performed:
1. The signature as well as the Issuer Public Key Modulus consists of 176 bytes (1,408 bits).
2. The exponent is 3, so the Recover() function is:
X = (SSAD)3 mod (Issuer Public Key Modulus):
6A|03|01|00 00|BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB|47 26 7B 16 3C
87 53 5B 60 6C F7 76 A2 28 67 9A 66 73 F9 0B|BC
(Separators ‘|’ are inserted to ease parsing; the separators correspond to the data elements.)
3. The Recovered Data Header is the first byte:
6A
which is correct.
4. The Certificate Format is 03:
03
5. The recovered part of the message (second through fifth data elements; that is all except header byte,
hash result, and trailer byte) is:
03 01 00 00 BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 43
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB
Concatenate to this the Static Data to be authenticated as identified by the AFL, which consists of:
Application Effective Date:
5F 25 03 06 01 01
Application Expiration Date:
5F 24 03 10 12 31
Application Usage Control:
9F 07 02 FF 00
Application PAN
5A 08 54 13 33 90 00 00 61 65
The PAN Sequence Number (0):
5F 34 01 00
Issuer Action Code Default:
9F 0D 05 F0 40 64 10 00
Issuer Action Code Denial:
9F 0E 05 00 10 88 00 00
Issuer Action Code Online:
9F 0F 05 F0 E0 64 98 00
CVM List:
8E 10 00 00 00 00 00 00 00 00 41 03 42 03 5E 03
1F 03
Issuer Country Code:
5F 28 02 09 78
SDA Tag List:
9F 4A 01 82
The value (without tag and length) of the data element indicated in the SDA Tag List (tag ‘9F4A’), which
is the Application Interchange Profile (tag ‘82’):
58 00
This yields:
03 01 00 00 BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB 5F 25 03 06 01 01
5F 24 03 10 12 31 9F 07 02 FF 00 5A 08 54 13 33
90 00 00 61 65 5F 34 01 00 9F 0D 05 F0 40 64 10
00 9F 0E 05 00 10 88 00 00 9F 0F 05 F0 E0 64 98
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
44 Annex A
00 8E 10 00 00 00 00 00 00 00 00 41 03 42 03 5E
03 1F 03 5F 28 02 09 78 9F 4A 01 82 58 00
6. The Hash Algorithm Indicator (the 2nd byte of the message, ‘01’) indicates SHA-1 as hash function.
Thus, apply SHA-1 to the complete message. The result is:
47 26 7B 16 3C 87 53 5B 60 6C F7 76 A2 28 67 9A
66 73 F9 0B
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 45
Private Exponent d:
0A D9 62 85 3F A6 9B 4B 6E D6 9D 8A 48 F5 C6 D5
31 F5 9C 82 63 1A 39 58 A2 D0 EE AB E4 A5 94 EB
BB 78 BB 97 CE 4D C4 8A 33 9E FD F6 AC 42 F8 33
82 75 F7 DB C9 EC E9 8D 90 66 F4 37 C6 87 A2 20
8F 53 99 3F 11 93 E5 6B E1 93 A7 99 0C 74 35 36
42 21 D2 DC F3 33 3D 05 C7 A4 65 30 4C 34 96 96
14 DD 4D C9 7B 2D 8B 70 63 7D A2 C3 DA CD 6F EE
FB 05 13 3B 7F E2 C3 54 FA 75 CF 1C 02 69 A4 73
E2 EB BC CE 4E 9F 4B 1A BF FC 57 75 E6 28 E4 C5
21 94 9C 1D 15 DC AB 95 FF C0 11 64 76 18 C4 6C
06 34 98 31 FD 11 60 8F A5 D8 DD DB 8F 56 0D B3
The same ICC Private Key, given in the commonly used “Chinese Remainder Theorem” format:
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
46 Annex A
The prime p:
C7 0E 73 F0 30 3C C8 83 21 C3 60 AA 7E 57 13 A7
81 B8 80 72 16 16 AA D4 09 A5 5E 7C D8 77 75 F9
52 2C F6 03 51 8B 29 C8 D1 72 6C 2D 1E 00 20 54
98 AA 6C 77 A5 F6 84 70 5D 72 79 BB B4 A5 08 21
8C ED 4F 3D A5 CF 6F 78 AA EE 1D 0E 79 79 00 73
67 CC 99 02 23 A2 C8 25
The exponent used modulo p (this is the private exponent d reduced modulo p–1):
84 B4 4D 4A CA D3 30 57 6B D7 95 C6 FE E4 B7 C5
01 25 AA F6 B9 64 71 E2 B1 18 E9 A8 90 4F A3 FB
8C 1D F9 57 8B B2 1B DB 36 4C 48 1E 14 00 15 8D
BB 1C 48 4F C3 F9 AD A0 3E 4C 51 27 CD C3 5A C1
08 9E 34 D3 C3 DF 9F A5 C7 49 68 B4 50 FB 55 A2
45 33 10 AC 17 C1 DA C3
The prime q:
D1 4A 8E B9 55 22 5D 1E 3A 2B 3C B4 49 41 FE 53
31 DA B7 A4 C0 47 EA 87 47 4E 8F 0D 4D 11 23 28
D6 BC 92 DF 59 CC 4E EE 1C 9A D4 79 4C DF 8B 5B
3A 31 06 D6 FA 2C B0 55 FC 15 36 5E 43 50 65 CC
18 DC 56 76 FE E6 16 43 6B EF 29 1D BE 90 74 CB
8D 0D 1A 66 21 D3 77 EF
The exponent used modulo q (this is the private exponent d reduced modulo q–1):
8B 87 09 D0 E3 6C 3E 14 26 C7 7D CD 86 2B FE E2
21 3C 7A 6D D5 85 47 04 DA 34 5F 5E 33 60 C2 1B
39 D3 0C 94 E6 88 34 9E BD BC 8D A6 33 3F B2 3C
D1 76 04 8F 51 73 20 39 52 B8 CE E9 82 35 99 32
BB 3D 8E F9 FF 44 0E D7 9D 4A 1B 69 29 B5 A3 32
5E 08 BC 44 16 8C FA 9F
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 47
The ICC Public Key retrieved from the ICC Public Key Certificate:
Modulus:
A2 BC C5 CE BA C3 19 6B 7E 93 3B 1A 46 66 A6 7D
ED 64 2B A3 CE 89 5C 31 8A 3D FC 12 65 B3 B9 CF
FC 12 FD E5 16 8E 84 19 06 50 E1 74 17 EC 8B 04
A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44 A1 F2 7F E8
65 E5 FA B2 07 AA 71 52 37 A6 D1 F7 BA CF 1E 2D
DF FB 5A F2 40 00 93 58 4A FA F0 7D FC 73 F8 6C
94 E6 2C 2C FF 44 3D 90 87 EF C1 90 A8 68 24 5C
06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86 CF 88 1B 81
39 DD 50 BD 06 35 12 41 12 A4 93 37 1C 88 9C 53
51 3C D5 CE 3F E3 7B B7 A2 0A AA 97 90 29 08 10
73 F2 31 1A 0C 0E 1D A9 AC 8E B3 45 AB 81 0D 8B
Exponent:
03
Note The ICC Public Key is used only for DDA verification.
Input
The Dynamic Application Data to be signed. It is the concatenation of:
Signed Data Format:
05
Hash Algorithm Indicator (SHA-1):
01
ICC Dynamic Data Length:
09
ICC Dynamic Data (the randomly generated ICC Dynamic Number IDN, preceded by its length on one
byte ‘08’):
08 56 D3 96 58 A2 EE D9 B1
Pad Pattern (176–34 = 142 bytes, as the ICC Public Key Modulus is 176 bytes long):
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB
Terminal Dynamic Data, which is the concatenation of the values of the data elements indicated in the
DDOL:
Unpredictable Number:
A0 B1 C2 D3
Therefore, the Dynamic Application Data to be Signed (i.e. input to the SHA-1 hash algorithm) equals:
05 01 09 08 56 D3 96 58 A2 EE D9 B1 BB BB BB BB
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
48 Annex A
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB A0 B1 C2 D3
the SHA-1 result of which is:
8E 8A 2B F6 0D E6 B9 A3 19 38 FA 8E F4 A4 11 B4
AB 1A 53 18
Signature Generation
First, concatenate:
The header byte:
6A
The leftmost 80–22 = 58 bytes of the message (the Dynamic Application Data to be Signed):
05 01 09 08 56 D3 96 58 A2 EE D9 B1 BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB
(we need 176–22 bytes, as the ICC Public Key Modulus is 176 bytes long).
The result of application of the Hash Algorithm (SHA-1) to the complete message:
8E 8A 2B F6 0D E6 B9 A3 19 38 FA 8E F4 A4 11 B4
AB 1A 53 18
E6 B9 A3 19 38 FA 8E F4 A4 11 B4 AB 1A 53 18 BC
Apply the RSA private transformation to this, i.e. raise it to the power ‘d’ modulo the ICC Public Key
Modulus. This can be done using the standard representation or CRT representation. This is outside the scope
of this document. The Signed Dynamic Application Data equals:
SDAD = (Input)d mod (ICC Public Key Modulus):
0E 3E 5F 59 62 F0 04 74 85 CE 92 B9 6F 52 C9 8B
39 A1 DC F7 28 AE E8 BA D4 6C E5 2E 91 03 FB A7
2D 63 01 50 5F 2D 66 0F E8 78 5B 68 72 02 92 B6
8C 92 0B 50 8C 8D A9 DA 0B E3 52 01 CD BB C9 FA
DF 65 7D E8 98 89 70 2C 87 44 8D 27 2F 66 2B D6
33 75 E1 5D 4A F1 89 99 0B 81 FB E3 8B 40 44 92
99 BB 1C 2E DD 8C E5 C3 EA 18 BC 03 E6 C8 66 41
71 96 1C 0E 75 47 CB 3B 55 3C 66 81 2A 54 4B AA
43 92 C6 AE 23 16 F2 69 1C 7F 6D D3 B6 8E BC A4
FC 77 AB F8 E7 2B CF 85 69 45 7B 83 4C 52 3D A3
EC 56 2E 7B DD 57 8E 21 88 7F D1 72 DB 7D 12 9B
This concludes the ICC computations for Dynamic Data Authentication. The following sections deal with the
terminal verification of the SDAD.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
50 Annex A
Exponent:
03
Signature Verification
The first input for this recovery function consists of the ICC Public Key Certificate (ICCCert, tag ‘9F46’):
7D D1 FF 5A 89 27 04 B0 69 25 20 77 17 E0 60 9D
C4 EE DC 9E D4 77 0C EC 8F CE D0 1D 0D AF 25 82
94 C3 42 62 40 DC E9 6B DA F0 85 6B 1B CE 44 42
FE 36 15 DB 0F 86 78 F9 4C 5F 4B 77 88 9D 2C C9
21 F6 F2 CB AD 0D 25 EB 32 3A D8 B1 46 DB F3 C9
EC 92 41 33 94 6D E7 EA 52 DF EF 79 21 87 E3 90
58 D4 D0 E2 8F EC 37 27 B2 04 C8 9D BB 70 4E D8
F5 E3 F7 E5 27 22 80 C9 6A 0E AA DB 51 5E 90 61
81 56 16 85 AB E9 6B 56 22 35 EA 83 29 72 38 74
12 8A 21 64 BD B2 5D B6 D8 34 8B 15 EE E8 98 7E
FC 0A F0 86 EB DD 00 2A A2 02 A0 C8 53 B4 AF 8A
The following steps are performed:
1. The signature as well as the Issuer Public Key Modulus consists of 176 bytes (1,408 bits).
2. The exponent is 3, so the Recover() function is:
X = (ICCCert)3 mod (Issuer Public Key Modulus):
6A|04|54 13 33 90 00 00 61 73 FF FF|12 10|00 00
01|01|01|B0|01|A2 BC C5 CE BA C3 19 6B 7E 93 3B
1A 46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC
12 65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1
74 17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F
44 A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1
F7 BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0
7D FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 51
90 A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB
86 CF 88 1B 81 39 DD 50 BD 06 35|07 31 88 9D 56
06 65 89 CD AD 1D A9 45 B3 5C CD BD 81 19 A7|BC
(Separators ‘|’ are inserted to ease parsing; the separators correspond to the data elements.)
3. The Recovered Data Header is the first byte:
6A
which is correct..
4. The Certificate Format is ‘04’:
04
5. The recovered part of the message (second through tenth data elements; that is all except header byte,
hash result and trailer byte) is:
04 54 13 33 90 00 00 61 73 FF FF 12 10 00 00 01
01 01 B0 01 A2 BC C5 CE BA C3 19 6B 7E 93 3B 1A
46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC 12
65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1 74
17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44
A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1 F7
BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0 7D
FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1 90
A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86
CF 88 1B 81 39 DD 50 BD 06 35
Concatenate to this:
The ICC Public Key Remainder:
12 41 12 A4 93 37 1C 88 9C 53 51 3C D5 CE 3F E3
7B B7 A2 0A AA 97 90 29 08 10 73 F2 31 1A 0C 0E
1D A9 AC 8E B3 45 AB 81 0D 8B
The Static Data to be Authenticated as identified by the AFL , which consists of:
Application Effective Date (TLV coded):
5F 25 03 06 01 01
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
52 Annex A
CVM List:
8E 12 00 00 00 00 00 00 00 00 44 03 41 03 42 03
5E 03 1F 03
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 53
Unpredictable Number:
9F 37 04
The value (without tag and length) of the data element indicated in the SDA Tag List (tag
‘9F4A’), which is the Application Interchange Profile (tag ‘82’):
79 00
This yields:
04 54 13 33 90 00 00 61 73 FF FF 12 10 00 00 01
01 01 50 01 A2 BC C5 CE BA C3 19 6B 7E 93 3B 1A
46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC 12
65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1 74
17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44
A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1 F7
BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0 7D
FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1 90
A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86
CF 88 1B 81 39 DD 50 BD 06 35 12 41 12 A4 93 37
1C 88 9C 53 51 3C D5 CE 3F E3 7B B7 A2 0A AA 97
90 29 08 10 73 F2 31 1A 0C 0E 1D A9 AC 8E B3 45
AB 81 0D 8B 03 5F 25 03 06 01 01 5F 24 03 10 12
31 9F 07 02 FF 00 5A 08 54 13 33 90 00 00 61 73
5F 34 01 00 9F 0D 05 F8 40 64 10 00 9F 0E 05 00
10 88 00 00 9F 0F 05 F8 E0 64 98 00 8E 12 00 00
00 00 00 00 00 00 44 03 41 03 42 03 5E 03 1F 03
5F 28 02 02 76 9F 4A 01 82 9F 02 06 9F 03 06 9F
1A 02 95 05 5F 2A 02 9A 03 9C 01 9F 37 04 9F 35
01 9F 45 02 9F 34 03 91 0A 8A 02 95 05 9F 37 04
79 00
6. The Hash Algorithm Indicator (obtained from X, ‘01’) indicates SHA-1 as hash function. Thus, apply
SHA-1 to the complete message. The result is:
07 31 88 9D 56 06 65 89 CD AD 1D A9 45 B3 5C CD
BD 81 19 A7
07 31 88 9D 56 06 65 89 CD AD 1D A9 45 B3 5C CD
BD 81 19 A7
Exponent:
03
Signature Verification
The first input for this recovery function consists of the Signed Dynamic Application Data SDAD as computed
above:
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 55
0E 3E 5F 59 62 F0 04 74 85 CE 92 B9 6F 52 C9 8B
39 A1 DC F7 28 AE E8 BA D4 6C E5 2E 91 03 FB A7
2D 63 01 50 5F 2D 66 0F E8 78 5B 68 72 02 92 B6
8C 92 0B 50 8C 8D A9 DA 0B E3 52 01 CD BB C9 FA
DF 65 7D E8 98 89 70 2C 87 44 8D 27 2F 66 2B D6
33 75 E1 5D 4A F1 89 99 0B 81 FB E3 8B 40 44 92
99 BB 1C 2E DD 8C E5 C3 EA 18 BC 03 E6 C8 66 41
71 96 1C 0E 75 47 CB 3B 55 3C 66 81 2A 54 4B AA
43 92 C6 AE 23 16 F2 69 1C 7F 6D D3 B6 8E BC A4
FC 77 AB F8 E7 2B CF 85 69 45 7B 83 4C 52 3D A3
EC 56 2E 7B DD 57 8E 21 88 7F D1 72 DB 7D 12 9B
(Separators ‘|’ are inserted to ease parsing; the separators correspond to the data elements.)
3. The Recovered Data Header is the first byte:
6A
which is correct.
4. The Signed Data Format is ‘05’:
05
5. The recovered part of the message (second through tenth data elements; that is all except header byte,
hash result and trailer byte) is:
05 01 09 08 56 D3 96 58 A2 EE D9 B1 BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
56 Annex A
Concatenate to this the Terminal Dynamic Data, which is the concatenation of the values of the data
elements indicated in the DDOL, in this case just the:
Unpredictable Number:
A0 B1 C2 D3
6. The Hash Algorithm Indicator (obtained from X, ‘01’) indicates SHA-1 as hash function. Thus,
apply SHA-1 to the complete message. The result is:
8E 8A 2B F6 0D E6 B9 A3 19 38 FA 8E F4 A4 11 B4
AB 1A 53 18
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 57
GENERATE AC Command
The content of the first GENERATE AC command is follows:
T L Data SW1-SW2
T L CID T L ATC T L SDAD T L IAD
77 81DF 9F27 01 40 9F36 02 0002 9F4B 50 .... 9F10 12 .... 9000
where the:
CID is a TC:
40
ATC is:
00 02
SDAD is:
79 ED 26 F1 30 58 3C C2 86 63 FD 68 AD 8D F8 D9
CE 36 78 C5 FB AF BE C4 F7 BF A6 63 58 84 B2 E3
6B 72 38 B3 51 D4 95 D2 ED BD D2 F3 EB 00 29 3B
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
58 Annex A
A1 56 86 B2 07 F5 BE 84 56 3F 48 79 2B 25 7B 4C
F9 94 48 92 8A C8 03 16 F7 5D 7A 78 21 46 28 2B
BF B7 20 2C 36 6D 2D ED 1E 48 6A B5 AF E7 D7 E8
43 E4 0E A8 5C 51 5D DB 61 16 34 41 17 10 20 5F
EC 02 E0 11 3F A4 13 98 DC 4E 09 EC 82 BD 38 A0
4A 7E 99 23 9C B1 76 94 6E A8 C6 9C C7 C2 1E 75
B6 E3 CC AA 2F 76 E2 E3 57 CE AF E0 3C CB 2F B0
04 CF EC 97 34 67 4D 6D 3A 22 F5 1F B4 9B 6E 4D
IAD is:
0F A5 01 9A 38 00 00 00 00 00 00 00 00 00 00 00
0F 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Counters:
00 00 00 00 00 00 00 00
Length:
0F
profile ID:
01
Issuer Discretionary:
00 00 00 00 00 00 00 00 00 00 00 00 00 00
SDAD Computation – TC, Encrypted Counters, and Transaction Data Hash Code
In order for the ICC to generate the SDAD, the TC and the Transaction Data Hash Code must first be
computed. The following data is needed:
The TC is computed as (see earlier example):
39 65 68 89 AB C1 AF FC
The Transaction Data Hash Code is computed by applying the SHA1 hash algorithm to input data
consisting of all the values identified in CDOL1 and the TLV data contained in the response to the
GENERATE AC Command (with the exception of the SDAD). Thus the input is equal to:
00 00 00 00 02 99 00 00 00 00 00 00 00 56 00 00
00 00 00 09 78 06 04 01 00 11 22 33 44 22 00 00
00 00 00 00 00 00 00 00 01 00 02|9F 27 01 40|9F
36 02 00 02|9F 10 20 0F A5 01 9A 38 00 00 00 00
00 00 00 00 00 00 00 0F 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 59
D2 A4 65 FE 33 2B 10 99 98 AD D8 96 BD BA D8 CB
7E C9 02 60
CID:
40
TC:
39 65 68 89 AB C1 AF FC
Pad Pattern (176–63 = 113 bytes, as the example ICC Public Key Modulus is 176 bytes long):
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB
Terminal Dynamic Data, which is the concatenation of the values of the data elements indicated in the
DDOL:
Unpredictable Number:
11 22 33 44
Thus the Dynamic Data to be signed (i.e. input to hash algorithm) is equal to:
05 01 26|08 E7 3A C4 64 CA 63 9D 58|40|39 65 68
89 AB C1 AF FC|D2 A4 65 FE 33 2B 10 99 98 AD D8
96 BD BA D8 CB 7E C9 02 60|BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
60 Annex A
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB|11 22 33 44
and the SDAD_Hash is equal to SHA1[input] =
22 34 7B 69 A1 A0 81 7D 91 39 16 9F 9B 98 46 37
4F B3 40 23
The leftmost 176–22 = 154 bytes of the message (the Dynamic Application Data to be Signed):
05 01 26 08 E7 3A C4 64 CA 63 9D 58 40 39 65 68
89 AB C1 AF FC D2 A4 65 FE 33 2B 10 99 98 AD D8
96 BD BA D8 CB 7E C9 02 60 BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
BB BB BB BB BB BB BB BB BB BB
(we need 176–22 bytes, as the ICC Public Key Modulus is 176 bytes long).
The result of application of the Hash Algorithm (SHA-1) to the complete message:
22 34 7B 69 A1 A0 81 7D 91 39 16 9F 9B 98 46 37
4F B3 40 23
of this manual. Using the ICC Private Key d and ICC Public Key Modulus defined in the previous section, the
Signed Dynamic Application Data equals:
SDAD = (Input)d mod (ICC Public Key Modulus):
86 43 98 92 29 81 89 2B 5A 34 51 EC 2E CF 41 5F
3E 83 09 C9 5F C0 D6 64 1B 88 18 F2 C2 7E 03 11
EF EF 54 89 E8 AB E7 12 79 B9 E1 78 C9 25 3C 76
29 00 6F 99 C0 E8 3B 0E B7 DE DD 24 7A 1A 4A 99
28 1D 5A D9 A3 34 7F A5 88 80 B2 80 9E 55 B4 35
13 EB 46 96 8C 5D 8C 2D CB DF C4 8D FA 6F F6 8E
6E CB BF 24 40 35 2C B0 C1 2A 33 D2 FA 90 69 90
8D 97 4D 36 74 30 6D F8 05 64 F9 E2 4B 9A EF B9
3A 52 EA 62 4B 40 98 B4 44 71 35 E0 9A E6 57 6A
C1 33 20 3F 0F 35 9F CC BF E3 FC 61 20 DC E4 F8
E5 74 68 72 E7 58 8B B8 2A CC 08 29 6F 55 B9 5F
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
62 Annex A
Exponent:
03
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 63
Signature Verification
The first input for this recovery function consists of the ICC PIN Encipherment Public Key Certificate
(PECert, tag ‘9F2D’):
29 31 40 8D 10 41 AB 5B AA 2F D3 56 86 C3 6B E4
B0 40 C9 01 07 E5 AA 25 4D 74 4B 2B FF 40 FF F9
08 0D 07 B6 45 03 A3 45 B9 7A 72 11 50 8D 91 E0
D4 DB 9A 4D EB 71 F7 98 85 12 FD 2B 3A A4 F4 42
41 61 55 4A F1 51 2C 81 F0 B1 80 06 4F D0 8C E8
9E 08 90 78 E3 F0 89 61 1A CE 5D 9B B1 A0 3E 88
77 30 E0 39 46 75 E6 5A 0E 09 00 96 74 6C 87 CB
70 6A DA 9A F7 1A 8C 2D 0E 03 8F 20 30 F5 13 CE
6D 13 78 AB 50 66 A7 5C 6E 61 0A 2A 25 A5 08 5D
88 00 E1 52 F8 09 1D 23 2E 8D 84 34 AD B2 41 8E
C4 8D EB 26 20 99 56 BC D2 B3 35 6E 9C E4 5D 10
The description below follows that for DDA but does not involve Static Data to be authenticated:
1. The certificate and the Issuer Public Key Modulus both consist of 176 bytes (1,408 bits).
2. The exponent is 3 so that the Recover() function gives:
X = (PECert)3 mod (Issuer Public Key Modulus):
6A|04|54 13 33 90 00 00 61 73 FF FF|12 10|00 00
02|01|01|B0|01|A2 BC C5 CE BA C3 19 6B 7E 93 3B
1A 46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC
12 65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1
74 17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F
44 A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1
F7 BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0
7D FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1
90 A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB
86 CF 88 1B 81 39 DD 50 BD 06 35|4C 54 2E 7C 9B
9C 53 9E 6A BC 72 98 44 14 CB E9 9E EC D4 C6|BC
(Separators ‘|’ are inserted to ease parsing.)
3. The Recovered Data Header is the first byte:
6A
which is correct.
4. The Certificate Format is ‘04’:
04
5. The recovered part of the message (second through tenth data elements; that is all except header
byte, hash result and trailer byte) is:
04 54 13 33 90 00 00 61 73 FF FF 12 10 00 00 02
01 01 B0 01 A2 BC C5 CE BA C3 19 6B 7E 93 3B 1A
46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC 12
65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1 74
17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44
A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1 F7
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
64 Annex A
BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0 7D
FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1 90
A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86
CF 88 1B 81 39 DD 50 BD 06 35
Concatenate to this:
The ICC PIN Encipherment Public Key Remainder:
12 41 12 A4 93 37 1C 88 9C 53 51 3C D5 CE 3F E3
7B B7 A2 0A AA 97 90 29 08 10 73 F2 31 1A 0C 0E
1D A9 AC 8E B3 45 AB 81 0D 8B
This yields:
04 54 13 33 90 00 00 61 73 FF FF 12 10 00 00 02
01 01 B0 01 A2 BC C5 CE BA C3 19 6B 7E 93 3B 1A
46 66 A6 7D ED 64 2B A3 CE 89 5C 31 8A 3D FC 12
65 B3 B9 CF FC 12 FD E5 16 8E 84 19 06 50 E1 74
17 EC 8B 04 A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44
A1 F2 7F E8 65 E5 FA B2 07 AA 71 52 37 A6 D1 F7
BA CF 1E 2D DF FB 5A F2 40 00 93 58 4A FA F0 7D
FC 73 F8 6C 94 E6 2C 2C FF 44 3D 90 87 EF C1 90
A8 68 24 5C 06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86
CF 88 1B 81 39 DD 50 BD 06 35 12 41 12 A4 93 37
1C 88 9C 53 51 3C D5 CE 3F E3 7B B7 A2 0A AA 97
90 29 08 10 73 F2 31 1A 0C 0E 1D A9 AC 8E B3 45
AB 81 0D 8B 03
6. The Hash Algorithm Indicator (obtained from X, ‘01’) indicates SHA-1 as hash function. Thus,
apply SHA-1 to the complete message. The result is:
4C 54 2E 7C 9B 9C 53 9E 6A BC 72 98 44 14 CB E9
9E EC D4 C6
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 65
FC 12 FD E5 16 8E 84 19 06 50 E1 74 17 EC 8B 04
A4 E9 85 E0 D4 E1 AF 4B 76 08 4F 44 A1 F2 7F E8
65 E5 FA B2 07 AA 71 52 37 A6 D1 F7 BA CF 1E 2D
DF FB 5A F2 40 00 93 58 4A FA F0 7D FC 73 F8 6C
94 E6 2C 2C FF 44 3D 90 87 EF C1 90 A8 68 24 5C
06 40 0E 06 A3 D2 0B 1C D5 D0 AB 86 CF 88 1B 81
39 DD 50 BD 06 35 12 41 12 A4 93 37 1C 88 9C 53
51 3C D5 CE 3F E3 7B B7 A2 0A AA 97 90 29 08 10
73 F2 31 1A 0C 0E 1D A9 AC 8E B3 45 AB 81 0D 8B
Exponent:
03
PIN Encryption
The input to PIN Encryption consists of:
A Data Header:
7F
The ICC Unpredictable Number (obtained via a GET CHALLENGE command) is required:
1A 2B 3C 4D 5E 6F 70 81
A terminal generated random pad pattern of length 176–17 = 159 bytes, as the ICC PIN Encipherment
Public Key Modulus is 176 bytes long:
FC 02 7D 70 F1 28 4A 48 41 08 48 28 80 20 B8 25
F5 3D F1 54 B7 32 9C B0 24 3A 6E 5A D2 16 F2 E1
02 B5 1D 41 2F 2D 44 43 6C 18 04 7B BC AD CF C1
96 D9 A8 BC AC 80 9F 1E BF 5C 3F 1A 1D DC E4 6D
37 07 F8 4D F6 76 BE A4 0A FD CE 50 E9 9A 6B 03
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
66 Annex A
F7 7B 32 28 48 3B 25 1A A0 61 54 A6 2A A1 77 03
6B 27 80 AC 95 BC 05 B2 D8 7B A9 81 07 76 93 A9
30 9B D0 06 47 44 8A 77 94 F2 E5 96 39 D6 6C 06
0E B2 3C F8 96 41 F9 40 43 24 87 CD EA 18 B7 10
34 75 75 C4 28 00 8B 52 BF 9F 61 FF C9 F2 49
The concatenation X of these:
7F 25 12 34 5F FF FF FF FF 1A 2B 3C 4D 5E 6F 70
81 FC 02 7D 70 F1 28 4A 48 41 08 48 28 80 20 B8
25 F5 3D F1 54 B7 32 9C B0 24 3A 6E 5A D2 16 F2
E1 02 B5 1D 41 2F 2D 44 43 6C 18 04 7B BC AD CF
C1 96 D9 A8 BC AC 80 9F 1E BF 5C 3F 1A 1D DC E4
6D 37 07 F8 4D F6 76 BE A4 0A FD CE 50 E9 9A 6B
03 F7 7B 32 28 48 3B 25 1A A0 61 54 A6 2A A1 77
03 6B 27 80 AC 95 BC 05 B2 D8 7B A9 81 07 76 93
A9 30 9B D0 06 47 44 8A 77 94 F2 E5 96 39 D6 6C
06 0E B2 3C F8 96 41 F9 40 43 24 87 CD EA 18 B7
10 34 75 75 C4 28 00 8B 52 BF 9F 61 FF C9 F2 49
is input to the RSA Recover() function:
EncPINData = X3 mod (ICC PIN Encipherment Public Key Modulus):
39 97 F6 15 E6 05 20 41 D4 C7 00 96 3B 78 A4 B3
B2 68 53 29 7F A9 D4 93 81 38 86 A9 42 76 12 2C
13 41 DB 19 95 76 32 C7 AA 0A B2 8B D5 BF 89 F7
C9 80 65 BD 7C E0 30 7A 64 1F 7D D5 13 FC 52 ED
1D FB 9D 82 0A B4 F4 F2 43 B9 D5 AF 26 24 61 16
1D 8A 1B 79 CA B8 AC 99 1A F9 09 D8 28 DA 6A CC
A2 40 C3 2A 38 B0 E6 35 83 35 1F 5C A5 0F 39 27
BE 6A ED 9E A0 D5 3F 2C 4A F2 D9 A6 38 B8 DD 28
AF A8 02 7F BD 36 63 26 56 87 81 6A DD 82 C7 81
EF 81 CF B1 2B 30 35 7D FD 31 E5 A0 6C A3 7C FA
29 E2 75 74 AB E2 DC ED 46 9B 87 F0 53 3F 8B B8
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
Annex A 67
73 F2 31 1A 0C 0E 1D A9 AC 8E B3 45 AB 81 0D 8B
Private Exponent d:
0A D9 62 85 3F A6 9B 4B 6E D6 9D 8A 48 F5 C6 D5
31 F5 9C 82 63 1A 39 58 A2 D0 EE AB E4 A5 94 EB
BB 78 BB 97 CE 4D C4 8A 33 9E FD F6 AC 42 F8 33
82 75 F7 DB C9 EC E9 8D 90 66 F4 37 C6 87 A2 20
8F 53 99 3F 11 93 E5 6B E1 93 A7 99 0C 74 35 36
42 21 D2 DC F3 33 3D 05 C7 A4 65 30 4C 34 96 96
14 DD 4D C9 7B 2D 8B 70 63 7D A2 C3 DA CD 6F EE
FB 05 13 3B 7F E2 C3 54 FA 75 CF 1C 02 69 A4 73
E2 EB BC CE 4E 9F 4B 1A BF FC 57 75 E6 28 E4 C5
21 94 9C 1D 15 DC AB 95 FF C0 11 64 76 18 C4 6C
06 34 98 31 FD 11 60 8F A5 D8 DD DB 8F 56 0D B3
PIN Decryption
The Encipher PIN Data, as computed above:
39 97 F6 15 E6 05 20 41 D4 C7 00 96 3B 78 A4 B3
B2 68 53 29 7F A9 D4 93 81 38 86 A9 42 76 12 2C
13 41 DB 19 95 76 32 C7 AA 0A B2 8B D5 BF 89 F7
C9 80 65 BD 7C E0 30 7A 64 1F 7D D5 13 FC 52 ED
1D FB 9D 82 0A B4 F4 F2 43 B9 D5 AF 26 24 61 16
1D 8A 1B 79 CA B8 AC 99 1A F9 09 D8 28 DA 6A CC
A2 40 C3 2A 38 B0 E6 35 83 35 1F 5C A5 0F 39 27
BE 6A ED 9E A0 D5 3F 2C 4A F2 D9 A6 38 B8 DD 28
AF A8 02 7F BD 36 63 26 56 87 81 6A DD 82 C7 81
EF 81 CF B1 2B 30 35 7D FD 31 E5 A0 6C A3 7C FA
29 E2 75 74 AB E2 DC ED 46 9B 87 F0 53 3F 8B B8
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.
68 Annex A
7F
The ICC Unpredictable Number is the second field (checked before the header):
1A 2B 3C 4D 5E 6F 70 81
and is indeed equal to the value provided in answer to the GET CHALLENGE above.
The PIN is retrieved from the PIN block, which is the third field:
25 12 34 5F FF FF FF FF
This PIN is then compared by the ICC to the Reference PIN value, stored in the ICC.
© 1994-2018 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of the 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.