Project

General

Profile

Download (6.4 KB) Statistics
| Branch: | Revision:
1 65b41130 Oliver Smith
# Osmocom IMSI Pseudonymization Project
2
3
Specification and reference SIM applet implementation to conceal the IMSI of a
4
mobile subscriber on the radio interface in a 2G, 3G, 4G network.
5
6
Homepage: https://osmocom.org/projects/imsi-pseudo/wiki
7
8
## How it works
9
10 5e62dbac Oliver Smith
The first pseudo IMSI gets allocated in the HLR, as the SIM card is
11
provisioned. After that pseudo IMSI is used for the first time in location
12
update, the HLR waits for some time, then decides the next pseudo IMSI and
13
sends it together with a delay value as SMS to the SIM. The SIM applet receives
14
the SMS and waits the specified delay. Then it overwrites its current IMSI with
15
the new one, marks the TMSI as invalid, and initiates the next location update.
16
Afterwards, the process repeats.
17 5380e95a Oliver Smith
18 65b41130 Oliver Smith
```
19
HLR <-> SIM  LOCATION UPDATE, imsi_pseudo=200
20
(time passes)
21 5e62dbac Oliver Smith
HLR  -> SIM  NEW PSEUDO IMSI, imsi_pseudo=123, delay=60
22
(time passes until the SMS arrives)
23
(SIM applet waits 60 seconds)
24 65b41130 Oliver Smith
HLR <-> SIM  LOCATION UPDATE, imsi_pseudo=123
25
...
26
```
27
28 c4206534 Oliver Smith
## In detail
29 65b41130 Oliver Smith
30 0ee12879 Oliver Smith
### 1. Provisioning the SIM
31 65b41130 Oliver Smith
32 5e62dbac Oliver Smith
The HLR allocates a new pseudo IMSI as random choice from the pool of available
33
IMSIs. The pseudo IMSI must not be used by any other subscriber as pseudo IMSI,
34
but may be the real IMSI of another subscriber. The subscriber-specific counter
35
imsi_pseudo_i is 0 for the first allocated IMSI for that subscriber.
36 65b41130 Oliver Smith
37 5e62dbac Oliver Smith
|   id |   imsi |   imsi_pseudo | imsi_pseudo_i |
38
|------|--------|---------------|---------------|
39
|    1 |   100  |   200         | 0             |
40 65b41130 Oliver Smith
41 5e62dbac Oliver Smith
The pseudo IMSI is saved to the SIM as IMSI, instead of the real IMSI. The SIM
42
is also provisioned with the IMSI pseudonymization applet.
43 65b41130 Oliver Smith
44 0ee12879 Oliver Smith
### 2. Successful Location Update with pseudo IMSI
45 65b41130 Oliver Smith
46 5e62dbac Oliver Smith
a) If this was the first Location Update after provisioning the SIM, the
47
subscriber has only one pseudo IMSI allocated. The HLR waits for some time.
48
Then it allocates the next pseudo IMSI from the pool of available IMSIs (as in
49
1., but with imsi_pseudo_i increased by one). The HLR sends the new
50
pseudo IMSI, the imsi_pseudo_i and a random delay value in one SMS to the SIM.
51 65b41130 Oliver Smith
52 5e62dbac Oliver Smith
The random delay is how long the SIM applet should wait before changing the
53
IMSI. This delay prevents easy correlation of the arrival of the SMS with the
54
Location Update that will follow in 3. by the SIM. Due to other latencies in
55
the network, this is a minimum delay. At this point, the subscriber has two
56
allocated pseudo IMSIs:
57 65b41130 Oliver Smith
58 5e62dbac Oliver Smith
|   id |   imsi |   imsi_pseudo | imsi_pseudo_i |
59
|------|--------|---------------|---------------|
60
|    1 |   100  |   200         | 0             |
61
|    2 |   100  |   123         | 1             |
62 65b41130 Oliver Smith
63 5e62dbac Oliver Smith
b) If this was not the first Location Update after provisioning a new SIM, the
64
subscriber already has two pseudo IMSIs allocated when doing the Location
65
Update. The HLR compares imsi_pseudo_i to find out if the Location Update was
66
done with the newer or older pseudo IMSI.
67 65b41130 Oliver Smith
68 5e62dbac Oliver Smith
If the older pseudo IMSI was used, then the SIM applet was not able to set the
69
new IMSI. This may be caused by an SMS arriving late, possibly even months
70
after it was sent in case the UE was without power for a long period of time.
71
Therefore the HLR cannot deallocate the newer pseudo IMSI without risking that
72
the SIM would configure that IMSI and then be locked out (unable to do any
73
further location updates). Instead, the HLR proceeds like in a), but sends the
74
same unused new pseudo IMSI again instead of allocating a new one.
75 65b41130 Oliver Smith
76 5e62dbac Oliver Smith
If the newer pseudo IMSI was used, the SIM applet has successfully set the new
77
IMSI. The HLR deallocates the old pseudo IMSI and sends a Purge MS request to
78
the VLR with the old pseudo IMSI. Then the HLR proceeds like in a).
79 65b41130 Oliver Smith
80 0ee12879 Oliver Smith
### 3. Arrival of the SMS
81 65b41130 Oliver Smith
82 5e62dbac Oliver Smith
The SIM applet verifies, that imsi_pseudo_i is higher than the last
83
imsi_pseudo_i it has seen (initially: 0). If that is not the case, it discards
84
the message.
85 65b41130 Oliver Smith
86 5e62dbac Oliver Smith
The SIM applet registers a timer to wait the specified delay. When the timer
87
expires, the applet updates the last imsi_pseudo_i value that it has seen. Then
88
it overwrites the IMSI with the next pseudo IMSI and invalidates the TMSI and
89
Kc. The applet triggers a refresh, which causes the SIM to do a new Location
90
Update with the new IMSI.
91 65b41130 Oliver Smith
92 c4206534 Oliver Smith
## Notes
93
94 5e62dbac Oliver Smith
### What if the SMS gets lost?
95 65b41130 Oliver Smith
96
Both the old and the new pseudo IMSI entry exist in the HLR.
97
98 5e62dbac Oliver Smith
The SIM will use the old pseudo IMSI in the next Location Update. The HLR will
99
try to send _the same_ new pseudo IMSI with the same new imsi_pseudo_i, as soon
100
as the next Location Update is complete.
101 65b41130 Oliver Smith
102 5e62dbac Oliver Smith
### What if the SMS arrives late?
103 65b41130 Oliver Smith
104 5e62dbac Oliver Smith
The imsi_pseudo_i counter will not be higher than the value the SIM applet
105 65b41130 Oliver Smith
already knows. Therefore, the applet will discard the message.
106
107 0ee12879 Oliver Smith
### Warning the user if SMS don't arrive
108 65b41130 Oliver Smith
109 5e62dbac Oliver Smith
An attacker could possibly block the SMS from arriving at the SIM applet. In
110
that case, the SIM would continue using the old pseudo IMSI indefinitely.
111 65b41130 Oliver Smith
112 5e62dbac Oliver Smith
We can count the location updates done with the same pseudo IMSI in the SIM
113
applet, and warn the user if the same pseudo IMSI has been used more than N
114
(e.g. 5) times.
115 65b41130 Oliver Smith
116 0ee12879 Oliver Smith
### End2end encryption
117 65b41130 Oliver Smith
118
When deploying the IMSI pseudonymization, the operator should make sure that
119
the pseudo IMSI related SMS between the HLR and the SIM cannot be read or
120
modified by third parties. Otherwise, the next pseudonymous IMSI is leaked, and
121
in case of modifying the IMSI in the SMS, the SIM may be locked out of the
122
network.
123
124
OTA SMS are usually encrypted and authenticated (TS 03.48), with algorithms and
125
key lengths that the operator chooses (depending on the SIM and how it is
126
configured).
127
128
It was considered to add an additional layer of end2end encryption for the
129
pseudonymized IMSIs on top, but this is out-of-scope for this project. For
130 6d06adb8 Oliver Smith
reference, one could pre-provision a random "imsi_pseudo_key" with the SIM
131 65b41130 Oliver Smith
card, store it in the pseudo IMSI table in the HLR, and deploy a new encryption
132 5e62dbac Oliver Smith
key together with each new pseudo IMSI, attached to the SMS.
133 8c3bd0b4 Oliver Smith
134
### User-configurable minimum duration between IMSI changes
135
136
It may be desirable to let users configure their minimum duration between IMSI
137
changes. This allows people with a high privacy requirement to switch their
138
pseudonymous IMSI more often, and it allows the IMSI change to happen less
139
often if it is distracting to the user. The latter depends on the phone's
140
software, for example:
141
* A Samsung GT-I9100 Galaxy SII smartphone with Android 4.0.3 displays a
142
  message at the bottom of the screen for about 5 seconds, but the user
143
  interface remains usable.
144
* A Samsung GT-E1200 feature phone displays a waiting screen for 16 to 17
145
  seconds and is unusable during that time.
Add picture from clipboard (Maximum size: 48.8 MB)