SIM Key Material / multi-IMSI on eSIMs

Why is key material (Ki, OPc, etc) still stored in the GSM DF instead of USIM?

Which Card / CardOS are you referring to? 3GPP does not specify the location of authentication key material at all. It’s an implementation detail of the respective CardOS. It doesn’t even have to be a file. For sysmocom cards, it is definitely not stored in DF.GSM.

1 Like

My root consfusion is bigger then. The question is this: when I download a profile, does that profile use some common USIM application that’s already on the EUICC, or am I downloading a new USIM application embedded in the profile?
The reason I ask is my boss gave me a card that changes IMSIs when it feels like it, between a 999 IMSI and a public LTE IMSI, and it seems like it must change Ki and OPc when this happens. So it’s not the EUICC changing between profiles like normal, with an LPA or SGP32 magic, but the profile changing Ki/OPc and IMSI values. This means either (1) the profile has an applet that uses some standard way to change Ki and OPc or (2) the profile has its own specialized USIM ADF that stores multiple Ki and OPc values.

The USIM application is provided by the CardOS of the eUICC. You are downloading a profile consisting of

  • file contents in the filesystem
  • other data (like OTA keys, K, OPc)
  • optionally javacard applications

This is not really different on an eUICC from a classic UICC with CardOS-provided USIM application and your random vendors multi-IMSI Java Applet

case 1

1 Like

An for the record, since your original question was about DF.GSM: THat doesn’t exist on an eSIM profile. eSIM only handles USIM, not classic GSM SIM.

1 Like

Yes, my original question was from research I was doing on the second question, and actually it was a misunderstanding.

Is there a good description about case 1 somewheres? I mean, FileView.updateBinary (with the right install params) lets an applet change an EF, but I see no library for changing OPc. That should have been my original question I guess.

I think there’s a standard USIM API how custom code can implement the entire A3/A8 authentication procedure. Javacard is not my specific area of expertise, you’ll have to review the relevant 3GPP Specs yourself.

I would also assume that the most common case actually keeps K+OPc static and simply makes sure on the HLR/HSS side that all those IMSIs have the same key material stored. Or in many cases it’s actually not even real IMSIs but IMSI rewriting tricks by roaming hubs.

1 Like
  1. This is a typical X-Y problem, See https://xyproblem.info/

  2. You can think of eUICC technology as a virtualization of UICC.

3 Likes

Yes, okay fair enough. I stepped into the XY cowpie.

The problem is I wanted a single profile that includes two IMSIs, a roaming IMSI with key material for a roaming services EPC, and a 999 IMSI with key material for a private system. It needs to be downloadable as a single profile because downloading two profiles will be too complicated for their devices and too complicated to manage. It can’t be done with IPX magic because the two IMSIs tie to two different EPCs.

I think the answer is no. They can’t do this in a way that can be downloaded as a single esim profile. This is because multiple keys in one USIM is proprietary. They can do this with a UICC because in the UICC, the EUMs have IMSI- and key-flipping applets that are tightly coupled to their USIM. It could also be done with an eUICC and a custom profile preloaded, whis is maybe what theyll do. With a download profile, there is no standard way to do this and no commercial model even to brainstorm it.

However, I thrashed around a bit getting to NO including the X-Y post above.

1 Like

A probably final side note that a single eSIM profile can technically contain multiple instances of the USIM NAA. Each of those has it’s own AKA parameters (including OPc/K/…), filesystem (including EF.IMSI, …) - but I am somewhat doubtful if you find any commercial UE that can deal with that situation realistically.

1 Like

I have seen the GSM DF on some eSIM profiles, plus ISIM.

The existance of a DF.GSM does not make the eSIM profile compatible with GSM. You’d have to undestand the different CLA bytes (A0), different authentication algorithm, the RUN GSM ALGORITHM command, etc.

The entire eSIM system is not desigend to be compatible with classic 2G SIM. It is UICC/USIM/ISIM/CSIM only.

2 Likes