GSM security goals and analog 1G limitations
Early analog 1G networks transmitted calls as unencrypted radio signals. A basic scanner could receive a private call, and a fraudster could clone a phone's identity and charge calls to another subscriber. This lack of protection was a basic weakness of those systems: it offered neither call privacy nor reliable subscriber identification.
GSM designers recognized that an international digital standard needed to build user trust. Security became part of the architecture, and GSM mechanisms were designed around three primary goals:
- Authentication: To prove that the user is a legitimate subscriber and has the right to access the network. This prevents unauthorized use and phone cloning.
- Confidentiality: To ensure that conversations and data transmitted over the airwaves are kept private and cannot be eavesdropped on by unauthorized parties.
- Anonymity:To protect the user's identity, preventing them from being easily tracked by monitoring radio transmissions.
The Core Mechanisms of GSM Security
The GSM security framework rests on the interaction of three mechanisms: a secret key stored on the SIM card, a family of cryptographic algorithms, and a challenge-response procedure.
- The Secret Subscriber Key : This is a 128-bit secret number unique to each subscriber. One copy of is securely stored in the subscriber's , and a second copy is stored in a highly protected database on the network side, called the Authentication Center (AuC). This key is the basis for authentication and ciphering, and the design keeps it off the radio network.
- Cryptographic algorithm families (A3, A8, A5): GSM uses cryptographic functions with distinct roles. The concrete A3, A8, and A5 implementations depend on the agreed version and operator configuration.
- : the subscriber authentication function.
- : the function for generating the session ciphering key.
- : a family of algorithms for ciphering radio data and signalling.
- Challenge-Response Mechanism: Instead of sending a password over the air, which could be intercepted, GSM uses a "challenge-response" procedure. The network sends the phone a random, unpredictable "challenge," and the phone must provide the correct "response." Only a device possessing the secret key, , can calculate the correct response to the challenge.
Analysis 1: Authentication - "Are You a Legitimate Subscriber?"
The authentication process is the first security check a phone must pass before it's allowed to make or receive calls. Its purpose is to verify that the SIM card is genuine and belongs to an authorised subscriber.
The procedure unfolds as follows:
- The Challenge: The network's Authentication Center (AuC) prepares an authentication vector containing a 128-bit random number called the , the expected SRES, and the key. The VLR or MSC selects RAND from that vector and sends it over the air to the Mobile Station (MS).
- Computation on Both Sides: The phone computes a response to the received RAND, while the network uses the value calculated earlier by the AuC:
- On the Phone Side (SIM): The SIM card receives the RAND from the network. It takes this RAND and its own secret, securely stored subscriber key, , and feeds them both into the authentication algorithm, . The algorithm processes these two inputs and produces a 32-bit output called the Signed Response, or .
- On the Network Side (AuC and VLR/MSC): The AuC computes the expected SRES from and the subscriber's , then sends the RAND/SRES pair and to the VLR or MSC. The VLR or MSC stores the expected SRES for comparison with the MS response.
- The Response: The Mobile Station sends its calculated SRES back to the network.
- The Verification: The VLR or Mobile Switching Center (MSC) now has two SRES values: the one it received from the phone and the one previously supplied by the AuC. It compares them.
- If the two SRES values match perfectly, the authentication is successful. The network accepts the response as matching the subscriber because only the genuine SIM card with the correct could have produced the correct response to the random challenge.
- If the SRES values do not match, the authentication fails, and the network denies the user access, preventing fraud.
Analysis 2: Confidentiality - Generating and Using the Encryption Key
Once the user's identity is verified, the next step is to secure the actual conversation. GSM protects the confidentiality of voice and data by encrypting the radio link between the mobile phone and the base station. This prevents anyone from listening in with a scanner. The key to this process is creating a temporary ciphering key for the session.
GSM reuses the same inputs in both security functions. It does not need a separate challenge-response process to create the encryption key. During authentication, the SIM computes locally, while the AuC computes the corresponding value for the vector sent to the VLR or MSC:
The SIM and AuC both take the same 128-bit and the same 128-bit secret key and feed them into the algorithm. The output of A8 is a 64-bit temporary key known as the . The SIM computes it locally, while the AuC places the corresponding value in the vector sent to the VLR or MSC. The key is never transmitted over the air. The network sends a "Ciphering Mode Command" to the phone, and both sides then use the agreed .
With a shared secret key () established, both the phone and the base station can now encrypt their communications. They use an encryption algorithm called . GSM has several versions of this algorithm:
- : The original, historically relatively strong variant used in Europe and other parts of the world.
- : A historically weakened variant developed for export to regions where governments had concerns about strong encryption. Later cryptanalysis showed that it had a very small security margin.
- : A later, much stronger variant for GSM and ECSD, also used as a security upgrade in GSM networks.
- : This is the term for when no encryption is used at all.
The algorithm is a type of . A stream cipher processes data with a keystream.
- The algorithm takes the 64-bit Ciphering Key () and the 22-bit TDMA frame number (which is constantly changing) as inputs.
- It uses these inputs to generate a very long, seemingly random stream of bits called the keystream. Because both the phone and the BTS have the same and know the same frame number, they both generate the exact same keystream at the exact same time.
- To encrypt, the data to be sent (e.g., digitized voice) is combined with the keystream using a bitwise XOR operation.
- To decrypt, the received encrypted data is combined with the same keystream using XOR. Reapplying XOR with the same keystream returns the original data.
Analysis 3: Anonymity - Temporary Identifiers and Their Limits
The third security mechanism limits exposure of user identity. Continuously broadcasting a user's permanent identity (IMSI) over the air would make it easy to track that user's movements and activity. GSM limits this risk by using temporary identifiers.
When a phone registers in a new location area, the VLR assigns it a . This TMSI is a temporary alias that has meaning only within the current location area. From that point on, routine communications such as initiating a call or responding to a page identify the phone with the TMSI, keeping the permanent IMSI outside these messages. The TMSI is periodically changed by the network, making it very difficult for an outside observer to link radio transmissions to a specific individual over an extended period. The real IMSI remains a fallback identifier, used for example during first registration with a VLR or after loss of the TMSI context, so the mechanism does not provide complete anonymity.
Strengths and Weaknesses of GSM Security
For its era, GSM security provided protection far superior to earlier analogue cellular systems. As technology advanced and security analysis became more sophisticated, several weaknesses were identified.
- It successfully prevented casual eavesdropping and large-scale phone cloning.
- The use of the SIM card to separate user identity from the hardware was a major innovation.
- The challenge-response mechanism meant that the central secret key () was never exposed on the air interface.
- One-Way Authentication: The network authenticates the phone, while the phone does not authenticate the network. This is a critical flaw that enables attacks using (also known as Stingrays). A fake base station can trick a phone into connecting to it and then potentially force it to disable encryption or launch a man-in-the-middle attack.
- Weak Cryptography: The algorithm, relatively strong within the classic GSM set of the 1990s, is breakable with sufficient computational power. The algorithm was historically weakened and became vulnerable to practical cryptanalysis. With the right equipment, a determined attacker could potentially decrypt GSM calls.
- Encryption is Not End-to-End:GSM encryption protects the radio link between the phone and the base station. Once the signal reaches the BTS, it is decrypted and travels "in the clear" (unencrypted) through the operator's core network and the wider public telephone system. This leaves multiple possible interception points within the wired network.
- Limited Anonymity:While the use of TMSI is a significant improvement, the permanent IMSI can still be requested by the network under certain circumstances, briefly revealing the user's permanent identity.