2011-08-03_EAC2 Worked Example_V1.02
2011-08-03_EAC2 Worked Example_V1.02
2011-08-03_EAC2 Worked Example_V1.02
Version 1.02
Bundesamt für Sicherheit in der Informationstechnik
Postfach 20 03 63
53133 Bonn
E-Mail: ExtendedAccessControl@bsi.bund.de
Internet: https://www.bsi.bund.de
© Bundesamt für Sicherheit in der Informationstechnik 2011
Table of Contents
Table of Contents
1. Introduction.................................................................................................................................5
2. Settings for ECDH/ECDSA........................................................................................................6
2.1 Certificate DV...................................................................................................................................6
2.2 CHAT..............................................................................................................................................11
3. PACE Example (ECDH/ECDSA)............................................................................................12
3.1 Command MSE:Set AT...................................................................................................................15
3.2 Command Get Nonce......................................................................................................................16
3.3 Command Map Nonce.....................................................................................................................17
3.4 Command Perform Key Agreement................................................................................................19
3.5 Command Mutual Authentication...................................................................................................22
4. Terminal Authentication Example (ECDH/ECDSA)...............................................................25
4.1 Command MSE: Set DST................................................................................................................25
4.2 Command PSO: Verify Certificate..................................................................................................26
4.3 Command MSE: Set DST................................................................................................................28
4.4 Command PSO: Verify Certificate..................................................................................................29
4.5 Command MSE: Set AT..................................................................................................................30
4.6 Command Get Challenge.................................................................................................................32
4.7 Command External Authenticate.....................................................................................................33
5. Chip Authentication Example (ECDH/ECDSA)......................................................................35
5.1 Command MSE: Set AT..................................................................................................................40
5.2 Command General Authenticate......................................................................................................41
6. Settings for DH/RSA................................................................................................................44
6.1 Certificate DV.................................................................................................................................44
6.2 CHAT..............................................................................................................................................49
7. PACE Example (DH/RSA).......................................................................................................50
7.1 Command MSE:Set AT...................................................................................................................53
7.2 Command Get Nonce......................................................................................................................54
7.3 Command Map Nonce.....................................................................................................................55
7.4 Command Perform Key Agreement................................................................................................57
7.5 Command Mutual Authentication...................................................................................................59
8. Terminal Authentication Example (DH/RSA)..........................................................................62
8.1 Command MSE: Set DST................................................................................................................62
8.2 Command PSO: Verify Certificate..................................................................................................63
8.3 Command MSE: Set DST................................................................................................................64
8.4 Command PSO: Verify Certificate..................................................................................................65
8.5 Command MSE: Set AT..................................................................................................................67
8.6 Command Get Challenge.................................................................................................................69
8.7 Command External Authenticate.....................................................................................................70
1. Introduction
This document provides two worked examples for the EAC protocols as defined in [TR-03110].
The first example of this document is based on ECDH / ECDSA while the second one uses
DH / RSA. All numbers contained in the APDUs are noted hexadecimal. The notation follows
[TR-03110] and [Doc9303]. The example is based on the log file attached to this document.
The log file was generated with the tool GlobalTester (www.globaltester.org) provided by HJP
Consulting GmbH (www.hjp-consulting.com).
2.1 Certificate DV
06 0A 04 00 7F 00 07 02 OID id-TA-ECDSA-
02 02 02 05 SHA-512
DETESTDVDE019
06 09 04 00 7F 00 07 03 OID id-AT
01 02 02
5F 24 06 01 00 01 00 03 00 DATE Certificate
Expiration Date
Certification information:
Authority 44 45 43 56 43 41 41 54 30 30 30 30 31
Reference: (DECVCAAT00001)
Certificate 44 45 54 45 53 54 44 56 44 45 30 31 39
Holder (DETESTDVDE019)
Reference:
Effective Date: 01 00 00 09 03 00
(2010.09.30)
Expiration Date: 01 00 01 00 03 00
(2010.10.30)
Certificate AT
The AT certificate stores the following data:
Certificate Body:
0000 7F 4E 81 DE 5F 29 01 00 42 0D 44 45 54 45 53 54 .N.._)..B.DETEST
0010 44 56 44 45 30 31 39 7F 49 81 90 06 0A 04 00 7F DVDE019.I.......
0020 00 07 02 02 02 02 05 86 81 81 04 16 6D 8F 5E FC ............m.^.
0030 C6 E2 36 14 86 90 7C 52 4F 8A 9A 50 63 34 F8 43 ..6...|RO..Pc4.C
0040 09 8D A1 DB 83 D1 3E 10 9A F8 89 E7 26 71 0F B0 ......>.....&q..
0050 AF 3E A5 7E 76 09 86 05 A0 43 6F E0 7B 75 3A 75 .>.~v....Co.{u:u
0060 7A 04 6D 30 DA 7D 99 C0 7E 7C AD 34 D1 39 FD 40 z.m0.}..~|.4.9.@
0070 02 53 EF B7 FB DD DD 0B 3D 80 A0 BC 48 14 D3 05 .S......=...H...
0080 5A 3C D3 81 B5 B3 BE 1C D3 F7 45 6D 91 BA B1 6D Z<........Em...m
0090 D0 54 E4 03 EC 1A 93 93 F7 06 0B 2B 10 E0 1E 3C .T.........+...<
00A0 BA 5D D4 57 C1 3F 21 D7 C5 4C 2E 5F 20 0D 44 45 .].W.?!..L._ .DE
00B0 54 45 53 54 41 54 44 45 30 31 39 7F 4C 12 06 09 TESTATDE019.L...
00C0 04 00 7F 00 07 03 01 02 02 53 05 00 00 00 01 10 .........S......
00D0 5F 25 06 01 00 00 09 03 00 5F 24 06 01 00 01 00 _%......._$.....
00E0 03 00 ..
06 0A 04 00 7F 00 07 02 OID id-TA-ECDSA-
02 02 02 05 SHA-512
06 09 04 00 7F 00 07 03 OID id-AT
01 02 02
5F 24 06 01 00 01 00 03 00 DATE Certificate
Expiration Date
Certification information:
Authority 44 45 54 45 53 54 44 56 44 45 30 31 39
Reference: (DETESTDVDE019)
Certificate 44 45 54 45 53 54 41 54 44 45 30 31 39
Holder (DETESTATDE019)
Reference:
Effective Date: 01 00 00 09 03 00
(2010.09.30)
Expiration Date: 01 00 01 00 03 00
(2010.10.30)
Passwords
In this example the following passwords are used:
CAN 500540
PIN 123456
MRZ TPD<<T220001293<<<<<<<<<<<<<<<
6408125<1010318D<<<<<<<<<<<<<6
MUSTERMANN<<ERIKA<<<<<<<<<<<<<
2.2 CHAT
31 81 C6 SET
30 0D SEQUENCE
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-CA-ECDH-AES-
03 02 02 CBC-CMAC-128
ChipAuthenticationInfo
02 01 02 INTEGER Version
02 01 01 INTEGER keyId
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-PACE-ECDH-GM-
04 02 02 AES-CBC-CMAC-128
PACEInfo
02 01 02 INTEGER Version
02 01 0D INTEGER parameterID
identifier for
standardized domain
parameter
30 1C SEQUENCE
06 09 04 00 7F 00 07 02 02 OID id-CA-ECDH
03 02
ChipAuthentication
DomainParameterInfo
30 0C SEQUENCE
06 07 04 00 7F 00 07 01 02 OID OID_StandaradizedDom
ainParameters
02 01 0D INTEGER parameterID
02 01 01 INTEGER keyId
30 2F SEQUENCE
30 3E SEQUENCE
06 08 04 00 7F 00 07 02 02 OID id-PT
08
31 32 SET
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-CA-ECDH-AES-
03 02 02 CBC-CMAC-128
02 01 02 INTEGER Version
02 01 02 INTEGER keyId
30 1C SEQUENCE
06 09 04 00 7F 00 07 02 02 OID id-CA-ECDH
03 02
30 0C SEQUENCE
06 07 04 00 7F 00 07 01 02 OID OID_StandaradizedDom
ainParameters
02 01 0D INTEGER parameterID
02 01 02 INTEGER keyId
Algorithm Identifier 0D
(BrainpoolP256r1)
(parameterID)
To initialize PACE the terminal sends the following command MSE:Set AT to the chip.
T→C 0000 00 22 C1 A4 27 80 0A 04 00 7F 00 07 02 02 04 02 ."..'...........
0010 02 83 01 03 7F 4C 12 06 09 04 00 7F 00 07 03 01 .....L..........
0020 02 02 53 05 00 00 00 01 10 84 01 0D ..S.........
C→T 0000 90 00
Here T→C is an abbreviation for an APDU sent from terminal (T or PCD) to chip (C or PICC)
while C→T denotes the corresponding response sent by the chip to the terminal. The encoding of
the command is explained in the next table.
C-APDU
CLA 00 Plain
83 01 03 Password: PIN
R-APDU
SW 90 00 Normal operation
The chip randomly generates a nonce s and encrypts it with the key Kπ
Nonce
decrypted 0000 CE 83 4C DE 69 FF BB 1D 1E B2 15 85 CD 70 9F 18 ..L.i........p..
(s)
Nonce
encrypted 0000 7D 98 C0 0F C6 C9 E9 54 3B BF 94 A8 70 73 A1 23 }......T;...ps.#
(z)
C-APDU
7C 00 - -
R-APDU
80 10 CE 83 4C DE 69 FF BB 1D Encrypted Nonce
1E B2 15 85 CD 70 9F 18
SW 90 00 Normal operation
The nonce is mapped to an ephemeral group generator via generic mapping. The required randomly
chosen ephemeral keys are also collected in the next table.
PCD 0000 75 22 87 F5 B0 2D E3 C4 BC 3E 17 94 51 18 C5 1B u"...-...>..Q...
Private Key 0010 23 C9 72 78 E4 CD 74 80 48 AC 56 BA 5B DC 3D 46 #.rx..t.H.V.[.=F
SK PCD
SK PICC
The following APDUs are exchanged by terminal and chip to map the nonce.
C-APDU
81 41 Mapping Data
04 Uncompressed Point
3D D2 9B BE 59 07 FD X-Coordinate
21 A1 52 AD A4 89 5F
AA E7 AC C5 5F 5E 50
EF BF DE 5A B0 C6 EB
54 F1 98 D6
15 91 36 35 F0 FD F5 Y-Coordinate
BE B3 83 E0 03 55 F8
2D 3C 41 ED 0D F2 E2
83 63 43 3D FB 73 85
6A 15 DC 9F
R-APDU
82 41 Mapping data
04 Uncompressed Point
9C FC F7 58 2A C9 86 X-Coordinate
D0 DD 52 FA 53 12 34
14 C3 E1 B9 6B 4D 00
AB A8 E5 74 67 9B 70
EF B5 BC 3B
45 D2 F1 37 29 CC 2A Y-Coordinate
E1 78 E7 E2 41 B4 43
21 35 33 B7 7D BB 44
64 9A 81 5D DC 4A 23
84 BA 42 2A
SW 90 00 Normal operation
In the third step chip and terminal perform an anonymous ECDH key agreement using the new
domain parameters determined by the ephemeral group generator G of the previous step. As
shared secret only the first coordinate is required.
PCD 0000 00 9D 9A 32 DF 93 A5 7C CE 33 CA 3C DD 34 57 E3 ...2...|.3.<.4W.
Private Key 0010 3A 97 6F 29 35 46 C7 35 50 F3 97 25 9C 93 BE 01 :.o)5F.5P..%....
0020 20
(SKPCD)
C-APDU
04 Uncompressed Point
51 8B C4 E5 32 AD 2A X-coordinate
9B D6 52 78 04 D5 D6
65 AB D5 10 41 03 7A
0C C8 AA 92 28 04 EB
50 1C 22 2B
34 27 38 85 99 AF AA Y-coordinate
E9 FB AC E2 DF 93 E1
3C 3C 49 79 CD 12 F0
AE 3E 3C 01 26 02 83
91 55 45 82
R-APDU
04 Uncompressed Point
28 2C F3 80 73 03 6A X-Coordinate
FA C2 16 AF 13 5B D9
94 DA 0C 35 7F 10 BD
4C 34 AF EA 10 42 B2
EB 0F D6 80
4D F3 65 8B 83 5A C2 Y-Coordinate
E7 13 3F 13 69 11 84
54 2B B5 0B 10 99 63
A4 66 2A BD C0 8B 97
63 AF 4B 5B
SW 90 00 Normal operation
By means of the KDF specified in [TR-03110] the AES 128 session keys are derived from the
shared secret as following.
KEnc 0000 68 40 6B 41 62 10 05 63 D9 C9 01 A6 15 4D 29 01 h@kAb..c.....M).
The authentication token is constructed by OID and public key on both sides, PICC and PCD.
Construction of input data for Authentication Token TPCD:
Tag Length Value ASN1.Type Comment
04 Uncompressed Point
28 2C F3 80 73 03 6A X-coordinate
FA C2 16 AF 13 5B D9
94 DA 0C 35 7F 10 BD
4C 34 AF EA 10 42 B2
EB 0F D6 80
4D F3 65 8B 83 5A C2 Y-coordinate
E7 13 3F 13 69 11 84
54 2B B5 0B 10 99 63
A4 66 2A BD C0 8B 97
63 AF 4B 5B
04 Uncompressed Point
51 8B C4 E5 32 AD 2A X-coordinate
9B D6 52 78 04 D5 D6
65 AB D5 10 41 03 7A
0C C8 AA 92 28 04 EB
50 1C 22 2B
34 27 38 85 99 AF AA Y-coordinate
E9 FB AC E2 DF 93 E1
3C 3C 49 79 CD 12 F0
AE 3E 3C 01 26 02 83
91 55 45 82
C-APDU
CLA 00 Plain
R-APDU
SW 90 00 Normal operation
With this successful exchange a secure channel based on PACE has been established.
The command MSE:Set DST is used to send the CAR from the terminal to the chip. The CAR is
delivered by PACE before (see 3.5).
CAR 0000 44 45 41 54 43 56 43 41 30 30 30 30 31
The terminal sends a certificate chain to the chip. From this point the communication is encrypted
by Secure Messaging with the keys derived during PACE. The chain starts with a certificate
verifiable with the CVCA public key stored on the chip as following.
T→C 0000 00 22 81 B6 0F 83 0D 44 45 43 56 43 41 41 54 30 .".....DECVCAAT0
0010 30 30 30 31 0001
plain
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
30 30 30 30 31
R-APDU
SW 90 00 Normal operation
0130 08 4E BF 46 3D 8F 0A F1 6A B9 7A DB 9D 4C 65 68 .N.F=...j.z..Leh
0140 8D D4 32 A9 EC 3B 3F 8D 9A 68 5B A8 48 4B 5E A2 ..2..;?..h[.HK^.
0150 1A F7 39 CD A4 D6 3C 2A 98 74 B9 61 F5 30 06 97 ..9...<*.t.a.0..
0160 70 64 83 05 90 E2 76 1F 88 AA 6E 4D 65 08 8A E4 pd....v...nMe...
0170 C7 C8 4D E8 AE 62 B6 8E 55 7D CD F5 8E 08 E3 8A ..M..b..U}......
0180 CD A4 4E 50 3C E5 00 00 ..NP<...
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
7F 4E 81 DE 5F 29 01 00 42 0D 44 45 Certificate Body
43 56 43 41 41 54 …
… 00 00 09 03 00 5F
24 06 01 00 01 00 03 00
5F 37 81 80 34 EA 28 28 25 23 1B F9 Signature
EF 84 DC D1 5A F7 …
… E5 4C 7E 9E 83 73
67 DF 17 1C C7 B2 C8 91
R-APDU
SW 90 00 Normal operation
The following CAR of the DV certificate is used by the command MSE:Set DST.
CAR 0000 44 45 54 45 53 54 44 56 44 45 30 31 39
The reference of the public key (CAR) is send from the terminal to the chip as following.
T→C 0000 00 22 81 B6 0F 83 0D 44 45 54 45 53 54 44 56 44 .".....DETESTDVD
0010 45 30 31 39 E019
plain
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
SW 90 00 Normal operation
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
7F 4E 81 DE 5F 29 01 00 42 0D 44 45 Certificate Body
54 45 53 54 44 56 …
… 00 00 09 03 00 5F
24 06 01 00 01 00 03 00
5F 37 81 80 29 F8 17 6A 03 D2 AE 3F Signature
7C FF E1 A5 9B 28 …
… F0 26 14 D5 47 E3
02 AC 63 8E 51 45 38 AB
R-APDU
SW 90 00 Normal operation
Extract the following relevant information from EF.CardAccess. In EF.CardAccess there are two
key references for CA defined: 01 and 02. Both use the curve BrainpoolP256r1 (0D).
The terminal generates an ephemeral Diffie-Hellman key pair and sends the compressed ephemeral
public key to the chip.
DPICC 0D
CHR 44 45 54 45 53 54 41 54 44 45 30 31 39
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
80 0A 04 00 7F 00 07 02 02 02 Cryptograhic mechanism
02 05 reference, OID
03 AC 7F F4 54 41 A8
B2 90 9D 88 EA B8 E6
B0 17 38 47 AB 49 B9
49 DF 37 99
The chip is randomly chosing a rPICC and this rPICC is queried by the terminal.
rPICC 54 7E 4E AB 03 B2 35 D2
T→C 0000 00 84 00 00 08
plain
plain
C-APDU
CLA 00 / 0C Plain, SM
P1/P2 00 00 -
R-APDU
54 7E 4E AB 03 B2 35 D2 8 bytes of randomness
SW 90 00 Normal operation
The data to be signed is constructed of the key, the challenge and the hash. The resulting signature
is used in the command EXTERNAL AUTHENTICATE. The defined algorithm here is
SHA512withECDSA.
(rPICC)
0090 37 AE 16 5F E0 CD 22 0D 8D 8E 08 B8 36 C6 48 0A 7.._..".....6.H.
00A0 C6 3D C8 00 .=..
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
SW 90 00 Normal operation
0030 6F 29 EC 57 FB 19 DB 12 30 F0 F2 FC 1B F6 0D 1D o).W....0.......
0040 03 96 33 3C 89 A9 2B F2 31 3C 43 60 BA B2 18 DE ..3<..+.1<C`....
0050 57 71 3F 39 0C A5 BB B6 99 CD 1A 1E 27 3C 61 8B Wq?9........'<a.
0060 25 A7 EE DA B5 F0 BA B0 30 65 AA 74 9D 51 32 60 %.......0e.t.Q2`
0070 BE 86 7E B0 11 29 1D CF 4A DC 83 33 F7 78 4F DD ..~..)..J..3.xO.
0080 E8 17 2F 46 C4 F7 90 42 15 FD C9 8F 5C DE 49 16 ../F...B....\.I.
0090 F0 3E 24 9C D3 94 07 62 D2 F8 E9 2F 23 17 16 A6 .>$....b.../#...
00A0 BF 74 2F ED C2 62 7E 62 F0 46 95 6D B9 7B AA D2 .t/..b~b.F.m.{..
00B0 5C 04 62 47 54 D4 AF 3E 1A 7E C4 72 07 CC 08 BD \.bGT..>.~.r....
00C0 15 4E 83 9A 43 55 D0 1F 16 DA 2C C1 61 77 A9 14 .N..CU....,.aw..
00D0 D4 42 87 E6 52 25 64 D0 00 53 9E C9 6A 2B 0E 1E .B..R%d..S..j+..
00E0 6E BB 89 63 81 86 8B 5A FE 0A 0F D3 C3 62 F4 19 n..c...Z.....b..
00F0 AF FD FF 01 6A 71 17 0A C8 B3 78 A6 E3 99 5D 82 ....jq....x...].
0100 EE 45 95 0E EB B4 C9 BB F6 31 13 24 82 A5 03 C3 .E.......1.$....
0110 10 26 B4 C2 CD 94 26 E6 66 3D E4 C4 3E FE 54 01 .&....&.f=..>.T.
0120 F4 D3 BA 76 E5 4F 66 3B 28 32 3E A3 33 1E 96 A7 ...v.Of;(2>.3...
0130 08 12 F9 43 15 D6 08 A9 E8 CE 1B F0 2B 6E CF 07 ...C........+n..
0140 01 5D 40 F4 73 DF E1 6F 5C 12 14 60 81 C4 4C 14 .]@.s..o\..`..L.
0150 8D AB 09 83 50 46 57 A5 3C CA 16 BD 54 5D 5A D5 ....PFW.<...T]Z.
0160 9A 21 AA 91 9E 7F 9B B7 B3 50 01 AB EF 61 E7 D5 .!.......P...a..
0170 6E 21 C7 F1 13 73 42 55 71 A7 91 45 D4 46 2E B2 n!...sBUq..E.F..
0180 6B k
SET SIZE( 517 )
SEQUENCE SIZE( 513 )
INTEGER SIZE( 1 )
0000 01 .
SEQUENCE SIZE( 90 )
SEQUENCE SIZE( 83 )
SET SIZE( 11 )
SEQUENCE SIZE( 9 )
OBJECT IDENTIFIER = { 2 5 4 6 }
PRINTABLE-STRING SIZE( 2 )
0000 44 45 DE
SET SIZE( 23 )
SEQUENCE SIZE( 21 )
OBJECT IDENTIFIER = { 2 5 4 10 }
UTF8-STRING SIZE( 14 )
0000 48 4A 50 20 43 6F 6E 73 75 6C 74 69 6E 67 HJP Consulting
SET SIZE( 23 )
SEQUENCE SIZE( 21 )
OBJECT IDENTIFIER = { 2 5 4 11 }
UTF8-STRING SIZE( 14 )
0000 43 6F 75 6E 74 72 79 20 53 69 67 6E 65 72 Country Signer
SET SIZE( 18 )
SEQUENCE SIZE( 16 )
OBJECT IDENTIFIER = { 2 5 4 3 }
UTF8-STRING SIZE( 9 )
0000 48 4A 50 20 50 42 20 43 53 HJP PB CS
INTEGER SIZE( 3 )
0000 01 63 26 .c&
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A0 [ CONTEXT 0 ] IMPLICIT SEQUENCE SIZE( 74 )
SEQUENCE SIZE( 23 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 9 3 }
SET SIZE( 10 )
OBJECT IDENTIFIER = { 0 4 0 127 0 7 3 2 1 }
SEQUENCE SIZE( 47 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 9 4 }
SET SIZE( 34 )
OCTET-STRING SIZE( 32 )
0000 49 AE B9 37 52 8C 26 9E A7 23 BB C8 AA DC 38 5C I..7R.&..#....8\
0010 9D 6B 1A E3 75 16 A5 B8 92 1F F8 C4 59 18 72 93 .k..u.......Y.r.
SEQUENCE SIZE( 65 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 10 }
SEQUENCE SIZE( 52 )
A0 [ CONTEXT 0 ] IMPLICIT SEQUENCE SIZE( 15 )
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A1 [ CONTEXT 1 ] IMPLICIT SEQUENCE SIZE( 28 )
SEQUENCE SIZE( 26 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 8 }
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A2 [ CONTEXT 2 ] IMPLICIT SEQUENCE SIZE( 3 )
INTEGER SIZE( 1 )
0000 20
OCTET-STRING SIZE( 256 )
0000 97 C2 2D 87 C3 13 D6 48 DF B9 DE 9D 9C CA 3A 41 ..-....H......:A
0010 CB F8 52 22 E3 6D 3B 9C 7E B1 CC 0B 1A 8C AE 4C ..R".m;.~......L
0020 93 E0 F1 CA 02 8A 90 DD 2B 4F 5C B4 2C 9E 5B B5 ........+O\.,.[.
0030 73 C0 39 77 3E 64 08 41 B3 28 30 DF 83 93 22 46 s.9w>d.A.(0..."F
0040 FC 8B AF 92 8D 67 54 6E 8E 0C 06 65 A9 32 87 48 .....gTn...e.2.H
0050 85 51 8E A3 D0 20 46 A6 18 CF 1A F5 A0 F5 E4 C4 .Q... F.........
0060 05 62 4D 2D 66 D1 6B DA 18 A8 38 22 84 78 8E 81 .bM-f.k...8".x..
0070 FE 1C B5 E2 17 01 CD D2 09 22 12 0E 68 20 30 E8 ........."..h 0.
0080 0D 12 DA 40 6B 01 36 E9 ED 8B 23 8F 65 3C 7D DC ...@k.6...#.e<}.
0090 A9 27 86 60 41 4E FA 93 73 82 50 CD 08 41 72 7E .'.`AN..s.P..Ar~
00A0 0F 68 C4 90 02 64 1D 7E 40 26 28 5B 9B 53 F2 70 .h...d.~@&([.S.p
00B0 BB A5 05 8E 46 60 0B 84 35 54 60 5B F8 EC 2C 74 ....F`..5T`[..,t
00C0 0A ED C8 B2 4E 2A 64 AC 78 F5 89 97 A1 88 33 A4 ....N*d.x.....3.
00D0 05 CB 64 EA 6D D7 D7 11 5F D7 C3 51 76 72 65 4E ..d.m..._..QvreN
00E0 03 02 97 30 FA B7 25 65 A0 92 65 71 69 68 01 F3 ...0..%e..eqih..
00F0 FE 5A 63 CF 70 92 0A 11 2F CF 69 29 1B AE 37 A3 .Zc.p.../.i)..7.
CA OID 0.4.0.127.0.7.2.2.3.2.2
In the first step the following information extracted from EF.ChipSecurity are important.
CA OID 0.4.0.127.0.7.2.2.3.2.2
Key 01
Reference
In the first step of Chip Authentication the terminal sends its OID for CA and the reference of the
private key to the chip with the command MSE:Set AT as following.
T→C 0000 00 22 41 A4 0F 80 0A 04 00 7F 00 07 02 02 03 02 ."A.............
0010 02 84 01 01 ....
plain
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
80 0A 04 00 7F 00 07 02 02 03 Cryptographic mechanism
02 02 reference, OID
R-APDU
SW 90 00 Normal operation
PK PCD 0000 04 5A 7A 37 7F C9 CA FC 03 AC 7F F4 54 41 A8 B2 .Zz7........TA..
0010 90 9D 88 EA B8 E6 B0 17 38 47 AB 49 B9 49 DF 37 ........8G.I.I.7
0020 99 A3 4E E5 7E C5 52 68 CF 8B 1C 3E C4 89 F8 BF ..N.~.Rh...>....
0030 4C F4 C6 8D 3F D9 67 0E 89 C0 D5 D3 FF F1 AA F8 L...?.g.........
0040 9F .
C-APDU
CLA 00 / 0C Plain, SM
87 74 6A 57 92 7C 8C 28
A6 77 5C 97 A7 E1 FE 8D
9A 46 FF 4A 1C C7 E4 D1
38 9A EA 19 75 8E 4F 75
C2 8C 59 8F D7 34 AE BE
B1 35 33 7C F9 5B E1 2E
94
R-APDU
81 08 42 87 B3 07 2A 3E DC 60 rPICC
82 08 FF 01 17 D6 8D EE 8E 72 TPICC
SW 90 00 Normal operation
Both the terminal and the chip calculate the shared secret K.
PICC:
SKPICC 0000 79 84 67 4C F3 B3 A5 24 BF 92 9C E8 A6 7F CF 22 y.gL...$......."
0010 17 3D A0 BA D5 95 EE D6 DE B7 2D 22 C5 42 FA 9D .=........-".B..
PK PCD 0000 04 5A 7A 37 7F C9 CA FC 03 AC 7F F4 54 41 A8 B2 .Zz7........TA..
0010 90 9D 88 EA B8 E6 B0 17 38 47 AB 49 B9 49 DF 37 ........8G.I.I.7
0020 99 A3 4E E5 7E C5 52 68 CF 8B 1C 3E C4 89 F8 BF ..N.~.Rh...>....
0030 4C F4 C6 8D 3F D9 67 0E 89 C0 D5 D3 FF F1 AA F8 L...?.g.........
0040 9F .
DPICC 0D
PCD:
SK PCD 0000 00 A6 A4 D2 55 C5 BF 7A 77 EC 3D 05 53 DB 74 F6 ....U..zw.=.S.t.
0010 93 CF 04 4E 18 C9 83 64 D4 97 7A 29 61 08 AF 19 ...N...d..z)a...
0020 BD .
0020 9A 46 FF 4A 1C C7 E4 D1 38 9A EA 19 75 8E 4F 75 .F.J....8...u.Ou
0030 C2 8C 59 8F D7 34 AE BE B1 35 33 7C F9 5B E1 2E ..Y..4...53|.[..
0040 94 .
DPICC 0D
PK PCD 0000 04 5A 7A 37 7F C9 CA FC 03 AC 7F F4 54 41 A8 B2 .Zz7........TA..
0010 90 9D 88 EA B8 E6 B0 17 38 47 AB 49 B9 49 DF 37 ........8G.I.I.7
0020 99 A3 4E E5 7E C5 52 68 CF 8B 1C 3E C4 89 F8 BF ..N.~.Rh...>....
0030 4C F4 C6 8D 3F D9 67 0E 89 C0 D5 D3 FF F1 AA F8 L...?.g.........
0040 9F .
TPCD FF 01 17 D6 8D EE 8E 72
The authentication token TPCD computed by the terminal is equal to the authentication TPICC returned
by the PICC in the previous command above. This means Chip Authentication has performed
successfully.
The new session keys (AES 128) are derived from the shared secret by means of KDF specified in
[TR-03110].
With an established Chip Authentication and the new session keys the data of the chip application
can be read.
6.1 Certificate DV
06 0A 04 00 7F 00 07 02 OID id-TA-RSA-v1-5-
02 02 01 01 SHA-1
06 09 04 00 7F 00 07 03 OID id-AT
01 02 02
5F 24 06 01 00 00 04 02 04 DATE Certificate
Expiration Date
Certification information:
Authority 44 45 54 45 53 54 43 56 43 41 30 30 30 30 33
Reference: (DETESTCVCA00003)
Certificate 44 45 54 45 53 54 44 56 44 45 30 31 39
Holder (DETESTDVDE019)
Reference:
Access Rights:
CAN allowed
Read Access(eID) DG1
Read Access(eID) DG2
Read Access(eID) DG3
Read Access(eID) DG4
Read Access(eID) DG5
Read Access(eID) DG6
Read Access(eID) DG7
Read Access(eID) DG8
Read Access(eID) DG9
Read Access(eID) DG10
Read Access(eID) DG11
Read Access(eID) DG12
Read Access(eID) DG13
Read Access(eID) DG14
Read Access(eID) DG15
Read Access(eID) DG16
Read Access(eID) DG17
Read Access(eID) DG18
Read Access(eID) DG19
Read Access(eID) DG20
Read Access(eID) DG21
Effective Date: 01 00 00 03 02 04
(2010.03.24)
Expiration Date: 01 00 00 04 02 04
(2010.04.24)
Certificate AT
The AT certificate stores the following data:
Certificate Body:
0000 7F 4E 81 E2 5F 29 01 00 42 0D 44 45 54 45 53 54 .N.._)..B.DETEST
0010 44 56 44 45 30 31 39 7F 49 81 94 06 0A 04 00 7F DVDE019.I.......
0020 00 07 02 02 02 01 01 81 81 80 9F 7E F6 8E 15 3D ...........~...=
0030 B4 FD 10 84 DD ED BE AE 84 2C 55 6D 41 9F CB 5E .........,UmA..^
0040 F6 21 AA 37 51 F0 FC 0C FD 71 4F C0 E7 68 86 6B .!.7Q....qO..h.k
0050 3F 44 E2 72 5A F0 35 1A 97 ED B1 BA 88 DF DD 9B ?D.rZ.5.........
0060 4D 81 D4 08 FE 07 63 34 6A 77 2C F6 46 16 46 5C M.....c4jw,.F.F\
0070 8F D9 71 B7 75 D2 E1 34 26 C5 BC 11 89 47 95 C5 ..q.u..4&....G..
0080 AD 2C 3E 42 68 37 F3 A1 01 9F E9 51 24 EA 5D 43 .,>Bh7.....Q$.]C
0090 3E 90 6D 79 93 49 63 21 EF CB DB C3 2D 93 C0 68 >.my.Ic!....-..h
00A0 0B 45 F3 B8 F6 4A 5D AF CF B9 82 03 01 00 01 5F .E...J]........_
00B0 20 0D 44 45 54 45 53 54 41 54 44 45 30 31 39 7F .DETESTATDE019.
00C0 4C 12 06 09 04 00 7F 00 07 03 01 02 02 53 05 00 L............S..
00D0 00 00 01 10 5F 25 06 01 00 00 03 02 04 5F 24 06 ...._%......._$.
00E0 01 00 00 04 02 04 ......
06 0A 04 00 7F 00 07 02 OID id-TA-RSA-v1-5-
02 02 01 01 SHA-1
06 09 04 00 7F 00 07 03 OID id-AT
01 02 02
5F 24 06 01 00 00 04 02 04 DATE Certificate
Expiration Date
Certification information:
Authority 44 45 54 45 53 54 44 56 44 45 30 31 39
Reference: (DETESTDVDE019)
Certificate 44 45 54 45 53 54 41 54 44 45 30 31 39
Holder (DETESTATDE019)
Reference:
Effective Date: 01 00 00 03 02 04
(2010.03.24)
Expiration Date: 01 00 00 04 02 04
(2010.04.24)
Passwords
In this example the following passwords are used:
CAN 500540
PIN 123456
MRZ TPD<<T220001293<<<<<<<<<<<<<<<
6408125<1010318D<<<<<<<<<<<<<6
MUSTERMANN<<ERIKA<<<<<<<<<<<<<
6.2 CHAT
31 81 C6 SET
30 0D SEQUENCE
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-CA-DH-AES-CBC-
03 01 02 CMAC-128
ChipAuthenticationInfo
02 01 02 INTEGER Version
02 01 01 INTEGER keyId
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-PACE-DH-GM-AES-
04 01 02 CBC-CMAC-128
PACEInfo
02 01 02 INTEGER Version
02 01 00 INTEGER parameterID
30 1C SEQUENCE
06 09 04 00 7F 00 07 02 02 OID id-CA-DH
03 01
30 0C SEQUENCE
06 07 04 00 7F 00 07 01 02 OID OID_StandaradizedDom
ainParameters
02 01 00 INTEGER parameterID
02 01 01 INTEGER keyId
30 2F SEQUENCE
16 23 68 74 74 70 73 -
3A 2F 2F 77 77 77 2E
68 6A 70 2D 63 6F 6E
73 75 6C 74 69 6E 67
2E 63 6F 6D 2F 68 6F
6D 65
30 3E SEQUENCE
06 08 04 00 7F 00 07 02 02 OID id-PT
08
31 32 SET
30 12 SEQUENCE
06 0A 04 00 7F 00 07 02 02 OID id-CA-DH-AES-CBC-
03 01 02 CMAC-128
02 01 02 INTEGER Version
02 01 02 INTEGER keyId
30 1C SEQUENCE
06 09 04 00 7F 00 07 02 02 OID id-CA-DH
03 01
30 0C SEQUENCE
06 07 04 00 7F 00 07 01 02 OID OID_StandaradizedDom
ainParameters
02 01 00 INTEGER parameterID
02 01 02 INTEGER keyId
Algorithm Identifier 00
(parameterID) (1024-bit MODP Group with 160-bit Prime Order Subgroup
specified by [RFC5114])
(PACE-DH-GM-AES-CBC-CMAC128)
To initialize PACE the terminal sends the following command MSE:Set AT to the chip.
T→C 0000 00 22 C1 A4 27 80 0A 04 00 7F 00 07 02 02 04 01 ."..'...........
0010 02 83 01 03 7F 4C 12 06 09 04 00 7F 00 07 03 01 .....L..........
0020 02 02 53 05 00 00 00 01 10 84 01 00 ..S.........
C→T 0000 90 00
Here T→C is an abbreviation for an APDU sent from terminal (T or PCD) to chip (C or PICC)
while C→T denotes the corresponding response sent by the chip to the terminal. The encoding of
the command is explained in the next table.
C-APDU
CLA 00 Plain
83 01 03 Password: PIN
R-APDU
SW 90 00 Normal operation
The chip randomly generates a nonce s and encrypts it with the key Kπ
Nonce
decrypted 0000 FA 5B 7E 3E 49 75 3A 0D B9 17 8B 7B 9B D8 98 C8 .[~>Iu:....{....
(s)
Nonce
encrypted 0000 9A BB 88 64 CA 0F F1 55 1E 62 0D 1E F4 E1 35 10 ...d...U.b....5.
(z)
C-APDU
7C 00 - -
R-APDU
80 10 9A BB 88 64 CA 0F F1 55 Encrypted Nonce
1E 62 0D 1E F4 E1 35 10
SW 90 00 Normal operation
The nonce is mapped to an ephemeral group generator via generic mapping. The required randomly
chosen ephemeral keys are also collected in the next table.
0050 36 06 76 82 9B 82 6B EA 57 29 1B 5A D6 9F BC 84 6.v...k.W).Z....
0060 EF 1E 77 90 32 A3 05 80 3F 74 34 17 93 E8 69 74 ..w.2...?t4...it
0070 2D 40 13 25 B3 7E E8 56 5F FC DE E6 18 34 2D C5 -@.%.~.V_....4-.
The following APDUs are exchanged by terminal and chip to map the nonce.
T→C 0000 10 86 00 00 86 7C 81 83 81 81 80 23 FB 37 49 EA .....|.....#.7I.
0010 03 0D 2A 25 B2 78 D2 A5 62 04 7A DE 3F 01 B7 4F ..*%.x..b.z.?..O
0020 17 A1 54 02 CB 73 52 CA 7D 2B 3E B7 1C 34 3D B1 ..T..sR.}+>..4=.
0030 3D 1D EB CE 9A 36 66 DB CF C9 20 B4 91 74 A6 02 =....6f... ..t..
0040 CB 47 96 5C AA 73 DC 70 24 89 A4 4D 41 DB 91 4D .G.\.s.p$..MA..M
0050 E9 61 3D C5 E9 8C 94 16 05 51 C0 DF 86 27 4B 93 .a=......Q...'K.
0060 59 BC 04 90 D0 1B 03 AD 54 02 2D CB 4F 57 FA D6 Y.......T.-.OW..
0070 32 24 97 D7 A1 E2 8D 46 71 0F 46 1A FE 71 0F BB 2$.....Fq.F..q..
0080 BC 5F 8B A1 66 F4 31 19 75 EC 6C 00 ._..f.1.u.l.
C-APDU
81 81 80 Mapping Data
23 FB 37 49 EA 03 0D
2A 25 B2 78 D2 …
… BC 5F 8B A1 66
F4 31 19 75 EC 6C
R-APDU
82 81 80 Mapping data
ED 0F C8 90 A4 B2 53
36 F6 99 AA 89 …
… 4F 84 D8 25 89
50 A9 1B 44 12 6E E6
SW 90 00 Normal operation
In the third step chip and terminal perform an anonymous DH key agreement using the new domain
parameters determined by the ephemeral group generator G of the previous step.
PICC
Public Key 0000 07 56 93 D9 AE 94 18 77 57 3E 63 4B 6E 64 4F 8E .V.....wW>cKndO.
0010 60 AF 17 A0 07 6B 8B 12 3D 92 01 07 4D 36 15 2B `....k..=...M6.+
(PKPICC) 0020 D8 B3 A2 13 F5 38 20 C4 2A DC 79 AB 5D 0A EE C3 .....8 .*.y.]...
0030 AE FB 91 39 4D A4 76 BD 97 B9 B1 4D 0A 65 C1 FC ...9M.v....M.e..
0040 71 A0 E0 19 CB 08 AF 55 E1 F7 29 00 5F BA 7E 3F q......U..)._.~?
0050 A5 DC 41 89 92 38 A2 50 76 7A 6D 46 DB 97 40 64 ..A..8.PvzmF..@d
0060 38 6C D4 56 74 35 85 F8 E5 D9 0C C8 B4 00 4B 1F 8l.Vt5........K.
0070 6D 86 6C 79 CE 05 84 E4 96 87 FF 61 BC 29 AE A1 m.ly.......a.)..
Shared
Secret K 0000 6B AB C7 B3 A7 2B CD 7E A3 85 E4 C6 2D B2 62 5B k....+.~....-.b[
0010 D8 61 3B 24 14 9E 14 6A 62 93 11 C4 CA 66 98 E3 .a;$...jb....f..
0020 8B 83 4B 6A 9E 9C D7 18 4B A8 83 4A FF 50 43 D4 ..Kj....K..J.PC.
0030 36 95 0C 4C 1E 78 32 36 7C 10 CB 8C 31 4D 40 E5 6..L.x26|...1M@.
0040 99 0B 0D F7 01 3E 64 B4 54 9E 22 70 92 3D 06 F0 .....>d.T."p.=..
0050 8C FF 6B D3 E9 77 DD E6 AB E4 C3 1D 55 C0 FA 2E ..k..w......U...
0060 46 5E 55 3E 77 BD F7 5E 31 93 D3 83 4F C2 6E 8E F^U>w..^1...O.n.
0070 B1 EE 2F A1 E4 FC 97 C1 8C 3F 6C FF FE 26 07 FD ../......?l..&..
C-APDU
90 7D 89 E2 D4 25 A1
78 AA 81 AF 4A 77 …
… 17 5E B5 13 05
51 ED BC 2E E5 D4
R-APDU
07 56 93 D9 AE 94 18
77 57 3E 63 4B …
… CE 05 84 E4 96
87 FF 61 BC 29 AE A1
SW 90 00 Normal operation
By means of the KDF specified in [TR-03110] the AES 128 session keys are derived from the
shared secret as following.
KEnc 0000 2F 7F 46 AD CC 9E 7E 52 1B 45 D1 92 FA FA 91 26 /.F...~R.E.....&
The authentication token is constructed by OID and public key on both sides, PICC and PCD.
Construction of input data for Authentication Token TPCD
Tag Length Value ASN1.Type Comment
Authentication Token
07 56 93 D9 AE 94 18
77 57 3E 63 4B …
… CE 05 84 E4 96
87 FF 61 BC 29 AE A1
90 7D 89 E2 D4 25 A1
78 AA 81 AF 4A 77 …
… 5C 17 5E B5 13
05 51 ED BC 2E E5 D4
C-APDU
CLA 00 Plain
R-APDU
SW 90 00 Normal operation
With this successfully exchange and comparison a secure channel based on PACE has been
established.
The command MSE:Set DST is used to send the CAR from the terminal to the chip. The CAR is
delivered by PACE before (see 7.5).
CAR 0000 44 45 41 54 43 56 43 41 30 30 30 30 33
The terminal sends a certificate chain to the chip. Until this point the communication is encrypted
by Secure Messaging with the keys derived during PACE. The chain starts with a certificate
verifiable with the CVCA public key stored on the chip as following.
T→C 0000 00 22 81 B6 11 83 0F 44 45 54 45 53 54 43 56 43 .".....DETESTCVC
0010 41 30 30 30 30 33 A00003
plain
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
SW 90 00 Normal operation
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
7F 4E 81 E4 5F 29 01 00 42 0F 44 45 Certificate Body
54 45 53 54 …
… 03 02 04 5F 24 06
01 00 00 04 02 04
5F 37 81 80 6B 95 0F 1F A8 FE F8 61 Signature
EE A7 57 65 …
… 0A 63 20 98 05 96
8D BD 17 D3 6E 75
R-APDU
SW 90 00 Normal operation
The following CAR of the DV certificate is used by the command MSE:Set DST.
CAR 0000 44 45 54 45 53 54 44 56 44 45 30 31 39
The reference of the public key (CAR) is send from the terminal to the chip as following.
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
SW 90 00 Normal operation
00A0 CB DB C3 2D 93 C0 68 0B 45 F3 B8 F6 4A 5D AF CF ...-..h.E...J]..
00B0 B9 82 03 01 00 01 5F 20 0D 44 45 54 45 53 54 41 ......_ .DETESTA
00C0 54 44 45 30 31 39 7F 4C 12 06 09 04 00 7F 00 07 TDE019.L........
00D0 03 01 02 02 53 05 00 00 00 01 10 5F 25 06 01 00 ....S......_%...
00E0 00 03 02 04 5F 24 06 01 00 00 04 02 04 5F 37 81 ...._$......._7.
00F0 80 8C B1 61 26 A1 FD BB 82 48 C8 8B DB 1F B1 19 ...a&....H......
0100 9C 3F 25 38 56 FE 10 83 5F 7B FF 62 A3 0B D2 81 .?%8V..._{.b....
0110 B8 A1 F0 FE 03 81 A5 B0 A4 26 51 F7 7D F7 21 52 .........&Q.}.!R
0120 21 F0 ED E4 88 E6 89 EA 45 CE E2 0B 19 C7 B1 D1 !.......E.......
0130 ED B6 AC 21 F3 40 88 81 9F 6F D5 DC 33 31 09 E1 ...!.@...o..31..
0140 5A 15 DF F6 85 A2 B6 9D 17 D5 E2 3D AF E3 63 A8 Z..........=..c.
0150 E7 63 31 CC 25 B9 13 FB 6E D8 30 EB 45 7A D0 A6 .c1.%...n.0.Ez..
0160 73 96 A1 90 CA E3 9C C6 C2 E4 67 1E 60 52 D3 C2 s.........g.`R..
0170 2D -
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
7F 4E 81 E2 5F 29 01 00 42 0D 44 45 Certificate Body
54 45 53 54 44 …
… 03 02 04 5F 24 06
01 00 00 04 02 04
5F 37 81 80 8C B1 61 26 A1 FD BB 82 Signature
48 C8 8B DB …
… E3 9C C6 C2 E4 67
1E 60 52 D3 C2 2D
R-APDU
SW 90 00 Normal operation
Extract the following relevant information from EF.CardAccess. In EF.CardAccess there are two
key references for CA defined: 01 and 02. Both use 1024-bit MODP Group with 160-bit Prime
Order Subgroup (00).
The terminal generates an ephemeral Diffie-Hellman key pair and sends the compressed ephemeral
public key to the chip.
DPICC 00
DH 0000 A2 83 09 47 A6 FC AA CD E2 FC B8 8B 29 AB 38 E0 ...G........).8.
Ephemeral 0010 7C 34 53 AB C4 BC B4 66 08 7E 11 C7 9F 32 A1 9E |4S....f.~...2..
0020 6E F2 2B E1 08 F8 DD 18 FE 82 49 C9 60 95 15 11 n.+.......I.`...
public key 0030 20 0D C9 85 AA 3E C0 CC AD 59 A5 F9 BB CC 33 EE ....>...Y....3.
PK PCD 0040 5F 15 77 E2 03 30 B4 DD 10 EB 06 B7 40 27 7C 97 _.w..0......@'|.
0050 A1 89 18 0E DE 52 BE E9 D4 29 F1 0F B7 7F 18 0F .....R...)......
0060 05 D6 A9 9C 49 9C B5 E1 EC EE B8 E9 22 84 F6 6E ....I......."..n
0070 A9 84 79 67 4C E7 3F 53 C5 67 A0 3B 0D 29 78 33 ..ygL.?S.g.;.)x3
DH 0000 00 A2 CF FD 06 C3 4A FD 62 2E EE 0F C3 1F 09 3F ......J.b......?
Ephemeral 0010 DF DA 60 9C 67 12 1C AC F0 A8 F5 22 91 DE 68 53 ..`.g......"..hS
0020 BB 5C 93 CF 76 70 57 75 EC F4 08 A7 43 02 61 3B .\..vpWu....C.a;
private key 0030 EE CB 38 14 47 D3 64 94 C9 E1 89 51 EC 17 25 2D ..8.G.d....Q..%-
SK PCD 0040 D2 A8 07 AA E0 9F A4 DC 30 18 33 39 01 3D 9C 91 ........0.39.=..
0050 91 30 3C AC EE 3C 91 E9 26 A3 6D 01 4A 5C FA 94 .0<..<..&.m.J\..
0060 95 0C AD B3 7B 53 4F 32 A9 BF 76 B3 79 80 97 93 ....{SO2..v.y...
0070 04 C5 66 38 71 BD 74 6E B9 E9 5A 47 CA 47 1B 4E ..f8q.tn..ZG.G.N
0080 DE .
CHR 44 45 54 45 53 54 41 54 44 45 30 31 39
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
80 0A 04 00 7F 00 07 02 02 02 Cryptograhic mechanism
01 01 reference, OID
R-APDU
SW 90 00 Normal operation
The chip is randomly chosing a rPICC and this rPICC is queried by the terminal.
rPICC FC 21 0C 17 4A 80 1D 46
T→C 0000 00 84 00 00 08
plain
plain
C-APDU
CLA 00 / 0C Plain, SM
P1/P2 00 00 -
R-APDU
FC 21 0C 17 4A 80 1D 46 8 bytes of randomness
SW 90 00 Normal operation
The data to be signed is constructed of the key, the challenge and the hash. The resulting signature
is used in the command EXTERNAL AUTHENTICATE. The defined algorithm here is RSA v1.5
with SHA-1.
(rPICC)
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
SW 90 00 Normal operation
UTF8-STRING SIZE( 9 )
0000 48 4A 50 20 50 42 20 44 53 HJP PB DS
SEQUENCE SIZE( 290 )
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 1 }
NULL SIZE( 0 )
BIT-STRING SIZE( 271 )
0000 00 30 82 01 0A 02 82 01 01 00 B6 C5 A8 EE 57 30 .0............W0
0010 76 79 E3 64 E3 F7 E7 76 EA 64 07 4E 9A 72 F6 B3 vy.d...v.d.N.r..
0020 76 C2 D2 31 89 63 1C 10 BA 65 EA 34 6F EF 70 3B v..1.c...e.4o.p;
0030 52 EF 75 93 D4 96 E1 50 0F 71 64 D0 38 E9 A8 80 R.u....P.qd.8...
0040 D0 6E 90 FC F9 6F AD 5B 60 68 B3 42 CC A8 24 77 .n...o.[`h.B..$w
0050 0B AD F1 42 9E BB DB 97 88 0A AE A4 31 14 62 CA ...B........1.b.
0060 CE 40 AA F2 24 78 35 AB C2 59 1E 18 80 AD D9 FD .@..$x5..Y......
0070 35 F2 C0 E4 3C C6 FE B9 1B 0F 13 7C C4 2A D8 34 5...<......|.*.4
0080 73 24 93 FD 63 F7 8F C7 DA 75 CD B4 A1 BD 4C 7D s$..c....u....L}
0090 E1 E0 4A C1 B4 BD 4C 62 C4 6F 8D 83 EE 6B F1 AC ..J...Lb.o...k..
00A0 24 05 D5 A1 73 77 6A 58 96 0A 79 B1 B5 B9 0B 79 $...swjX..y....y
00B0 7A 4A 7A 19 84 57 C7 A0 2A 72 A2 FF 9A 32 7E 55 zJz..W..*r...2~U
00C0 88 19 67 42 C5 7C 8B 9D 5E E6 4B 8A 46 00 3B C5 ..gB.|..^.K.F.;.
00D0 6D 24 93 C0 A6 58 82 37 94 AB 23 14 BC F9 79 C5 m$...X.7..#...y.
00E0 EE DF 32 7C 6C 11 2E 9E DD 86 C6 E4 19 F9 AD 35 ..2|l..........5
00F0 A9 46 56 FD E7 ED 89 6A F5 C3 46 43 5A B3 D7 BE .FV....j..FCZ...
0100 C0 F8 B9 02 56 A3 10 50 B3 97 02 03 01 00 01 ....V..P.......
A3 [ CONTEXT 3 ] IMPLICIT SEQUENCE SIZE( 82 )
SEQUENCE SIZE( 80 )
SEQUENCE SIZE( 31 )
OBJECT IDENTIFIER = { 2 5 29 35 }
OCTET-STRING SIZE( 24 )
0000 30 16 80 14 0D FD 5C 02 88 BF EC E0 B0 7A 5D 40 0.....\......z]@
0010 FF 80 AC 8A 91 74 3A 9B .....t:.
SEQUENCE SIZE( 29 )
OBJECT IDENTIFIER = { 2 5 29 14 }
OCTET-STRING SIZE( 22 )
0000 04 14 91 93 F4 F0 AA 4A CA C0 D3 A1 B6 AC 83 B2 .......J........
0010 4F 6F DC 8F F2 1B Oo....
SEQUENCE SIZE( 14 )
OBJECT IDENTIFIER = { 2 5 29 15 }
BOOLEAN SIZE( 1 )
0000 FF .
OCTET-STRING SIZE( 4 )
0000 03 02 07 80 ....
SEQUENCE SIZE( 65 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 10 }
SEQUENCE SIZE( 52 )
A0 [ CONTEXT 0 ] IMPLICIT SEQUENCE SIZE( 15 )
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A1 [ CONTEXT 1 ] IMPLICIT SEQUENCE SIZE( 28 )
SEQUENCE SIZE( 26 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 8 }
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A2 [ CONTEXT 2 ] IMPLICIT SEQUENCE SIZE( 3 )
INTEGER SIZE( 1 )
0000 20
NULL SIZE( 0 )
A0 [ CONTEXT 0 ] IMPLICIT SEQUENCE SIZE( 74 )
SEQUENCE SIZE( 23 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 9 3 }
SET SIZE( 10 )
OBJECT IDENTIFIER = { 0 4 0 127 0 7 3 2 1 }
SEQUENCE SIZE( 47 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 9 4 }
SET SIZE( 34 )
OCTET-STRING SIZE( 32 )
0000 5F 65 34 5D 29 A8 5A 01 BB 38 AE A4 EB D6 C9 8E _e4]).Z..8......
0010 7E CE 6F 9F 0F F4 6A F2 FD D0 7B DC 18 BA 6F 38 ~.o...j...{...o8
SEQUENCE SIZE( 65 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 10 }
SEQUENCE SIZE( 52 )
A0 [ CONTEXT 0 ] IMPLICIT SEQUENCE SIZE( 15 )
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A1 [ CONTEXT 1 ] IMPLICIT SEQUENCE SIZE( 28 )
SEQUENCE SIZE( 26 )
OBJECT IDENTIFIER = { 1 2 840 113549 1 1 8 }
SEQUENCE SIZE( 13 )
OBJECT IDENTIFIER = { 2 16 840 1 101 3 4 2 1 }
NULL SIZE( 0 )
A2 [ CONTEXT 2 ] IMPLICIT SEQUENCE SIZE( 3 )
INTEGER SIZE( 1 )
0000 20
OCTET-STRING SIZE( 256 )
0000 3B CE 96 95 4D 09 8B D4 C6 CC D6 9D D2 EB 73 DD ;...M.........s.
0010 58 85 A4 12 F5 9F 48 93 B4 C1 6F 4F 15 2C 5A 7F X.....H...oO.,Z.
0020 62 08 24 DA 91 85 FC 23 6F 3B 72 01 8F 77 59 AD b.$....#o;r..wY.
0030 BD D1 66 C1 16 AB 5D 4D E5 4C 89 43 68 0A D9 77 ..f...]M.L.Ch..w
0040 4D 4B 31 02 8D 6E 3F A4 11 73 5B ED 1E 73 E9 9F MK1..n?..s[..s..
0050 9C 5A 25 5B B0 3E F6 94 59 B4 B3 BB A9 58 D3 0D .Z%[.>..Y....X..
0060 0F F5 C9 FE 0A 0F CB 09 6F 8D 41 CA B1 D8 FB 0E ........o.A.....
0070 A6 15 3F 01 E2 A4 2B 7F E6 B2 30 4D 96 27 E7 30 ..?...+...0M.'.0
0080 C6 3F 9B CB AB 0A 44 5D E9 DC DA E1 F8 E9 C2 76 .?....D].......v
0090 35 41 0F 49 C8 EB 45 FA B2 5F 55 C0 5A 78 58 82 5A.I..E.._U.ZxX.
00A0 03 44 25 46 96 16 FC B7 86 EC BD 7C 92 93 0F 2E .D%F.......|....
00B0 2D AE A9 8E F8 55 73 23 98 78 51 3E 4F 9A CD 89 -....Us#.xQ>O...
00C0 75 31 F5 5E 3E 15 8D 61 81 5B 48 75 D1 D7 6E 0E u1.^>..a.[Hu..n.
00D0 E6 38 0D 57 6C F5 CF 8F 2F 0A 8E EC B6 CB 51 34 .8.Wl.../.....Q4
00E0 AA 89 44 1A 4B 87 58 91 AE 22 81 1B 90 49 45 F8 ..D.K.X.."...IE.
00F0 4C 53 FC 0E 9B A6 42 93 33 1F 31 5D A9 68 D8 B8 LS....B.3.1].h..
0070 64 59 D8 6D BF 85 EA F9 ED BD 96 2C D3 64 F7 B8 dY.m.......,.d..
CA OID 0.4.0.127.0.7.2.2.3.1.2
In the first step the following information extracted from EF.ChipSecurity are important.
CA OID 0.4.0.127.0.7.2.2.3.1.2
Key 01
Refference
In the first step of Chip Authentication the terminal sends its OID for CA and the reference of the
private key to the chip with the command MSE:Set AT as following.
T→C 0000 00 22 41 A4 0F 80 0A 04 00 7F 00 07 02 02 03 01 ."A.............
0010 02 84 01 01 ....
plain
coded
C→T 0000 90 00
plain
C-APDU
CLA 00 / 0C Plain, SM
80 0A 04 00 7F 00 07 02 02 03 Cryptograhic mechanism
01 02 reference, OID
R-APDU
SW 90 00 Normal operation
C-APDU
CLA 00 / 0C Plain, SM
R-APDU
81 08 1A 1A C1 AB 04 D9 69 65 rPICC
82 08 75 68 91 58 0F 70 16 4D TPICC
SW 90 00 Normal operation
Both the terminal and the chip calculate the shared secret K.
PICC:
SKPICC 0000 00 D0 E5 A9 5E CA 54 1D EF 4F E9 2B 9F F9 92 0D ....^.T..O.+....
0010 49 A4 54 C2 97 I.T..
PK PCD 0000 A2 83 09 47 A6 FC AA CD E2 FC B8 8B 29 AB 38 E0 ...G........).8.
0010 7C 34 53 AB C4 BC B4 66 08 7E 11 C7 9F 32 A1 9E |4S....f.~...2..
0020 6E F2 2B E1 08 F8 DD 18 FE 82 49 C9 60 95 15 11 n.+.......I.`...
0030 20 0D C9 85 AA 3E C0 CC AD 59 A5 F9 BB CC 33 EE ....>...Y....3.
0040 5F 15 77 E2 03 30 B4 DD 10 EB 06 B7 40 27 7C 97 _.w..0......@'|.
0050 A1 89 18 0E DE 52 BE E9 D4 29 F1 0F B7 7F 18 0F .....R...)......
0060 05 D6 A9 9C 49 9C B5 E1 EC EE B8 E9 22 84 F6 6E ....I......."..n
0070 A9 84 79 67 4C E7 3F 53 C5 67 A0 3B 0D 29 78 33 ..ygL.?S.g.;.)x3
DPICC 00
PCD:
SK PCD 0000 00 A2 CF FD 06 C3 4A FD 62 2E EE 0F C3 1F 09 3F ......J.b......?
0010 DF DA 60 9C 67 12 1C AC F0 A8 F5 22 91 DE 68 53 ..`.g......"..hS
0020 BB 5C 93 CF 76 70 57 75 EC F4 08 A7 43 02 61 3B .\..vpWu....C.a;
0030 EE CB 38 14 47 D3 64 94 C9 E1 89 51 EC 17 25 2D ..8.G.d....Q..%-
0040 D2 A8 07 AA E0 9F A4 DC 30 18 33 39 01 3D 9C 91 ........0.39.=..
0050 91 30 3C AC EE 3C 91 E9 26 A3 6D 01 4A 5C FA 94 .0<..<..&.m.J\..
0060 95 0C AD B3 7B 53 4F 32 A9 BF 76 B3 79 80 97 93 ....{SO2..v.y...
0070 04 C5 66 38 71 BD 74 6E B9 E9 5A 47 CA 47 1B 4E ..f8q.tn..ZG.G.N
0080 DE .
DPICC 00
PK PCD 0000 A2 83 09 47 A6 FC AA CD E2 FC B8 8B 29 AB 38 E0 ...G........).8.
0010 7C 34 53 AB C4 BC B4 66 08 7E 11 C7 9F 32 A1 9E |4S....f.~...2..
0020 6E F2 2B E1 08 F8 DD 18 FE 82 49 C9 60 95 15 11 n.+.......I.`...
0030 20 0D C9 85 AA 3E C0 CC AD 59 A5 F9 BB CC 33 EE ....>...Y....3.
0040 5F 15 77 E2 03 30 B4 DD 10 EB 06 B7 40 27 7C 97 _.w..0......@'|.
0050 A1 89 18 0E DE 52 BE E9 D4 29 F1 0F B7 7F 18 0F .....R...)......
0060 05 D6 A9 9C 49 9C B5 E1 EC EE B8 E9 22 84 F6 6E ....I......."..n
0070 A9 84 79 67 4C E7 3F 53 C5 67 A0 3B 0D 29 78 33 ..ygL.?S.g.;.)x3
TPCD 75 68 91 58 0F 70 16 4D
The authentication token TPCD computed by the terminal is equal to the authentication TPICC returned
by the PICC in the previous command above. This means Chip Authentication has performed
successfully.
The new session keys (AES 128) are derived from the shared secret by means of KDF specified in
[TR-03110].
With an established Chip Authentication and the new session keys the data of the chip application
can be read.
Annex
Revision history
References
TR-03110: BSI: TR-03110 Advanced Security Mechanisms for Machine Readable Travel
Documents – Extended Access Control (EAC), Password Authenticated
Connection Establishment (PACE), and Restricted Identification (RI), Version
2.0.5
Doc9303: IACO: ICAO Doc9303 Part I Volume I, Sixth Edition, ICAO 2006
TR-03105: BSI: TR-03105 Conformity Tests for Official Electronic ID Documents
RFC5114: M. Lepinski, S. Kent, RFC 5114: Additional Diffie-Hellman Groups with IETF
Standards, 2008