OP (Operator Code) is a 128-bit code that each mobile operator selects for use in key generation algorithms in 3G and 4G networks. This code is not specific to any user, subscriber, or SIM, but rather remains the same for all subscribers of a particular operator (and sometimes differs from a SIM vendor to another). Therefore, it is not included as part of the input for key generation algorithms. The OP value is passed to an encryption algorithm (typically RijndaelEncrypt) to generate OPc (Operator Code variant), which is then used within the cryptographic functions (f1, f2, f3, f4, f5) to produce various keys.
Since the OP value is the same across all SIM cards of an operator (hypothetically), its exposure could potentially lead to security vulnerabilities, such as the spoofing of all SIMs. To mitigate this risk, operators provide OPc directly to the AuC (Authentication Center) or HLR/HSS (Home Location Register/Home Subscriber Server) instead of OP. When the cryptographic functions (f1, f2, etc.) are called, they use the pre-calculated OPc rather than generating it from OP, and importantly, it is impossible to reverse-engineer OP from OPc.
In essence, OPc is a key derived from both the OP and the SIM-specific secret key (Ki) using the RijndaelEncrypt algorithm. If an attacker were to obtain OPc, they would only be able to compromise a single SIM, not the entire operator’s network of SIMs.
OPc is calculated as: OPc = Encrypt-Algo(OP, Key) where OPc is a 128-bit value.
OP and A4 Storage
The values for OP and A4 are stored in two critical places: the HLR/HSS and the SIM. These values are exactly the same in both locations. Operators can either obtain these credentials from the HSS/HLR vendor, who provisions the subscriber information into the database, or from the SIM vendor, who infuses the authentication credentials directly into the SIM during manufacturing. Having the same values in both the HLR/HSS and SIM ensures consistent authentication across the network.
Transport Key (64-Bits)
The Transport Key is a 64-bit key used to encrypt both the secret key (Ki) and OPc before provisioning them to the AuC or HLR/HSS. When authentication credentials are provisioned, they are stored in encrypted form using the Transport Key. When these credentials are needed for generating authentication vectors, the Transport Key is used to decrypt the fields, reverting them to plain text before applying the f1, f2, f3, f4, and f5 algorithms for key generation.
The encryption of the plain key is represented as: Encrypted-Key = Encrypt-Algo(Plain-Key, Trans-Key)A standard algorithm, such as Milenage, is used to compute OPc, as specified in 3GPP standard 35.206.
General Procedure:
- Plain keys and OPc are embedded in the SIM during manufacturing.
- The vendor encrypts the Key and OPc with the Transport Key.
- The encrypted data is then sent to the operator’s AuC for provisioning.
- The AuC stores the encrypted credentials (or decrypts them before import).
- When an authentication request is received from the network, the AuC uses the Transport Key to decrypt the stored credentials before generating the authentication vectors.
