Source: http://docplayer.net/6483822-Etsi-ts-102-176-2-v1-2-1-2005-07.html
Timestamp: 2018-11-14 08:03:27
Document Index: 317215497

Matched Legal Cases: ['art 2', 'art 2', 'art 1', 'art 2', 'art 1', 'art 4', 'art 1', 'art 2', 'art 1']

Download "ETSI TS 102 176-2 V1.2.1 (2005-07)"
1 TS V1.2.1 ( ) Technical Specification Electronic Signatures and Infrastructures (ESI); Algorithms and Parameters for Secure Electronic Signatures; Part 2: Secure channel protocols and algorithms for signature creation devices
2 2 TS V1.2.1 ( ) Reference RTS/ESI Keywords e-commerce, electronic signature, security 650 Route des Lucioles F Sophia Antipolis Cedex - FRANCE Tel.: Fax: Siret N NAF 742 C Association à but non lucratif enregistrée à la Sous-Préfecture de Grasse (06) N 7803/88 Important notice Individual copies of the present document can be downloaded from: The present document may be made available in more than one electronic version or in print. In any case of existing or perceived difference in contents between such versions, the reference version is the Portable Document Format (PDF). In case of dispute, the reference shall be the printing on printers of the PDF version kept on a specific network drive within Secretariat. Users of the present document should be aware that the document may be subject to revision or change of status. Information on the current status of this and other documents is available at If you find errors in the present document, please send your comment to one of the following services: Copyright Notification No part may be reproduced except as authorized by written permission. The copyright and the foregoing restriction extend to reproduction in all media. European Telecommunications Standards Institute All rights reserved. DECT TM, PLUGTESTS TM and UMTS TM are Trade Marks of registered for the benefit of its Members. TIPHON TM and the TIPHON logo are Trade Marks currently being registered by for the benefit of its Members. 3GPP TM is a Trade Mark of registered for the benefit of its Members and of the 3GPP Organizational Partners.
3 3 TS V1.2.1 ( ) Contents Intellectual Property Rights...4 Foreword...4 Introduction Scope References Definitions and abbreviations Definitions Abbreviations Maintenance activities Secure messaging for smart cards General Channel keys establishment Authentication steps Session Key creation Computation of channel keys Computation of the send sequence counter SSC Secure Messaging Mode CLA byte TLV coding of command and response message Treatment of SM-Errors Padding for checksum calculation Message structure of Secure Messaging APDUs Cryptograms Cryptographic Checksums...13 Annex A (normative): Use of TDES and AES...15 Annex B (informative): Major changes from previous versions...17 History...18
4 4 TS V1.2.1 ( ) Intellectual Property Rights IPRs essential or potentially essential to the present document may have been declared to. The information pertaining to these essential IPRs, if any, is publicly available for members and non-members, and can be found in SR : "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to in respect of standards", which is available from the Secretariat. Latest updates are available on the Web server ( Pursuant to the IPR Policy, no investigation, including IPR searches, has been carried out by. No guarantee can be given as to the existence of other IPRs not referenced in SR (or the updates on the Web server) which are, or may be, or may become, essential to the present document. Foreword This Technical Specification (TS) has been produced by Technical Committee Electronic Signatures and Infrastructures (ESI). The present document is part 2 of a multi-part deliverable covering the Algorithms and Parameters for Secure Electronic Signatures, as identified below: Part 1: Part 2: "Hash functions and asymmetric algorithms"; "Secure channel protocols and algorithms for signature creation devices". Introduction The present document provides for security and interoperability for the application of the underlying mathematical algorithms and related parameters for electronic signatures in accordance with the Directive 1999/93/EC [1] of the European Parliament and of the Council of 13 December 1999 on a Community framework for electronic signatures. The first part of the present document defines a list of cryptographic algorithms together with the requirements on their parameters, as well as the recommended combinations of algorithms in the form of "signature suites" to be used with the data structures defined in the documents developed under the EESSI (European Electronic Signature Standardization Initiative). The present document contains several informative annexes which provide useful information on a number of subjects mentioned in the text. The present part of this technical standard (symmetric algorithms and protocols for secure channels) defines a list of symmetric algorithms and protocols to be used with protocols to construct a secure channel between an application and a signature creation device (SCDev) providing either only integrity or both integrity and confidentiality. Such a secure channel may be used during the operational phase of a signature creation device to remotely download a private key in the signature creation device, remotely extract a public key from the signature creation device when the key pair has been generated by the signature creation device or/and remotely download a public key certificate and associate it with a private key already stored in the signature creation device. With the kind permission of CEN Management Centre, some parts of the present document reproduce text from CEN Workshop Agreement (CWA) (CWA [7]), a publication which is CEN copyright. Whereas the CWA is restricted to the usage of Triple DES (TDES) only, the present document gives a more general approach for the application of different symmetric algorithms. It recommends the usage of AES, the successor of DES, approved by NIST.
5 5 TS V1.2.1 ( ) 1 Scope The present document defines a set of symmetric algorithms and protocols to be used to construct a secure channel between an application and a signature creation device providing either only integrity or both integrity and confidentiality. Such a secure channel is required during the operational phase of a signature creation device to remotely download a private key in the signature creation device, remotely extract a public key from the signature creation device when the key pair has been generated by the signature creation device or/and remotely download a public key certificate and associate it with a private key already stored in the signature creation device. The protocols and algorithms defined in the present document are consistent with the following document: CWA [7]: "Application Interface for Smart Cards used as Secure Signature Creation Devices - Part 1: Basic requirements". The secure channel is always restricted to the both partners of the communication and can be defined even in a proprietary way without loss of interoperability. The present document gives one possibility to set up the secure channel, other methods may be used as well and are not ruled out hereby. Patent related issues are out of the scope of the present document. 2 References The following documents contain provisions which, through reference in this text, constitute provisions of the present document. References are either specific (identified by date of publication and/or edition number or version number) or non-specific. For a specific reference, subsequent revisions do not apply. For a non-specific reference, the latest version applies. Referenced documents which are not found to be publicly available in the expected location might be found at [1] Directive 1999/93/EC of the European Parliament and of the Council of 13 December 1999 on a Community framework for electronic signatures. [2] ISO/IEC (2005): "Identification cards - Integrated circuit cards - Part 4: Organization, security and commands for interchange". [3] ISO/IEC (1999): "Information technology - Security techniques - Message Authentication Codes (MACs) - Part 1: Mechanisms using a block cipher". [4] ISO/IEC (1994): "Banking - Key management (retail) - Part 2: Key management techniques for symmetric ciphers". [5] "The order of encryption and authentication for protecting communications (or: How secure is SSL?)" by Hugo Krawczyk. In Advances in Cryptology - CRYPTO 2001, volume 2139 of Lecture Notes in Computer Science, pages , Springer-Verlag, [6] ANSI X9.63: "Public Key Cryptography for the Financial Services Industry: Key Agreement and Key Transport using Elliptic Curve Cryptography". [7] CWA : "Application Interface for smart cards used as Secure Signature Creation Devices - Part 1: Basic requirements". [8] FIPS Publication 46-3 (1999): "Data Encryption Standard (DES)", National Bureau of Standards. [9] FIPS Publication 197 (2001): "Advanced Encryption Standard (AES)", National Institute of Standards and Technology.
6 6 TS V1.2.1 ( ) 3 Definitions and abbreviations 3.1 Definitions For the purposes of the present document, the following terms and definitions apply: host application: application able to establish a secure channel with the SCDev interface device: device that is the physical interface by which the communication between the card and the host application is handled NOTE: The communication may be with a contact interface, a contactless interface or both. 3.2 Abbreviations For the purposes of the present document, the following abbreviations apply: AES APDU CLA CWA DES DO FCP HA IFD MAC SAGE SCDev SM TDES Advanced Encryption Standard Application Protocol Data Unit CLass byte of an APDU CEN Workshop Agreement Data Encryption Standard Data Object File Control Parameters Host Application InterFace Device Message Authentication Code Security Algorithms Group of Experts (from ) Signature-Creation Device Secure Messaging Triple DES 4 Maintenance activities As a response to relevant developments in the area of cryptography and technology, activities for the maintenance of the symmetric algorithms and protocols for secure channels shall enable dynamic updating of the lists of recommended algorithms and protocols. An initial list of recommended symmetric algorithms and protocols for secure channels is given in the present document. The present document describes the establishment of two symmetric channel keys using symmetric cryptography only, and does not consider an option for asymmetric cryptography. However, in the future, there can be evolutions towards asymmetric mechanisms for establishing secure channels keys between HA and SCDev. The maintenance activity is carried by ESI with the cooperation of the SAGE group. In order to allow an easy follow up of the present document, a history of the changes will be maintained. 5 Secure messaging for smart cards 5.1 General The secure channel, while being used, is based on symmetric channel keys. There are two channel keys: one for the computation of a Message Authentication Code (MAC) and another one to be used for confidentiality when needed. These channel keys may be preinstalled or dynamically negotiated.
7 7 TS V1.2.1 ( ) The former case is called "Static SM" where static symmetric channel keys are reserved for secure messaging. In that case the channel keys are always available in the card. A key agreement/derivation method is therefore not required. In the later case, symmetric channel keys must be established using symmetrical or asymmetric cryptography. The present document does not consider, for the moment, asymmetrical cryptography to establish the negotiated channel keys. However, in the future, there can be evolutions towards asymmetric mechanisms for establishing secure channel keys between HA and SCDev. When symmetrical cryptography is used to establish the channel keys, these keys are derived after the establishment of a single Session Key K SK. Once the channel keys are established, a trusted channel is then available to protect or conceal the information transmitted over the interface from either side. 5.2 Channel keys establishment According to ISO/IEC [2] a cryptographic mechanism for confidentiality consists of an algorithm in a mode of operation. In the absence of explicit indication and when no mechanism is implicitly selected for confidentiality, a default mechanism shall apply. When symmetrical cryptography is used, a single Session Key is established after a successful mutual authentication. The key used for confidentiality K ENC and MAC computation K MAC are derived from the Session Key. They shall be available on HA and SCDev side. The keys K ENC and K MAC used in authentication protocol are replaced as soon as a fresh session key is negotiated by HA and SCDev. For the HA, the TDES algorithm SHALL be supported while the AES algorithm SHOULD be supported. For the SCDev, either the TDES algorithm or the AES algorithm SHALL be supported. NOTE: The AES algorithm is an alternative for future use which currently may not be supported by SCDevs. The current protocol was designed to support a single algorithm (TDES) and does not allow to negotiate the algorithm: the host has to know in advance the single algorithm supported by the SCDev or it extracts this information from elsewhere, for example from the file control parameters (FCP file descriptor extension tag "85") of the file containing the key according to ISO/IEC [2]. The mode of operation SHALL be CBC i.e. cipher-block-chaining Authentication steps The authentication scheme follows the protocol described in CWA [7], section We use in the following the notation E[K ENC ](data) to describe the encryption of "data" using key K ENC. The notation MAC[K MAC ](data) describes the computation of a MAC over "data" using key K MAC.
8 8 TS V1.2.1 ( ) Step IFD Transmission SCDev READ BINARY of file EF.SN.SCDev Read data from specified file 1 or GET DATA respectively SN.SCDev as response GET CHALLENGE RND.SCDev 2 3 MUTUAL AUTHENTICATE Generate Key K HA S = RND.HA SN.HA RND.SCDev SN.SCDev K HA E[K ENC ](S) MAC[K MAC ]( E[K ENC ](S)) SCDev decrypts input and compares RND.SCDev with the previous response. Verify RND.SCDev, SN.SCDev Generate Key K SCDev Generate Session Key K SK (see 5.2.2) Generate SSC.SCDev 3 Verify RND.HA, SN.HA Generate Session Key K SK (see 5.2.2) Generate SSC.HA Both sides authenticated and session key seeds available. Return: R = RND.SCDev SN.SCDev RND.HA SN.HA K SCDev E[K ENC ](R) MAC[K MAC ](E[K ENC ](R)) K ENC is for example a TDES key being used in a DES in CBC mode (see annex A "Use of TDES"). The IV for the CBC-encryption is always set to all zero bytes, e.g. " " for TDES. K MAC is for example a TDES key being used according checksum calculation. The initial check block is set to all zero bytes. e.g. " " and the MAC consists of the first bytes (at least four) from the final output. The length required by CWA [7] is 8 bytes. No padding is required for the encryption on either side because the data block is constructed to be a multiple of the blocksize (i.e. 8 for TDES). NOTE: The encryption mechanism requires no padding, since CWA [7] always uses the padding indicator for cryptograms set to "01" see table 9.1 and clause This implies that "the padding consists of one mandatory byte set to "80" followed, if needed, by 0 to k-1 bytes set to"00" until the respective data block is filled up to k bytes (ISO/IEC [2], see table 30 and section )". Therefore complete blocks are encrypted whatever the blocksize is. RND.SCDev and K SCDev are random numbers which are generated by the SCDev where RND.HA and K HA are random numbers which are generated by the HA. The random numbers RND.SCDev and RND.HA are 8 bytes long. The random numbers K SCDev and K HA are 32 bytes long each and are used to generate the session key K SCDev. SN. HA and SN.SCDev are the 8 least significant bytes of the serial numbers of the HA and the SCDev, respectively. The structure of the serial numbers used here is out of scope of the present document, it is only important that SN.HA and SN.SCDev are derived from some fixed data available at HA and SCDev and that they occupy 8 bytes each Session Key creation The goal of the authentication procedure is the agreement of channel keys for building cryptograms and cryptographic checksums with the block cipher algorithm. In a first step, the 32-byte values K HA and K SCDev are xor-ed to build the Session Key K SK : K SK = K HA K SCDev Then the actual channel keys are built from K SK according to clause
9 9 TS V1.2.1 ( ) Computation of channel keys The key derivation protocol for the channel keys is described here using the TDES: K i (ENC): describes the TDES key being used to encrypt and decrypt data; K i (MAC): describes the TDES key being used to compute and verify a cryptographic checksum; i = a: describes the first 8 bytes of the TDES key; i = b: describes the second 8 bytes of the TDES key. Two 16-byte channel keys are required for secure messaging: one for MAC computation and one for confidentiality protection, if required. Key derivation from the common secret K SK is performed according to ANSI X9.63 [6]. Let c be a 32 bit counter. Both HA and SCDev compute: HASH 1 = h SM (K SK c) with c=1; and HASH 2 = h SM (K SK c) with c=2. where the hash function h SM is defined here as SHA-1. NOTE 1: The mixing properties of SHA-1 are not affected be the recently published attacks. Therefore it may be used here without breaches of security. In the future a different hash algorithm may be recommended. Bytes 1..8 of HASH 1 form the key K a (ENC), and bytes build the key K b (ENC). Bytes 1..8 of HASH 2 form the key K a (MAC), and bytes build the key K b (MAC). K HA/ICC K HA/ICC Figure 1: Building TDES-channel keys from hash output (here ICC=SCDev) The 16-byte channel key used for confidentiality protection is computed using HASH 1. The concatenation K a K b form the 16-byte channel key. The 16-byte channel key used for MAC computation is computed using HASH 2. The concatenation K a K b form the 16-byte channel key. NOTE 2: A TDES key is 16 bytes, among which one bit in each byte) is a parity bit. So there are only 112 bits really used by the TDES computation. Parity bits are not considered.
10 10 TS V1.2.1 ( ) For AES-128 channel keys the derivation proceeds in a similar way. The first 16 bytes of HASH 1 build the key for confidentiality and the first 32 bytes of HASH 2 HASH 3 build the MAC computation keys K a and K b, where HASH 3 is computed accordingly as h SM (K SK c) with c= Computation of the send sequence counter SSC After successful device authentication, the send sequence counter SSC, which is an 8-bit value, is generated as follows: The starting value for the SSC is: SSC = RND.SCDev (4 least significant bytes) RND.HA (4 least significant bytes) The RND.SCDev and RND.HA are taken from the values of the device authentication protocol described in clause NOTE: The send sequence counter SSC must be increased (+1) each time before a MAC is calculated i.e. if the starting value is x, in the next command the value of SSC is x+1. The SSC value of the first response will then be x Secure Messaging Mode The format of a plain text message is compliant with the definitions in ISO/IEC [2] when it is transmitted using secure messaging CLA byte The presence of Secure Messaging is indicated in b3 and b4 of the CLA byte of the command APDU. According to ISO/IEC [2] clause the bits b3 and b4 are set to 1 indicating that the command header is included in the message authentication TLV coding of command and response message If Secure Messaging is applied the command and response message shall be TLV coded according to ISO/IEC [2]. Tag Meaning "81" Plain value (to be protected by CC) "87" Padding-content indicator byte ("01" for ISO-Padding) followed by the cryptogram "8E" Cryptographic checksum (MAC) "97" Le (to be protected by CC) "99" Processing status (SW1-SW2, protected by MAC) For cryptograms the padding indicator PI is always set to "01", i.e. padding according to ISO/IEC [2] ( ). NOTE: The plain value SM DOs are always set to Tag "81", because the structure of the data in the data field is irrelevant for the SM view. The cryptographic checksum shall integrate any secure messaging data object having an odd tag number Treatment of SM-Errors When the SCDev recognizes an SM error while interpreting a command, then the status bytes must be returned without SM. In ISO/IEC [2] the following status bytes are defined to indicate SM errors: "6987": Expected SM data objects missing; "6988": SM data objects incorrect. NOTE: Further SM status bytes can occur in application specific contexts.
11 11 TS V1.2.1 ( ) When the SCDev returns status bytes without SM DOs or with an erroneous SM DO the SCDev deletes the session keys. As a consequence the secure session is aborted Padding for checksum calculation The padding mechanism according to ISO/IEC [2] ( ) is applied Message structure of Secure Messaging APDUs For secure messaging the TDES algorithm or the AES algorithm shall be used Cryptograms Cryptograms are built with the symmetric algorithm (TDES or AES) in CBC-Mode with the Null vector as Initial Check Block. A cryptogram (Tag = 87 x) is always followed by a cryptographic checksum with Tag = 8E x. Encryption must be done first on the data, followed by the computation of the cryptographic checksum on the encrypted data. This order is in accordance with ISO/IEC [2] and has security implications as described in [5]. The command header shall be included into the cryptographic checksum. The actual value of Lc will be modified to Lc after application of secure messaging. If required, an appropriate data object may optionally be included into the APDU data part in order to convey the original value of Lc. Figure 2 shows an example how an unprotected command APDU is protected using secure messaging with both integrity and confidentiality. If encryption is not required, the data object "87" is replaced with a plain text data object "81" that conveys the plain data (no padding) in its value field.
12 12 TS V1.2.1 ( ) Figure 2: Example for protecting an APDU command using TDES for secure messaging with both integrity and confidentiality
13 13 TS V1.2.1 ( ) Figure 3 shows an example how an unprotected response APDU is protected using secure messaging with both integrity and confidentiality. Figure 3: Example for protecting an APDU response using TDES for secure messaging with both integrity and confidentiality If encryption is not required, the data object "87" is replaced with a plain text data object "81" that conveys the plain data (no padding) in its value field. NOTE: Some existing applications transmit the DO "99" (secured SW12) only if no data is present in the response. If the DO "99" is not present in the response, the HA shall correctly process using the unprotected SW12 at the end of the response. An attacker, however, cannot remove DO "99" from the response because the verification of the CC (MAC) would fail Cryptographic Checksums The keys K a and K b are derived from the common freshly generated session key. The data part is split in data blocks with 8-bytes (for TDES) or 16-bytes (for AES) length each. As an example, figures 2 and 3 indicate the 8-byte subblocks with the notation X i.
14 14 TS V1.2.1 ( ) In the TDES case, cryptographic checksums are built according to ISO/IEC [2] (clause ) as follows (the basic mechanism is to build a MAC according ISO/IEC [3] with the block cipher DES, padding method 2, MAC algorithm 3, MAC length of at least four bytes): Initial stage: The initial check block Y 0 is E[K a ] (SSC). Sequential Stage: The check blocks Y 1,.., Y n are calculated using K a. Final Stage: The cryptographic checksum is calculated from the last check block Y n as follows: E [K a ] (D [K b ] (Y n )). Here E [K] ( ) means single encryption with DES and key K, respectively D [K] ( ) decryption with DES. Figure 6 in annex A illustrates this mechanism. In the case of AES, cryptographic checksums are built according to ISO/IEC [2] (clause ), using the EMAC construction of ISO/IEC [3] with the block cipher AES: Initial stage: The initial check block Y 0 is E [K a ] (SSC). Sequential Stage: The check blocks Y 1,.., Y n are calculated using K a. Final Stage: The cryptographic checksum is calculated from the last check block Y n as follows: E [K b ] (E [K a ] (Y n )). Here E [K] ( ) means (single) encryption with AES.
15 15 TS V1.2.1 ( ) Annex A (normative): Use of TDES and AES Figure A.1 shows the application of keys in TDES (see also ISO/IEC [4]). Figure A.1: TDES Encryption/Decryption For AES the encryption/decryption consists of one block only. The CBC mode of encryption is described in figure A.2. Figure A.2: CBC Encryption/Decryption The encryption is started with the initial value which is set to a zero vector. The IV is xor-ed with the first plaintext block of the APDU. The result of this encryption is processed accordingly.
16 16 TS V1.2.1 ( ) The cryptographic checksum (CC) is in the TDES case calculated as retail MAC according to figure A.3. Figure A.3: Retail MAC computation with TDES The first step performs a single encryption with they key K a on the send sequence counter. The resulting cryptogram Y 0 is xor-ed with the first plaintext block X 1 from the actual data to be protected. Figures 2 and 3 illustrate how the text blocks X i are built from the actual APDU data. Then the xor-result is encrypted again with the key K a. The second to the last step continue up to the last encryption which results in Y n. The final step is performed on Y n. K b is used with decryption, followed by an ecryption with K a. If the MAC computation is used with AES, then EMAC computation (MAC algorithm 2 as defined in ISO/IEC [3]) must be used. The last two operations, decryption with K a and encryption with K b are replaced by a single encryption with K b as shown in the figure A.4. Figure A.4: EMAC computation with AES
17 17 TS V1.2.1 ( ) Annex B (informative): Major changes from previous versions This annex is currently empty in the first version of the present document. It will later on contain a description of the major changes between the several versions, so that an history can be easily be done.
18 18 TS V1.2.1 ( ) History Document history V1.1.1 March 2003 Publication as SR V1.2.1 July 2005 Publication