The processing performed by the terminal in this stage determines whether both the terminal and the card support the off-line data authentication stage. In the
In case off-line SDA is performed, the terminal assesses the authenticity of the data personalized in the card by the issuer.
When off-line DDA is performed, the terminal can determine whether the card is
When the off-line DDA is combined with the Application Cryptogram generation, the signature produced by the card can include transaction data, which should be already available in the terminal at this stage. This signature, which can be locally
A terminal that is "on-line only", which has the Terminal Type (tag 9F35) with values of 11h, 21h, 14h, 24h, and 34h (according to Annex A.1 in Book 4 [3]), will skip the off-line data authentication stage. In this case, the EMV
¢
transaction is always directed on-line to the issuer, which
A terminal that can process an EMV
¢
transaction off-line will determine whether off-line data authentication is to be performed and what kind of data authentication mechanism will be applied. To this end the terminal will analyze the third byte (security capability) of the Terminal Capabilities (tag 9F33) data object in the terminal and the first byte of the AIP obtained from the card (tag 82). Since only these 2 bytes are
Note that the terminal can perform the processing described in the algorithm presented below immediately after the execution of the GET PROCESSING OPTIONS , when the AIP is available.
Choice 1 If the card does not support the off-line data authentication stage (i.e., bit 7, bit 6, and bit 2 are set to 0 in the AIP), the terminal skips the off-line data authentication stage. In this case, bit 8 in byte 1 of the TVR, "Off-line data authentication was not performed", is set to 1. This bit is also set by any terminal that is "on-line only".
Choice 2
The terminal shall perform the combined dynamic data authentication/Application Cryptogram generation if the following conditions are
The card supports the combined dynamic data authentication/Application Cryptogram generation (AIP, bit 2 = 1);
The terminal supports the combined dynamic data authentication/Application Cryptogram generation (Terminal Capabilities, bit 5 = 1)
In case the combined dynamic data authentication/Application Cryptogram generation is
Choice 3 The terminal shall perform the off-line DDA if the following conditions are simultaneously fulfilled:
The card supports off-line DDA (AIP, bit 6 = 1);
The terminal supports the off-line DDA (Terminal Capabilities, bit 7 = 1);
Either the card or the terminal (or both) does not support the combined dynamic data authentication/Application Cryptogram generation (i.e., AIP, bit 2 = 0; and/or Terminal Capabilities, bit 5 = 0).
In this case the terminal shall perform the off-line DDA processing as explained in Section 6.4.3.
Choice 4 The terminal shall perform the off-line SDA if the following conditions are simultaneously fulfilled:
The card supports off-line SDA (AIP, bit 7 = 1);
The terminal supports off-line SDA (Terminal Capabilities, bit 8 = 1);
Either the card or the terminal (or both) does not support off-line DDA (AIP, bit 6 = 0; and/or Terminal Capabilities, bit 7 = 0);
Either the card or the terminal (or both) does not support combined dynamic data authentication/Application Cryptogram generation (AIP, bit 2 = 0; and/or Terminal Capabilities, bit 5 = 0).
In this case the terminal shall perform the off-line SDA processing as explained in Section 6.4.2.
The off-line SDA requires two separate stages (as shown in Figure 6.5):
During the personalization stage of the card, the issuer computes the Signed Static Application Data certificate, according to the algorithm described in Section 5.8.3. Note that using the terminology adopted in Appendix D, Section D.6.2, the Signed Static Application Data certificate corresponds to the static authenticator
Static_Auth
. This certificate is a signature created with the issuer private key (
N
I
, d
I
)on the static data to be authenticated (referred to as the
financial_data
in Appendix D, Section D.6.2) in the card, which is
During the utilization stage, when the off-line SDA is required by the EMV
¢
transaction profile, the card submits to the terminal the data objects it needs to first verify the authenticity of the issuer public key. If the authenticity of this key verifies correctly, the terminal can use it to check the authenticity of the signed static application data. If the verification
Figure 6.5:
Overview of the off-line SDA.
The processing needed to verify the authenticity of the data in the card is carried out completely by the terminal, while the card only stores those data objects needed for completing this verification.
Stage 1 The terminal verifies the existence of the following objects in the EMV ¢ data objects heap:
Certification Authority Public Key Index (tag 8F);
Issuer Public Key Certificate (tag 90);
Issuer Public Key Remainder (tag 92), which is present only in certain conditions (see Section 5.4);
Issuer Public Key Exponent (tag 9F32);
Signed Static Application Data (tag 93).
If any of the objects mentioned above are not present in the card (except for tag 92), set up bit 6, "ICC data missing", of byte 1 of the TVR and consider that SDA has failed.
Stage 2
The terminal constructs the Static Data to Be Authenticated byte string. Note that for a multithread terminal this processing can be started since the read application data is performed, in parallel with the AFL processing, as described in Section 5.8.2. To this end, the terminal first considers the records indicated for authentication of all the AEF(s) registered in the AFL. Second, after all the records are read from the card and the EMV
¢
data objects heap is
If the terminal fails to process any of the records considered for authentication in the AFL, static data authentication has failed.
Stage 3 The terminal verifies the authenticity of the Issuer Public Key Certificate and recovers the issuer public key ( n I , e I ), following the algorithm presented in Section 5.7.1.
The terminal uses the Certification Authority Public Key Index (tag 8F) together with the RID to retrieve the CA public key (
n
CA
, e
CA
) from the appropriate record of the terminal database of CA public keys (see Table 5.2 in Section 5.5). The RID is obtained from the AID (DF
If the verification of the Issuer Public Key Certificate does not pass, then the SDA has failed.
If the terminal
Stage 4
The terminal verifies the authenticity of the data objects personalized in the card by checking the authenticity of the Signed Static Application Data certificate received from the card with the
If the verification of the Signed Static Application Data certificate fails, the SDA has failed.
Otherwise, the SDA processing is considered successful. The terminal stores the data authentication code, representing field 3 in the recovered part M R of the static application data to be signed by the issuer (see Section 5.8.3), in the value field of a data object with tag 9F45 and length equal to 2 bytes.
If the terminal decides that SDA has failed in any of the four stages described above, the rest of the processing involved in the SDA stage from that point on is
The terminal will set bit 8, "Off-line data authentication was performed", in byte 1 of the TSI register.
The terminal will also set bit 7, "Off-line static data authentication failed", in byte 1 of the TVR register.
The off-line DDA
This section will first outline the DDA mechanism implemented with digital signatures. Second, the processing performed by the terminal to verify the authenticity of the ICC public key based on traversing the EMV ¢ certification chain consisting of the Issuer Public Key Certificate and the ICC Public Key Certificate is described. Next, the processing performed by the card for computing the digital signature on the data objects sent by the terminal is presented. Finally, how the terminal assesses the correctness of the digital signature generated by the card is explained.
During the personalization stage the issuer loads the Issuer Public Key Certificate in the card. The issuer also generates the pair ICC private key/ICC public key and produces the ICC Public Key Certificate with the issuer private key (Section 5.6). The issuer loads in the card both the ICC private key (using a confidential channel) and the ICC Public Key Certificate.
Note that the card could generate the pair ICC private key/ICC public key by itself and forward only the ICC public key for certification to the issuer's personalization terminal (using an authentic channel). In this case, the issuer will compute only the ICC Public Key Certificate for downloading it in the card. The generation of the RSA key pairs by the chip card itself would better enforce the nonrepudiation security service during an EMV ¢ transaction, with no supplementary costs related to the chip card.
During the utilization stage the card
Figure 6.6:
Overview of the off-line DDA.
First, the terminal verifies the authenticity of the data personalized in the card and of the ICC public key traversing the EMV
¢
certification chain
Stage 1 The terminal verifies the existence of the following objects in the EMV ¢ data objects heap:
All the data objects needed by the terminal for performing the off-line SDA (stage 1 in Section 6.4.2), except for the Signed Static Application Data (tag 93);
ICC Public Key Certificate (tag 9F46);
ICC Public Key Remainder (tag 9F48), which is present only in certain conditions (Section 5.4);
ICC Public Key Exponent (tag 9F47).
If any of the objects mentioned above are not present in the card (except for tag 9F48 and tag 9F49), set up bit 6, "ICC data missing", in byte 1 of the TVR and consider that DDA has failed.
Note that if the terminal does not identify the DDOL (tag gF49) in the EMV ¢ data objects heap, the terminal should use a default DDOL personalized in the EMV ¢ terminal application by the acquirer. If the default DDOL is also missing, the DDA has failed.
Stage 2 The terminal constructs the static data to be authenticated byte string as it was described in Section 5.8.2. If the static authentication tag list contains any tags other than those accepted (note that there are some differences between the EMV'96 and the EMV 2000 specifications), DDA has failed.
Stage 3 The terminal verifies the authenticity of the Issuer Public Key Certificate (tag 90) and recovers the issuer public key ( n I , e I ) according to the algorithm described in Section 5.7.1.
Stage 4 The terminal verifies the authenticity of the ICC Public Key Certificate (tag 9F46) received from the card with the authentic copy of the issuer public key, ( n I , e I ), which was obtained in stage 3. N I denotes the length of the modulus n I .
If any of the verifications mentioned above failed, DDA has failed. The terminal stores the ICC public key ( n IC , e IC ) to subsequently verify the Signed Dynamic Application Data produced by the card. The terminal proceeds with the next stage.
Stage 5 The terminal initiates the computation of the Signed Dynamic Application Data in the card with an INTERNAL AUTHENTICATE command.
Step 1: The terminal generates a random number of 4 bytes, the value of which is assigned to the Unpredictable Number data object (tag 9F37). Its role is to guarantee the uniqueness of the digital signature computed by the card,
Step 2: The terminal creates the terminal dynamic data byte string, concatenating the value fields of all the data objects whose tag-length identifiers are listed in the DDOL. The DDOL should contain at least the tag-length identifier of the unpredictable number, but may also include the identifiers of other data objects from the terminal like the Terminal Identification (tag 9F1C), Terminal Country Code (tag 9F1A), and (tag 9A).
If the DDOL received from the card does not have the identifier of the Unpredictable Number among its identifiers, the DDA has failed.
If the card did not send the DDOL, the terminal must use the default DDOL. The terminal must check that the tag-length identifier of the Unpredictable Number is among the items listed in the default DDOL. If this is not the case, the DDA has failed.
Step 3: The terminal creates the C-APDU corresponding to the INTERNAL AUTHENTICATE command. This C-APDU is summarized in Table 6.3 (according to Table I-19 in Book 3 [1]).
|
Code |
Value |
|---|---|
|
CLA |
00 (interindustry command) |
|
INS |
88 |
|
P1 |
00 |
|
P2 |
00 |
|
Lc |
Variable (the length of the concatenated value fields of the data objects listed in the DDOL or default DDOL) |
|
Data |
Terminal dynamic data ”this is the byte string containing the concatenation of the value fields of the data objects indicated by the card in the DDOL |
|
Le |
00 |
The control parameter P1 encodes the reference of the algorithm for computing the signed dynamic application data, from the terminal's viewpoint. The actual value accepted for P1 is 00, which means that no information on the algorithm is given through P1. At present, the algorithm used by the card for generating the Signed Dynamic Application Data is the RSA algorithm. After formatting the C-APDU of the INTERNAL AUTHENTICATE command, the terminal sends it to the card.
Note that if the combined dynamic data authentication/Application Cryptogram generation is chosen for implementing the off-line data authentication service (choice 2 in Section 6.4.1), all the processing described above is performed except for step 3 in stage 5. In this case, the terminal does not send a separate INTERNAL AUTHENTICATE command to the card.
Before computing the signature, the card checks that the parameters P1 and P2 of the INTERNAL AUTHENTICATE command are equal to 00. It then checks that the issuer did not previously block the currently selected application through a post-script command. The card also checks that in the current session the execution of the GET PROCESSING OPTIONS command was successfully performed and no other INTERNAL AUTHENTICATE C-APDU was sent to the card. Otherwise the card returns SW1SW2 = 6985, "Command not allowed; conditions of use not satisfied" (see Table I-4 in Book 3 [1]).
Then the card computes the ICC Dynamic Number (tag 9F4C). This is a time-variant parameter generated by the card. When receiving this parameter in an authorization request sent on-line or even in a payment capture message during the clearing, the issuer can check the freshness of this parameter. Thus, the issuer verifies whether the terminal performed the DDA stage or not, when this is required by the EMV ¢ transaction profile. The parameter can be a sequence number incremented each time the INTERNAL AUTHENTICATE command is sent to the card, for which the issuer keeps a synchronous counter in the IH. The parameter can also be a symmetric cryptogram, which is unique for each card and for each transaction. This cryptogram can be a MAC computed by the card on the ATC, which is incremented at every transaction. This MAC is computed with a unique key diversified for each card from a unique master key of the issuer assigned for the purpose of computing the ICC Dynamic Number.
Note that the issuer could have required that the terminal send the entire Signed Dynamic Application Data to the IH for verification. But this could overload the authorization request message with N IC bytes, which can amount to 248 bytes instead of the 3 to 9 bytes needed by the ICC Dynamic Number. When non-repudiation is not a security feature required by the issuer, the use of the ICC Dynamic Number is more economical.
The ICC applies the digital signature scheme giving message recovery implemented with the RSA algorithm, as described in Appendix F, Section F.3.1 (case 2). This algorithm is applied on the message M = M R M ² with the RSA parameters n S = n IC and d S = d IC to obtain a signature S , which is referred to as the signed dynamic application data, stored in the card with the tag 9F4B.
The message M = M R M ² is referred to as the dynamic application data to be signed (see Table 11 in Book 2 [2]).
The part M ² consists of the terminal dynamic data byte string, as received in the INTERNAL AUTHENTICATE command from the terminal.
The part M R consists of five fields:
Field 1 ”signed data format (1 byte): it has the fix value 05h.
Field 2 ”hash algorithm indicator (1 byte): it identifies the hash algorithm used to produce the hash code H . This value is used in step 1 of the algorithm described in Appendix F, Section F.3.1 (case 2). At the moment, SHA-1 is the hash algorithm recommended by the EMV ¢ 2000 specifications in Annex B3.1 of Book 2 [2]. Thus, the value of the hash algorithm indicator is set to 01h.
Field 3 ”ICC dynamic data length (1 byte): It specifies the bytelength
L
DD
of the ICC dynamic data in field 4. This parameter has to
Field 4 ”ICC dynamic data ( L DD bytes): It consists of L DD bytes, of which the leftmost byte encodes the length of the ICC Dynamic Number (between 2 and 8 bytes), and the following 2 to 8 bytes represent the ICC Dynamic Number. The rest of the ICC dynamic data, until L DD bytes, can be used by each issuer in a proprietary manner.
Field 5 ”pad pattern: It contains a number of N IC ˆ’ L DD ˆ’ 25 bytes of value BBh.
After the successful completion of this computation, the card sets up an internal flag to mark that DDA was completed. The card can elaborate the R-APDU to be returned to the terminal in two formats:
Response Message Template Format 1: This is a primitive data object with tag 80 whose length is N IC . The value field of this data object contains only the value field of the signed dynamic authentication data.
Response Message Template Format 2: This is a constructed data object with tag 77, which may include several data objects encoded in a BER-TLV format, but which will always contain the signed dynamic authentication data. The other data objects, when they are included, are proprietary to each issuer.
The R-APDU includes at the rightmost position the status words SW1SW2 = 9000.
After receiving the signed dynamic authentication data in the R-APDU returned by the card to the INTERNAL AUTHENTICATE command, the terminal verifies its authenticity.
Step 1: Verify that the length of the Signed Dynamic Application Data is N IC .
Step 2: Apply the signature verification/recovery algorithm in Appendix F, Section F.3.2 (case 2), where S is the signed dynamic application data, n S = n IC , and e S = e IC . The length N of the modulus is N IC .
The data that is recovered X is parsed as X = B M R H E . The following processing is performed on these items:
Check that E (last byte of X ), which is the recovered data trailer, equals BCh.
Check that B (first byte of X ), which is the recovered data header, equals 6Ah.
Consider M R as the next N IC ˆ’ 22 bytes after B . Parse M R according to the five fields identified in Section 6.4.3.4.
Check that the signed data format read in field 1 of M R is 05h.
Set up the value of the message M ² to the value represented by the terminal dynamic data. This is the byte string containing the concatenation of the value fields of the data objects indicated by the card in the DDOL. This byte string was already computed for including it in the data field of the INTERNAL AUTHENTICATE C-APDU (Section 6.4.3.2, stage 5).
Create the message M , representing the dynamic application data to be signed (see Table 11 in Book 2 [2]), as the concatenation from left to right of the recovered part M R and of the computed part M ² (i.e., M = M R M ² ).
Read the hash algorithm indicator from field 2 of M R . Note that at the moment this value is 01h, corresponding to the SHA-1 algorithm, the only approved hash algorithm in the EMV 2000 specifications (see Annex B3.1 in Book 2 [2]).
Use the indicated hash algorithm to compute the hash code h of M .
Check that h equals the hash result H , which represents the last 20 bytes in X before E .
If any of the verifications mentioned above fail, DDA has failed.
If the terminal decides that DDA has failed in any of the stages and steps described above, the rest of the processing from that point on is skipped. The terminal sets bit 8, "Off-line data authentication was performed", in byte 1 of the TSI register. The terminal will also set bit 4, "Off-line dynamic data authentication failed", in byte 1 of the TVR register.
Otherwise, the DDA processing is considered successful. The terminal constructs the ICC Dynamic Number data object with tag 9F4C, the length field of which equals the first byte of field 4 (see Section 6.4.3.4). The