GrcardSIM » History » Version 5
tsaitgaist, 02/19/2016 10:47 PM
ADM0 & create file P2=04 added
1 | 1 | laforge | [[PageOutline]] |
---|---|---|---|
2 | 1 | laforge | = GRcard SIM = |
3 | 1 | laforge | |
4 | 1 | laforge | The GRcard SIM is a programmable GSM SIM card. |
5 | 1 | laforge | |
6 | 1 | laforge | It uses a mixture of TS11.11 / ISO7816-4 and proprietary commands for programming |
7 | 1 | laforge | |
8 | 3 | laforge | There is limited card programming support both in http://cgit.osmocom.org/cgit/pysim/ as well as the more interactive http://cgit.osmocom.org/cgit/cyberflex-shell/ |
9 | 3 | laforge | |
10 | 1 | laforge | == Command reference == |
11 | 1 | laforge | |
12 | 1 | laforge | To understand this reference, it is assumed that you are familiar with basic knowledge on smartcard |
13 | 1 | laforge | technologies, such as standard ISO 7816-3/-4 APDUs and GSM TS 11.11. |
14 | 1 | laforge | |
15 | 1 | laforge | === Setting the ICCID === |
16 | 1 | laforge | |
17 | 1 | laforge | Uses a standard UPDATE BINARY (D6) command on the EF.ICCID (2FE2) |
18 | 1 | laforge | |
19 | 1 | laforge | Security: ADM2 |
20 | 1 | laforge | |
21 | 1 | laforge | === Setting the IMSI === |
22 | 1 | laforge | |
23 | 1 | laforge | Uses a standard UPDATE BINARY (D6) command on the EF.IMSI (7F20/6F07) |
24 | 1 | laforge | |
25 | 1 | laforge | Security: ADM2 |
26 | 1 | laforge | |
27 | 1 | laforge | === Setting the Access Class === |
28 | 1 | laforge | |
29 | 1 | laforge | Uses a standard UPDATE BINARY (D6) command on the EF.ACC (7F20/6F78) |
30 | 1 | laforge | |
31 | 1 | laforge | Security: ADM2 |
32 | 1 | laforge | |
33 | 1 | laforge | === Setting the SMS Parameters === |
34 | 1 | laforge | |
35 | 1 | laforge | Uses a standard UPDATE RECORD (DC) command on the EF.SMS (7F10/6F42) |
36 | 1 | laforge | |
37 | 1 | laforge | Security: ADM2 |
38 | 1 | laforge | |
39 | 1 | laforge | === Setting the A3/A8 algorithm === |
40 | 1 | laforge | |
41 | 1 | laforge | Uses a standard UPDATE RECORD (DC) command on the non-standard (2700/6F70) EF |
42 | 1 | laforge | |
43 | 1 | laforge | The record has a size of 1 byte and is defined as follows: |
44 | 1 | laforge | * 01 - COMP128v1 |
45 | 1 | laforge | * 02 - COMP128v2 |
46 | 1 | laforge | * 03 - COMP128v3 |
47 | 1 | laforge | |
48 | 1 | laforge | Security: ADM2 |
49 | 1 | laforge | |
50 | 1 | laforge | === Setting the Ki === |
51 | 1 | laforge | |
52 | 1 | laforge | Uses a non-standard APDU {{{80 D4 02 00 10}}}, followed by 16 bytes of Ki |
53 | 1 | laforge | |
54 | 1 | laforge | Security: Unknown |
55 | 1 | laforge | |
56 | 1 | laforge | === Setting the PIN1 and PUK1 === |
57 | 1 | laforge | |
58 | 1 | laforge | Uses a non-standard APDU {{{80 D4 00 01 10}}} followed by 8 bytes of PIN1 and 8 bytes of PUK1 |
59 | 1 | laforge | |
60 | 1 | laforge | === Setting the PIN2 and PUK2 === |
61 | 1 | laforge | |
62 | 1 | laforge | Uses a non-standard APDU {{{80 D4 00 02 10}}} followed by 8 bytes of PIN1 and 8 bytes of PUK1 |
63 | 1 | laforge | |
64 | 1 | laforge | === Setting the ADM1 + AUK1 === |
65 | 1 | laforge | |
66 | 1 | laforge | Uses a non-standard APDU {{{80 D4 01 04 12 03 00}}} followed by 8 bytes of ADM1 and 8 bytes of AUK1 |
67 | 1 | laforge | |
68 | 1 | laforge | === Setting the ADM2 + AUK2 === |
69 | 1 | laforge | |
70 | 1 | laforge | Uses a non-standard APDU {{{80 D4 01 05 12 03 00}}} followed by 8 bytes of ADM2 and 8 bytes of AUK2 |
71 | 1 | laforge | |
72 | 1 | laforge | === Create File === |
73 | 1 | laforge | |
74 | 4 | tsaitgaist | Uses a non-standard APDU {{{80 CF 00 P2 LEN FID SIZE OPT1 ACC OPT2}}}, specified as follows: |
75 | 1 | laforge | |
76 | 1 | laforge | * Parameter P2: |
77 | 1 | laforge | * 00: Create DF |
78 | 1 | laforge | * 01: Create linear record EF |
79 | 1 | laforge | * 02: Create transparent EF |
80 | 1 | laforge | * 03: Create cyclic record EF |
81 | 5 | tsaitgaist | * 04: used to create EF.0001 with size {{0A20}} |
82 | 1 | laforge | * FID: The 2 byte File ID |
83 | 1 | laforge | * OPT1: Always {{{0100}}} |
84 | 2 | laforge | * ACC: Access conditions (3 bytes), According to TS 11.11, Section 9.3 |
85 | 1 | laforge | * OPT2: Always {{{FF}}} |
86 | 1 | laforge | |
87 | 5 | tsaitgaist | In case a Directory or EF.0001 is created, OPT1, ACC and OPT2 are replaced with 8-bytes all-zero {{{00000000000000}}} |
88 | 1 | laforge | |
89 | 5 | tsaitgaist | Security: ADM0 |
90 | 5 | tsaitgaist | |
91 | 4 | tsaitgaist | === Erase Card === |
92 | 4 | tsaitgaist | |
93 | 1 | laforge | Uses a non-standard APDU {{{80FE000014 31323334353600001301FF0000000000000000EA}}} |
94 | 5 | tsaitgaist | |
95 | 5 | tsaitgaist | Security: none |
96 | 5 | tsaitgaist | |
97 | 5 | tsaitgaist | === Authenticate as ADM0 === |
98 | 5 | tsaitgaist | |
99 | 5 | tsaitgaist | Uses a non-standard APDU {{{80 F6 00 00 08 PIN}}}, where per default PIN is {{{0000000000000000}}} |