MODELING AND ANALYSIS OF MOBILE TELEPHONY PROTOCOLS

by

Chunyu Tang

A DISSERTATION

Submitted to the Faculty of the Stevens Institute of Technology in partial fulfillment of the requirements for the degree of

DOCTOR OF PHILOSOPHY

Chunyu Tang, Candidate ADVISORY COMMITTEE

David A. Naumann, Chairman Date

Yingying Chen Date

Daniel Duchamp Date

Susanne Wetzel Date

STEVENS INSTITUTE OF TECHNOLOGY Castle Point on Hudson Hoboken, NJ 07030 2013 c 2013, Chunyu Tang. All rights reserved. iii

MODELING AND ANALYSIS OF MOBILE TELEPHONY PROTOCOLS

ABSTRACT

The GSM (2G), UMTS (3G), and LTE (4G) mobile telephony protocols are all in active use, giving rise to a number of interoperation situations. This poses serious challenges in ensuring authentication and other security properties. Analyzing the security of all possible interoperation scenarios by hand is, at best, tedious under- taking. Model checking techniques provide an effective way to automatically find vulnerabilities in or to prove the security properties of security protocols. Although the specifications address the interoperation cases between GSM and UMTS and the switching and mapping of established security context between LTE and previous technologies, there is not a comprehensive specification of which are the possible interoperation cases. Nor is there comprehensive specification of the procedures to establish security context (authentication and short-term keys) in the various interoperation scenarios. We systematically enumerate the cases, classifying them as allowed, disallowed, or uncertain with rationale based on detailed analysis of the specifications. We identify the authentication and key agreement procedure for each of the possible cases. We formally model the pure GSM, UMTS, LTE authentication protocols, as well as all the interoperation scenarios; we analyze their security, in the symbolic model of , using the tool ProVerif. We find the previously known man- in-the-middle attack on GSM. For the interoperation scenarios, we find three kind of attacks: one is the false base station attack which is inherited from GSM; another attack is a similar false base station attack but with a 4G base station; the third one modifies the CMC message. Based on the proved and refuted properties, we compare the authenticity achieved in different scenarios, and we provide recommendations to improve the mobile telephony standards.

Author: Chunyu Tang Advisor: David A. Naumann Date: January 13, 2014 Department: Degree: Doctor of Philosophy iv

Acknowledgments

I am deeply grateful to my advisor, Professor David A. Naumann, for his teaching, supporting, and kindness. His enthusiasm for research and broad knowledge inspire me. He spent countless hours discussing my work, reading my papers, proposal, and dissertation, and criticizing my talks. This dissertation would not be possible without the insightful guidance of Professor Naumann. It was a great honor to work with him. I would also like to thank Professor Susanne Wetzel for the tremendous time and energy she invested into my research. This dissertation would not have existed without her detailed comments, endless patience, and valuable advice. I give my sincere thanks to the members of my Ph.D committee, Professor Daniel Duchamp and Professor Yingying Chen. Their valuable comments on my proposal and dissertation greatly enhanced and strengthened my work. I would also like to thank Professor Adriana Compagnoni for serving on my proposal committee and for her valuable comments on my work. I would like to thank Andrey Chudnov, Stan Rosenberg, and Ye Wu for their excellent comments and helpful discussion of my work. I thank the professors and students in our regular LSS meeting for sharing their helpful comments. I would like to thank my parents for their love, encouragement, and support. I am proud to be their son. Finally, I would like to thank my wonderful wife, Yan Zhuang, and my adorable son, Albert Tang. They keep my life with love. They shared all my exciting and disappointing moments over the years. v

Table of Contents

Abstract iii

Acknowledgments iv

List of Tables ix

List of Figures x

Index of Defined Terms xii

1 Introduction 1 1.1 Motivation and Goals1 1.2 Approach2 1.3 Thesis3 1.4 Contribution3 1.5 Outline4

2 Background on Security Protocol Analysis and Related Work 5 2.1 Informal Analysis Techniques and Prior Work for Mobile Telephony Protocols5 2.1.1 Conventional Analysis5 2.1.2 Prior Work6 2.2 Background on Formal Analysis7 2.2.1 Dolev-Yao (Symbolic) and Computational Model7 2.2.2 Events and Correspondence Assertion8 2.3 Comparative Overview of Formal Tools9 2.3.1 Formal Analysis Tools9 2.3.2 Scyther 11 2.3.3 AVISPA 12 2.4 ProVerif 14 2.4.1 Rationale for the choice of ProVerif 14 2.4.2 Specifying Protocols and Security Properties 14 2.4.3 Analysis Technique and Approximation 16 2.4.4 Applications 19 2.5 Prior Work on Formal Analysis of Mobile Telephony Protocols 19

3 Modeling and Analysis of GSM 21 3.1 Overview of GSM AKA 21 3.2 Modeling the GSM AKA 24 3.2.1 Design Choices 24 vi

3.2.2 GSM Model 28 3.3 Security Property Specifications and Findings 33

4 Modeling and Analysis of UMTS 37 4.1 Overview of UMTS AKA 37 4.2 Modeling the UMTS AKA 40 4.2.1 Design Choices 40 4.2.2 UMTS Model 40 4.3 Security Property Specifications and Findings 44

5 Modeling and Analysis of LTE 46 5.1 Overview of LTE AKA 46 5.2 Modeling the LTE AKA 50 5.2.1 Design Choices 50 5.2.2 LTE Model 51 5.3 Security Property Specifications and Findings 57

6 Comparative Authenticity 59 6.1 Authentication of the MS to the SN 59 6.1.1 GSM vs. UMTS 59 6.1.2 UMTS vs. LTE 60 6.2 Authentication of the SN to the MS 62 6.2.1 GSM vs. UMTS 62 6.2.2 UMTS vs. LTE 62 6.3 Summary 64

7 Establishing a Initial Security Context in Interoperation 66 7.1 System Components 66 7.2 Allowed Interoperation Cases 74 7.3 Disallowed Interoperation Cases 75 7.4 Uncertain Interoperation Cases 75

8 Modeling and Analysis of Interoperation Scenarios involving GSM and UMTS Procedures Only 77 8.1 Determining the Scenarios only involving GSM and UMTS Components 77 8.2 Scenario S4: A UMTS MS roams to an SN with a GSM BS and GSM MSC 79 8.2.1 Overview of the AKA Scenario 79 8.2.2 Modeling the AKA Scenario 80 8.2.3 Security Property Specifications and Findings 82 8.3 Scenario S5: A GSM MS roams to an SN with a UMTS BS and UMTS MSC 83 8.3.1 Overview of the AKA Scenario 83 vii

8.3.2 Modeling the AKA Scenario 84 8.3.3 Security Property Specifications and Findings 87 8.4 Scenario S6: A UMTS MS roams to an SN with a GSM BS and a UMTS MSC 87 8.4.1 Overview of the AKA Scenario 88 8.4.2 Modeling the AKA Scenario 88 8.4.3 Security Property Specifications and Findings 90

9 Modeling and Analysis of Scenarios involving LTE Procedures 93 9.1 Determining the Scenarios involving LTE Components 93 9.2 Scenario S7: LTE I k UMTS II–III k [optionally, LTE IV] k LTE V, conv(CK IK → KASME , MME) 98 9.2.1 Overview of the AKA Scenario 99 9.2.2 Modeling the AKA Scenario 99 9.2.3 Security Property Specifications and Findings 107 9.3 Scenario S8: LTE I’ k UMTS II–III k LTE IV–V, conv(CK IK nonces → KASME , MME) 108 9.3.1 Overview of the AKA Scenario 108 9.3.2 Modeling the AKA Scenario 108 9.3.3 Security Property Specifications and Findings 113 9.4 Scenario S9: GSM I k LTE II–III k [optionally, LTE IV] k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK 114 9.4.1 Overview of the AKA Scenario 114 9.4.2 Modeling the AKA Scenario 114 9.4.3 Security Property Specifications and Findings 121 9.5 Scenario S10: UMTS I k LTE II–III k [optionally, LTE IV] k UMTS IV, AV = 4G AV + CK + IK 122 9.5.1 Overview of the AKA Scenario 122 9.5.2 Modeling the AKA Scenario 123 9.5.3 Security Property Specifications and Findings 128

10 Summary of Findings 130 10.1 Secrecy and Integrity Properties 130 10.2 Authentication Properties 130 10.2.1 Authentication of the MS to the SN 131 10.2.2 Authentication of the SN to the MS 131 10.3 Attacks 133

11 Conclusion and Future Work 135

Appendix A 138

Bibliography 175 viii

Vita 183 ix

List of Tables

3.1 Analysis result of GSM model 34

4.1 Analysis result of UMTS model 45

5.1 Analysis result of LTE model 58

6.1 Types of authentication achieved by the pure AKAs 65 6.2 Parameters of the correspondence assertions used in the proved au- thentication properties 65

7.1 Legend used in Table 7.2 67 7.2 Classifying the 243 interoperation cases (legend explained in Table 7.1) 67

8.1 Reasons used for determining AKA scenarios (see Table 9.1 for full set) 78 8.2 Classifying the interoperation cases involving GSM and UMTS com- ponents only. (The reasons are in Table 8.1) 79 8.3 Analysis result of S4 model 83 8.4 Analysis result of S5 model 87 8.5 Analysis result of S6 model 91

9.1 Reasons used for determining AKA scenarios 94 9.2 Classifying the interoperation cases (for GSM, UMTS, and LTE) 95 9.3 Determining components of each scenario 99 9.4 Analysis result of S7 models 107 9.5 Analysis result of S8 model 113 9.6 Analysis result of S9 models 121 9.7 Analysis result of S10 models 129

10.1 Types of SN components authenticity achieved by the scenarios 133 10.2 Analysis results of authentication properties 134 x

List of Figures

1.1 Example of an interoperation case1

2.1 Term and Process Grammar 15

3.1 GSM architecture [94, 76] 22 3.2 GSM message sequence diagram [94, 76] 23 3.3 GSM diagram annotated in accord with our model. Compared to Fig- ure 3.2, our model omits TMSI/ID Request (messages numbered 2 and 3 in Figure 3.2), abstracts from the details of the SN, and adds a first message of data traffic 29

4.1 UMTS architecture [94, 76] 38 4.2 UMTS AKA [94, 76] 39 4.3 UMTS AKA (Figure 4.2) annotated in accord with our model 41

5.1 LTE architecture [94, 52] 47 5.2 LTE AKA 48 5.3 LTE I’ when the AKA starts with a TAU request 49 5.4 LTE AKA (Figure 5.2) annotated in accord with our model 52

6.1 Events used to specify the authentication of MS to SN in GSM and UMTS 60 6.2 Events used to specify the authentication of MS to SN in UMTS and LTE 61 6.3 Events used to specify the authentication of SN to MS in UMTS and LTE 63

8.1 UMTS subscriber roams into GSM network 80 8.2 UMTS subscriber roams into GSM network, annotated in accord with our model 81 8.3 GSM MS roams into UMTS network 84 8.4 GSM subscriber roams into UMTS network annotated in accord with our model 85 8.5 UMTS subscriber roams into mixed network [94, 76] 88 8.6 UMTS subscriber roams into mixed network annotated in accord with our model 89

9.1 AKA scenario S7 without LTE IV 100 9.2 AKA scenario S7 with LTE IV 100 xi

9.3 AKA scenario S7, version without LTE IV, annotated in accord with our model 101 9.4 AKA scenario S7, version with LTE IV, annotated in accord with our model 104 9.5 AKA scenario S8 109 9.6 AKA scenario S8 annotated in accord with our model 110 9.7 AKA scenario S9 without LTE IV 115 9.8 AKA scenario S9 with LTE IV 115 9.9 AKA scenario S9, version without LTE IV, annotated in accord with our model 116 9.10 AKA scenario S9, version with LTE IV, annotated in accord with our model 119 9.11 AKA scenario S10 without LTE IV 122 9.12 AKA scenario S10 with LTE IV 123 9.13 AKA scenario S10, version without LTE IV, annotated in accord with our model 124 9.14 AKA scenario S10, version with LTE IV, annotated in accord with our model 126 Index

3GPP, 1 RAU, 77 RNC, 37 AK, 37 RNS, 37 AKA, 2 RRC, 49 AMF, 37 AS, 46 SAE, 1 AuC, 21 SAT, 10 AUTN, 37 SIM, 21 SMC, 47 BDDs, 9 SN, 21 BSC, 21 SQN, 37 BSS, 21 BTS, 21 TAU, 47 TMSI, 21 CAP, 22 challenge-response authentication, 59 UMTS, 1 CK, 37 UP, 49 CMC, 23 use-based proved knowledge authentication, 62 use-based proved knowledge with SNid authenti- E-UTRAN, 46 cation, 63 eNB, 46 USIM, 37 EPS, 40 UTRAN, 37

FN, 21 VLR, 21 GSM, 1 handover, 1 HLR, 21 HN, 21 HSS, 66 idle mode mobility, 1 IK, 37 IMSI, 22 indirect use-based proved knowledge authentica- tion, 62

LTE, 1

MAC, 37 MCC, 26 ME, 21 MME, 46 MNC, 26 MS, 21 MSC, 21 MSIN, 26

NAS, 46

xii 1

Chapter 1 Introduction

Over the last several decades, mobile telephony has evolved greatly and mobile de- vices have become ubiquitous. The first generation (1G) technology, which was based on analog technologies, was introduced in the 1980s [10]. Roughly a decade later, the second generation (2G) technology, which used digital radio signals, was intro- duced. The Global System for Mobile Communications (GSM ) has been the main standard for 2G technology. The third generation (3G) technology Universal Mobile Telecommunications System (UMTS) was developed by the 3rd Generation Part- nership Project (3GPP) and was introduced at the beginning of the twenty-first century. Recently, 3GPP has developed the fourth generation (4G) technology, which is best known under the names System Architecture Evolution (SAE) and Long Term Evolution (LTE) [52]. Currently GSM, UMTS, and LTE are all in active use. This leads to interoperation cases such as shown in Figure 1.1 in which a 4G mobile device whose home network is 3G, roaming to a 2G serving network.

1.1 Motivation and Goals

There are over 6.8 billion mobile subscriptions worldwide [9]. With the rapid devel- opment of mobile telephony technologies and the pervasiveness of mobile communica- tions in our everyday lives, the security of mobile telephony technologies has become more and more important. Over the years, the security of the pure technologies and the interoperation between GSM and UMTS has been investigated thoroughly. How- ever, LTE brings a big challenge of studying the interoperation cases involving all the three technologies. The 3GPP specifications systematically specify the interoperation cases be- tween UMTS and GSM [1, 7]. The LTE specification [8] details the mechanisms for security context switching and mapping to facilitate idle mode mobility and handover1

1The term handover refers to mechanisms supporting mobility in the context of ongoing phone call or data exchange; idle mode mobility refers to mechanisms supporting mobility while no such

4G mobile station 2G serving network 3G home network (Verizon) (T-Mobile) (Verizon)

Figure 1.1: Example of an interoperation case 2

between LTE and the previous technologies. However, this applies to maintaining context during handover and idle mode mobility. The specification for LTE does not explicitly address establishing of an initial security context, which is established by an authentication procedure, for interoperation. In particular, to date there is no comprehensive enumeration of all interoperation cases and their respective proce- dures for Authentication and Key Agreement (AKA)2. Consequently, analyzing the security of all possible combinations of interoperation scenarios by hand is a tedious and unreliable undertaking. Model checking techniques provide an effective way to automatically find vulnerabilities in, or to prove the security properties of, security protocols. The goal of this work is to find attacks or give evidence for the security of mobile telephony AKAs, especially in LTE and the interoperation scenarios involving LTE components, by using automated security protocol analysis tools instead of using tedious ad hoc (pencil and paper) approaches.

1.2 Approach

Wireless networks are complex and possess different aspects of security including the security of the protocols, the cryptography systems, the application interfaces, the implementations, and the systems. Attacks can exploit any aspect. When analyzing the mobile telephony protocols and the interoperation scenarios, we focus on the AKAs, and we abstract from the cryptographic algorithms and other aspects of the system. The AKAs are crucial for the security of the technologies. Through the AKAs, the communicating parties aim to authenticate each other (except in GSM – only one-way authentication is expected in GSM AKA) and to establish the session keys, which are used in the future communications. Our analysis is based on the Dolev-Yao model ([50], see Section 2.2.1), which assumes perfect cryptography. We also assume the communication in the network side is secure. Specifically, the communication between the serving network and the home network and the communication between the core network and the base stations are assumed secure. Although the inside network protocols are specified by the standard, the operators may have different implementations. We choose ProVerif [27] to model and analyze the mobile telephony protocols. According to the comparison of several well-known protocol verifiers by Cremers et al. [43], ProVerif has good running time performance. It is a mature tool under active development. It has a significant user community and has been used for a number of security protocols. The modeling language is intuitive and expressive; it allows infinite state systems. The analysis technique has been formally defined and proven sound [27]. It allows checking an unbounded number of sessions. In case a property service is currently active. 2In some standards, the term AKA has more specific meaning and varying terminology is used, e.g., depending on whether authentication is mutual. 3

does not hold, the tool can generate attack traces; these can then be used to test actual implementations, although that is beyond the scope of this work.

1.3 Thesis

Symbolic analysis tools can effectively find attacks in, and show the security of, mobile telephony authentication protocol interactions in interoperation scenarios.

1.4 Contribution

The first contribution of this work is to provide new formal models for the GSM, UMTS, and LTE AKA scenarios in the symbolic (Dolev-Yao) model of cryptogra- phy. We provide a detailed discussion on rationale on design decisions for the models and their abstractions from the real protocols. Using ProVerif, the secrecy and au- thentication properties can be automatically checked, thus replacing tedious manual analysis. The second contribution of this dissertation is to systematically enumerate of all possible interoperation cases between GSM, UMTS, and LTE. We classify these cases as allowed, disallowed, or uncertain, with explicit rationale making detailed reference to the specifications. Of the 243 cases identified, 19 cases involve GSM and UMTS technologies only, and as such are fully treated by the UMTS specifica- tion [7]. For cases involving LTE components, an enumeration did not previously exist; it required extensive study of the lengthy specifications. Based on the compat- ibilities (explicitly specified in the specifications) between the components, 138 cases are clearly ruled out and 38 cases are clearly allowed. For the remaining 48 cases the specifications and documentation based on the specifications do not provide a clear indication whether these cases are allowed. For the 48 uncertain cases, we determine the conditions under which these cases could occur. As a third contribution of this dissertation, we identify the corresponding AKA scenario used to establish the initial security context for each allowed or uncertain case. It turns out that there are only 10 distinct AKA scenarios, including the pure GSM, pure UMTS, and pure LTE AKA scenarios which apply in some interoperation cases. Although the GSM/UMTS scenarios are described in the specifications, that is not the case for 86 roaming cases involving LTE. For three of those scenarios we identify two variations which are both consistent with the specifications and which have different authenticity properties. As a fourth contribution, we provide formal models for all the interoperation scenarios including variations. We provide a security analysis based on these models. The models are composed in a modular fashion from the blocks that comprise the basic protocol models for GSM, UMTS, and LTE. This will facilitate adding or modifying scenarios, in case of changes to the specifications or the conditions for the uncertain cases to occur. 4

As a fifth contribution, we compare the authenticity achieved by the AKA scenarios. We categorize the authenticity of the MS to the SN and the authenticity of the SN to the MS into four levels and identify the level of authenticity achieved by each scenario. We also summarize that which protocol blocks are critical to achieve the highest level of the authenticity.

1.5 Outline

The remainder of this dissertation is structured as follows: In Chapter 2, we introduce background on model checking as well as the Dolev-Yao attacker model and Woo- Lam correspondence assertions which are used to specify authentication and secrecy properties. We also review several tools which are used to formally analyze security protocols. We conclude the chapter by introducing the tool ProVerif, which is used in this work. The next three chapters deal with the three standards respectively. Chap- ter 3 describes the GSM AKA, our model of the protocol, and the analysis results. Section 3.2 provides rationale and guidelines for modeling that apply throughout the work. Chapter 4 provides an overview of the UMTS AKA and discusses our model and analysis results. Chapter 5 reviews the LTE AKA and presents our model and anal- ysis results. Chapter 6 compares the authenticity achieved by the three pure AKAs. Chapter 7 categorizes all possible interoperation cases into allowed, disallowed and uncertain based on the standards and other documentations. Chapter 8 describes the interoperation cases only involving GSM and UMTS components, and presents our models and findings. Chapter 9 describes the interoperation cases involving LTE components, and presents our models and findings. Chapter 10 summarizes the anal- ysis results of all the AKA scenarios. Chapter 11 concludes this work and suggests directions for the future work. An index of definitions is provided on page xii, as well as an appendix with all the models. 5

Chapter 2 Background on Security Protocol Analysis and Related Work

In this Chapter, we first review informal analysis techniques for security protocol analysis and prior results on analysis of mobile telephony protocols using the infor- mal analysis techniques (Section 2.1). We then provide background on formal analysis of security protocols (Section 2.2). To determine which tool to be used in this work, we review several tools which are used to formally analyze security protocols (Sec- tion 2.3). We introduce an automatic cryptographic protocol verifier called ProVerif, which is used in this work (Section 2.4). At the end, we highlight the prior work on formal analysis of mobile telephony protocols (Section 2.5).

2.1 Informal Analysis Techniques and Prior Work for Mobile Telephony Protocols

Section 2.1.1 introduces conventional analysis of security protocols by hand or by means of fuzz testing. Section 2.1.2 summarizes the prior work on analysis of mobile telephony protocols.

2.1.1 Conventional Analysis In current practice, protocol analysis commonly uses informal techniques, specifi- cally, manual protocol analysis and fuzz testing of security protocols. These informal analysis techniques are discussed in this section. In conventional analysis of security protocols, a protocol is described as a program or as a set of runs. The attacker is assumed to have various capabilities, for example, the attacker may have certain knowledge, and can intercept and inject messages. Typically, experts go through the possible runs of the protocol, and try to find scenarios which violate the expected security properties. Such manual protocol analysis is very time-consuming and tedious, even if the analyzed protocols are simple. By using such methods, it is difficult and problematic to analyze a protocol with multiple sessions and runs. This kind of analysis depends largely on the skills and knowledge of the experts. There is no guarantee that all attacks will be found. Fuzz testing [10] is another approach to discover security vulnerabilities in protocols. It works by mutating the normal traffic or generating and injecting attack scenarios [81, 80] in order to reveal unexpected behaviors such as security property violations or protocol system crashes. To accelerate the testing procedure, fault injection tools (e.g., DOCTOR [60], ORCHESTRA [48]) have been developed and applied in validating network communication protocols and distributed protocols. A benefit of fuzz testing is that it can find implementation flaws as well as protocol design flaws. A shortcoming is that it could be difficult to set up realistic tests for 6

interoperation and achieve reasonable coverage. It is not necessary to have access to the source code in protocol fuzz testing. However, fuzz testing of security protocols is usually conducted in an ad-hoc manner with input selected either randomly or manually. While it can find attacks, fuzz testing provides little assurance of their absence.

2.1.2 Prior Work This section highlights the prior work on analysis of mobile telephony protocols. Most of them have been analyzed informally. The ones using formal techniques will be discussed later in this chapter. The A5 family of cryptosystems used in GSM and UMTS has been studied extensively. Golic [56], Goldberg [57], Petrovic et al. [84], Barkan et al. [21], and Dunkelman et al. [51] find attacks on the GSM encryption algorithms. Ahmadian et al. [16] show attacks which exploit weakness of A5/2 to eavesdrop or impersonate a UMTS subscriber in a mixed network. Our work focus on protocol flaws rather than cryptographic weaknesses. Fox [53] finds the false base station attack on the GSM AKA due to the lack of authentication of the network. Meyer and Wetzel [76, 77] show that a man-in-the- middle attack can be performed on one of the cases of interoperation between GSM and UMTS. Meyer and Wetzel [78] also show the attacks on the handover between GSM and UMTS based on the GSM encryption and the man-in-the-middle attacks. Zhang and Fang [93] show that the UMTS AKA is vulnerable to a redirection attack, which is a variant of the false base station attack. Because the UMTS AKA does not include the network identity, the false base station can redirect the traffic to an unintended network. This attack could cause billing problem. They also show a network impersonation attack, in which the attacker requests the authentication vectors on behalf of an corrupted network and use these authentication vectors to impersonate another network. Han and Choi [59] demonstrate a threat against the LTE handover key man- agement, involving a compromised base station. The attack violates the forward key separation, and could compromise all the future keys between the victim and sub- sequent base stations. In the attack, the attacker controls a rogue base station and desynchronizes the fresh keying material in the targeted base station to force the user and the base station to compute the next session key based on the current session key and values about the physical layer information. Because the attacker can learn the next session key, the attacker can decipher the messages until the next AKA. Mobarhan et al. [79] evaluate the publically known attacks on GSM and UMTS (and the related technology GPRS), categorizing them in terms of secrecy, integrity, or authenticity properties. Possible security improvements are also discussed. Golde et al. [54] find and implement two attacks on the GSM paging procedure. The paging procedure is used by the network to locate the mobile stations to start the 7

establishment of incoming call service. The first attack is against a single subscriber. In the attack, the attacker sends out the paging response earlier than the victim, so that the network ignores the paging response from the victim. Following this denial of service attack, the attacker can also impersonate the victim if no authentication is performed by the network. The second attack has the same attack scenario, but is against a large number of subscribers in a geographic region. Two countermeasures are proposed to prevent the attacks. The first suggestion is to combine the challenge- response in the AKA with the paging procedure. The other countermeasure is that the network always authenticates the subscribers and the network maps all incoming paging responses to the correct service. Several other denial-of-service attacks have been found. Lee et al. [69] find a denial-of-service attack on UMTS. In the attack, the attacker triggers the mobile to constantly establish and release radio channels with the network to overload the serving network or cause denial-of-service due to congestion in the signal path. Khan et al. [66] describes the denial-of-service attacks on UMTS by modifying the unpro- tected messages in the UMTS AKA to cause authentication failure or by sending a large number of valid IMSIs to cause massive authentication data request to exhaust the bandwidth between the serving network and the home network. Kambourakis et al. [65] also identify similar denial-of-service attacks against UMTS by modifying the unprotected signaling messages transmitted before or during the UMTS AKA.

2.2 Background on Formal Analysis

In this section, we introduce two formal methods to analyze cryptographic protocols: the Dolev-Yao (symbolic) model and the computational model (Section 2.2.1). We also discuss the correspondence assertions which are used to formally specify authen- tication properties (Section 2.2.2).

2.2.1 Dolev-Yao (Symbolic) and Computational Model This section introduces the Dolev-Yao model and discusses what it means to “prove” a property with Dolev-Yao model. This section also introduces the computational model. Formal methods constitute an effective approach to the analysis of crypto- graphic protocols. There are two main approaches to the formal verification of cryp- tographic protocols. One approach, the so called Dolev-Yao or symbolic model, is introduced in the seminal paper by Dolev and Yao [50]. In the Dolev-Yao model the active attacker has complete control over the network. Thus, the attacker can inter- cept, block, remove, or replay any message sent by an honest principal. The attacker can also create new messages from his/her knowledge, and send these messages to the honest participants. The attacker is a legitimate user and can initiate a conversation with any other user. It is also assumed that the underlying cryptographic primitives 8

achieve perfect security. The attacker can encrypt and decrypt messages with known keys. However, if the attacker does not know the correct decryption key for a given ciphertext, then he/she cannot gain any information from the ciphertext. The perfect cryptography assumption allows that the cryptographic primitives can be represented as symbolic operations. When a property is proved in a Dolev-Yao model, it means if the protocol is accurately modeled at an abstract level, then there are no attacks at this abstract level. It could be that there are attacks on implementation features, or on cryptographic functions. Another approach is the computational modeling [55] (e.g. CryptoVerif [26] is an automatic protocol prover using the computational model; the tools EasyCrypt [22] helps automate game-based proofs.), which is based on complexity theory. In a computational model, messages are bitstrings and cryptographic operations are probabilistic algorithms on these bitstrings. The attacker in a computational model is a polynomial-time probabilistic Turing machine. A protocol or system is secure if the probability of breaking the protocol or system by the plolynomial-time attackers is very low. The proof of security is to reduce the security properties to computational hard problems. Abadi et al. [13] survey computational soundness theorems that relate the symbolic and computational models. An early survey of the application of formal methods is provided in [73].

2.2.2 Events and Correspondence Assertion This section introduces the correspondence assertions and the events used in the correspondence assertions. Woo and Lam [92] define a formal semantic model for authentication protocols that is based on two basic security properties, correspondence and secrecy. Informally, correspondence means that the execution of the different principals in an authentica- tion protocol proceeds in a locked-step fashion. When an authenticating principal fin- ishes his/her part of the protocol, the authenticated principal must have been present and participated in his/her part of the protocol. Secrecy requires that certain infor- mation should not be derivable by an attacker. To specify correspondence properties using correspondence assertions [58, 32], the processes representing the protocol are annotated with events, possibly with arguments that record nonces, keys and other relevant information. The events are used to mark important points reached by the principals and have no effect on the principals’ behaviors. Events are not visible to the attacker, nor can they be generated by the attacker. A protocol satisfies a non-injective correspondence assertion, in the form of event(e1(M)) event(e2(M)), if in all runs, and in the presence of the attacker, each execution of the event e1 with particular arguments M corresponds to an earlier event e2 with the same arguments. An injective correspondence assertion, in from of inj −event(e1(M)) inj−event(e2(M)), captures a one-to-one relationship. It requires that, for each occurrence of the event 9

e1 with the arguments M, there is a distinct earlier occurrence of the event e2 with the same arguments. It follows immediately that the number of occurrences of the event e1 is less than, or equal to, the number of occurrences of the event e2. Events can also be used to express conditional secrecy, which means that the secrecy holds under certain conditions. An example in mobile telephony pro- tocols is that if a principal does not explicitly disable encryption, then ciphered message payload will be never learned by the attacker under Dolev-Yao cryp- tographic assumption. To specify such property, an event disableEnc is inserted in the point where the principal disables encryption. The query is specified as query attacker(paylaod) event(disableEnc), which means that if the attacker obtains the secret payload then the event disableEnc must have been previously executed.

2.3 Comparative Overview of Formal Tools

In this section, we briefly review the general-purpose model checker and formal tools used to analyze security protocols (Section 2.3.1). Since Scyther (Section 2.3.2) and AVISPA (Section 2.3.3) are similar to ProVerif and are currently in active use, we discuss them in detail.

2.3.1 Formal Analysis Tools In this section, we introduce general-purpose model checkers, SAL and FDR, and special purpose tools: NRL Protocol Analyzer and LySa. In early stages of this work we used SAL, a general purpose model checker. The main reason to discuss it here is to provide background, because some of the special purpose tools are based on model checking. Model checking [40, 39] is a collection of techniques for automated formal verification of finite-state concurrent systems. To use a general-purpose model checker, the system or protocol is modeled as a state transition system, and the properties are specified in temporal logic. The tool then performs an exhaustive search of the state space of the state transition system to check whether the specification is satisfied. The model usually contains several components, which can be combined synchronously or asynchronously. At each time instant, each component performs a transition in synchronous composition, while only one component is selected to perform a transition in asynchronous composition. The state space can be huge. This causes the so-called state explosion problem [63]. To avoid the state explosion problem, the symbolic model checking technique has been proposed and studied. A symbolic model checker works with sets of states, which are represented by formulas in propositional logic. One symbolic technique is to use Binary Decision Diagrams (BDDs) [63], which often can represent boolean functions compactly. A number of efficient algorithms for manipulating BDD representations enable this symbolic technique to be used in model checking. Another technique is known as Bounded Model Checking, which is based on encoding the model into a 10

propositional SATisfiability (SAT) problem. A SAT solver is used to search counter- example paths by increasing the path length. This technique can be use with infinite state system. SAL (Symbolic Analysis Laboratory) is a general purpose model checker de- veloped by SRI and is a framework combining tools for program analysis, theorem proving, and model checking of transition systems [49]. Protocols are defined as state transition systems, and security properties including correspondence assertions can be expressed in temporal logic. The SAL bounded model checker translates a tran- sition system plus properties into a SAT or Satisfiability Modulo Theories (SMT) problem [34]. More specifically, it generates SMT formulae that describe the compu- tations of the system. The SMT solver is used to search for computations that violate the properties. SAL provides a language for specifying state machines as modules. The transition relation of a module may be specified using guarded commands. Sys- tems may be constructed by composing modules synchronously or asynchronously. SAL also provides a simulator to execute specific transitions, filter states, and find states satisfying certain assertions. FDR [71] is another general purpose model checker analyzing CSP processes which are translated from protocol descriptions by a compiler called Casper [72]. FDR searches the state space to check whether any trace could violate the speci- fications representing the security properties in the presence of the attacker. Lowe uses Casper/FDR to find the man-in-the-middle attack on the Needham-Schroeder protocol [71]. Also, there are some special purpose tools: the NRL Protocol Analyzer, LySa, Scyther, and AVISPA. In this section, we briefly introduce the NRL Protocol Analyzer and LySa. We will introduce Scyther and AVISPA in later sections. The NRL Protocol Analyzer [75, 74] was one of the first tools able to prove the correctness of security protocols without bounding the number of sessions or the message size. The NRL Protocol Analyzer uses the Dolev-Yao attacker model and specifies insecure states using a combination of constants and existentially quantified variables. The security properties are specified using rewrite rules. Users may prove a set of lemmas to cut down the search space size. When a state is generated, lemmas are used to determine whether it should be kept or discarded. The tool uses a backward search to determine whether a set of “bad” states is reachable. LySa [31] is a tool similar to ProVerif, which will be introduced later in this chapter. It describes protocols using a process calculus similar to the Spi-calculus [15]. The LySa tool provides feedback regarding which message parts can be decrypted as well as whether a Dolev-Yao attacker can falsely achieve authentication by inserting messages at any point. The Lysa tool generates an extension of Horn clauses from the processes and solves them by the Succinct Solver [82]. 11

2.3.2 Scyther In this section, we review how protocols and security properties are specified and verified in Scyther and list some applications of Scyther. Most material of this section is adapted from [41, 46, 47, 42]. Scyther [41] can verify either bounded or an unbounded number of runs, using a symbolic backwards search based on patterns. Scyther includes the possibility of unbounded verification with guaranteed termination, analyzes infinite sets of traces in terms of patterns, and supports multi-protocol analysis. Protocols are specified in the Security Protocol Description Language (SPDL) [44]. In a security protocol, each principal performs one or more roles, and the system executes the protocol roles. A role performed by a principal is called a run. The protocol specification describes the behavior of each role in the protocol. Honest principals only execute the events described in the specification sequentially, and may execute any finite number of runs in parallel. A role specification includes a list of role events and some initial knowledge. Dynamic behavior is modeled as a labeled transition system. Messages are exchanged through two multiset buffers shared by all participants. Attacker’s capabilities determine how the messages are transferred from the output buffer to the input buffer. The options of the attacker model may be no attacker, Dolev-Yao attacker, wireless communications attacker (it does not allow learning from a message and preventing its arrival at the same time), or passive attacker which can only eavesdrop. Security properties are specified in terms of claim events [46, 47]. A claim event means that if a principal has executed his part of the protocol up to the claim event, he can be sure that the claimed property holds. Secrecy properties are specified such that, for each trace, certain information is unknown to the attacker. Authentication properties can be specified as synchronizations or message agreements. The authen- tication properties are trace properties. Each trace of the protocol can contain a number of instances of claim events. Only the claims of principals that communicate with non-compromised principals are considered. Non-Injective Synchronization (NI- SYNCH) requires that: the send events must occur before their corresponding read events; the events in the trace corresponds to the events from the protocol; and the contents of the read messages and their corresponding send messages must match. NI-SYNCH does not rule out replay attacks. Besides the requirements of NI-SYNCH, the Injective Synchronization (I-SYNCH) claim event requires that for all communi- cations preceding the claim, there are a unique set of runs executing the roles in the protocol. Scyther verifies the security properties by analyzing classes of traces defined by trace patterns [42]. All attacks against a security property have a particular pattern. If there exist traces of the protocol that match the attack trace pattern, then the se- curity property is violated by any such trace. If no trace of the protocol matches the attack trace pattern, the security property holds. Scyther provides concise represen- tation of sets of traces. The pattern refinement algorithm takes a pattern representing 12

a set of traces which violate a security property, and refines the pattern into a finite set of patterns from which one can directly construct traces of the protocol. The refined patterns represent the same set of traces as the original pattern. If there exist such refined patterns, then the security property is violated. Otherwise, the security property holds. Scyther has been successfully used for the analysis and design of a number of protocols. Here are some highlights. Cremers and Mauw [45] propose a family of protocols for multi-party authentication and check the protocols using Scyther. They find type-flaw attacks on the protocols. Taha et al. [85] analyze the han- dover schemes and the pre-authentication handover protocol in IEEE 802.16e stan- dard (Mobile WiMAX) using Scyther. An attack in which the attacker learns the master session key was found in the handover schemes. Another attack found on the pre-authentication handover protocol reveals that the attacker can gain the unique key. Taha et al.[86] analyze the privacy and key management protocol in IEEE 802.16 (PKMv1) and 802.16e (PKMv2) standards using Scyther. They find a pseudonymity attack in which the attacker can learn the ID of the mobile station in both protocols, and an attack violating the secrecy of the mobile station’s data on PKMv1.

2.3.3 AVISPA In this section, we review the specification of the protocols and the security prop- erties in the Automated Validation of Internet Security Protocols and Applications (AVISPA) [19]. We also introduce the four back-ends and some applications of AVISPA. Most material of this section is adapted from [19, 18, 88]. The AVISPA tools use a web-based graphical user interface and support to specify the security protocols and properties by means of a modular and expressive specification language, the High-Level Protocol Specification Language (HLPSL) [18]. The HLPSL allows users to specify protocols by defining the states of the participants and transitions between states. The behavior of each kind of participant is specified in a module, which can be instantiated by one or more participants. (This is similar to what is done in a general purpose model checker like SAL, but in a general purpose checker one must explicitly model channels and the attacker.) The message exchanges are specified in transitions, which consist of precondi- tions and actions to be performed when the conditions are satisfied. One session of the protocol is a composition of instantiated participants which communicate typi- cally on channels controlled by a Dolev-Yao attacker. The whole system composes one or more sessions and also specifies the initial knowledge of the attacker. A trans- lator named HLPSL2IF automatically translates the specification into Intermediate Format (IF) based on first-order set rewriting. Security properties are specified as security goals using concise macros which are internally specified in terms of linear temporal logic. The secrecy property specifies that certain values are allowed to be known only by certain participants. During 13

the runs, whenever the attacker gains the knowledge of a secret value which is not explicitly specified between him/her and someone else, it should be considered as an attack. Authentication properties check that a principal’s responder is present in the current session, has reached a certain state, and agrees on certain values. Authentication properties are specified using two auxiliary events: request and witness [88]. Similar to non-injective correspondence assertion, the authentication goal asserts that a request event has been preceded by a witness event and the two events agree on certain values. For strong authentication, like injective correspondence assertion, no principal should accept the same values twice from the same responder. The AVISPA integrates four model-checker back-ends to search a transition sys- tem model for states that represent attacks, i.e. which violate the specified properties. The four back-ends are: the On-the-fly Model Checker (OFMC) [24], the Constraint- Logic-based Attack Searcher (CL-AtSe) [90], the SAT-based Model Checker (SATMC) [20] and the Tree Automata based on Automatic Approximations for the Analysis of Security Protocols (TA4SP) [19]. The OFMC combines infinite state forward model- checking with a lazy Dolev-Yao attacker [23], where terms are generated on-demand during the forward model-checking process. OFMC uses lazy data type to model the infinite state space associated with a protocol. When modeling a lazy Dolev- Yao attacker, it represents terms symbolically to avoid explicitly enumerating the possible messages which may be generated by the attacker. The representation is evaluated in a demand-driven way. When a particular message part is not to be an- alyzed, the decision about which value the attacker will choose is postponed during the search. The CL-AtSe applies constraint solving with simplification heuristics and redundancy elimination techniques. The CL-AtSe is built in a modular way and is open to extensions for handling algebraic properties of cryptographic operators. The SATMC builds a propositional formula which represents the transitions relations of the protocol. A SAT solver is used to analyze the propositional formula. The TA4SP approximates the attacker knowledge by using regular tree languages and rewriting. The Dolev-Yao attacker model is assumed in all the four back-ends. A number of security protocols have been tested by the AVISPA tools, includ- ing the protocols from the Clark/Jacob library [38]. The AVISPA tools have detected a number of previously unknown attacks on some of the protocols analyzed. Lim et al. [70] propose a handover protocol for WLAN, WiBro and UMTS, and verify it using AVISPA. Bouassida et al. [33] analyze the key management architecture for hierarchical group protocols using AVISPA, and find an attack on the members pro- motion protocol. Oheimb and Cuellar [91] propose protocols for location privacy and verify the protocols using AVISPA. They find a man-in-the-middle attack during the design process by analyzing the AVISPA models of the proposed protocols. 14

2.4 ProVerif

This section gives the rationale of our choice of ProVerif (Section 2.4.1) and introduces the modeling language (Section 2.4.2) which will be used throughout this dissertation. We briefly describe the analysis techniques (Section 2.4.3). We briefly survey the applications (Section 2.4.4) of ProVerif.

2.4.1 Rationale for the choice of ProVerif Recall from the previous sections, general purpose model checkers, such as SAL, can be used to analyze different aspects of security. The behavior of the attacker can be customized when modeling protocols using general purpose model checkers. However, in our experience, SAL may take hours or days to check the security properties due to a large or infinite state space. ProVerif, Scyther, AVISPA and NRL are specialized tools for cryptographic protocol analysis. They all have the built-in Dolev-Yao attacker, thus the user does not need to explicitly specify the attacker’s behavior. Since the NRL Protocol Analyzer is not publicly available, we discuss the other three specialized tools in order to decide to use which one to model and analyze the mobile telephony protocols. In the authentication scenarios of mobile telephony technologies, the serving network may run a large number of sessions at the same time. We want to model and check the security properties involving an unbounded number of sessions. ProVerif, Scyther, and TA4SP of AVISPA support analysis of an unbounded number of ses- sions. However, no trace is output by TA4SP when an attack is found. Thus it is infeasible to decide whether the attack found by TA4SP is a false attack. According to the performance comparison of ProVerif, Scyther and AVISPA done by Cremers et al. in [43], ProVerif is the fastest tool when checking the secrecy and authentication properties for the set of protocols analyzed in that work. ProVerif has capabilities in modeling and specifying the features equivalent to Scyther and AVISPA. In addition, ProVerif is a mature tool under active development. It has a significant user commu- nity and has a good documentation [83]. Additionally, ProVerif is able to model the features we want to model. Therefore we choose ProVerif to model and analyze the mobile telephony protocols.

2.4.2 Specifying Protocols and Security Properties In this section, we introduce the process algebra used by ProVerif to specify protocols. We describe the term and process grammar, as well as functions and rewrite rules to represent cryptographic primitives. This section also discusses how to specify secrecy and authentication properties in ProVerif. We briefly describe how to use ProVerif in practice. Most of the material is adapted from [27, 25, 30]. The protocol specification language is an extension of pi-calculus (Spi-calculus [15]), which is defined in Figure 2.1. Terms include variables and names. The attacker 15

M, N ::= terms x, y, z variable a, b, c, k name

(M1,..., Mn ) tuple f(M1,..., Mn ) constructor

P, Q ::= process 0 nil out(M, N); P message output in(M, x: t ); P message input P|Q parallel composition !P replication new n:t; P name restriction let x:t = M in P else Q term evaluation if M=N then P else Q conditional event(M); P event

Figure 2.1: Term and Process Grammar knows the free names by default. However, names can be declared private. Private names are not a priori knowledge to the attacker. ProVerif supports tuples, written as (M1,..., Mn ). The attacker has the capability of constructing a tuple when he/she has the terms M1,..., Mn , and the attacker also can recover the i-th element when he/she possesses the tuple. There are constructors that are used to model primitives such as one way functions, encryption and digital signatures. Data is a special kind of constructor. A constructor declared as data is similar to a record: the attacker can construct and decompose data constructors. The relationships between the prim- itives are captured by destructors which are modeled using rewrite rules. Destructors may be non-deterministic operations on terms. Specifically, when several rules can be applied, only one is chosen. However, ProVerif considers all possibilities when rea- soning. For example, symmetric encryption can be defined by the binary constructor sencrypt which takes a bitstring and a key as arguments and returns a bitstring. fun s e n c r y p t ( b i t s t r i n g , key ) : b i t s t r i n g A destructor expressing how decryption inverts encryption may be defined as: reduc forall m: b i t s t r i n g , k:key; sdecrypt(sencrypt(m,k), k) = m. Any party, including the attacker, can compute sdecrypt(X,k) if he/she has obtained X and k, so m can be obtained if X is sencrypt(m,k). In a symbolic model, the attacker can learn nothing from sencrypt(m,k) if he/she does not have k. Constructors and destructors can be declared as public or private. If they are declared as public, the attacker can use them to build or manipulate terms. Otherwise, they can only be used by honest principals. One application of private destructors is to model key 16

distribution (See section 3.2.1). Processes are defined as follows. The nil process does nothing. The process out(M, N); P outputs N on the channel M, and then executes P. The process in(M, x:t ); P awaits a message of the type t from the channel M, and then executes P. P|Q is the parallel composition of process P and Q. The replication !P represents an unbounded number of processes of P running in parallel. The restriction new n:t; P creates a new name of the type t, which can be used to model fresh random numbers, private chan- nels, or keys. In the term evaluation let x:t = M in P else Q, if M contains destructors, it first evaluates M; if the evaluation succeeds, then x is bound to the value of M and executes P; otherwise, it executes Q. If M does not contain destructors, x is always bound to M and P is always executed. The syntax of the conditional is standard: if M and N can be reduced to the same term, the branch of P is taken; otherwise the branch of Q is taken. The process event(M); P executes event(M), and then executes P. Events annotate processes and mark the stages reached by the protocol but do not affect their behavior. Events are used to specify correspondence assertions (see Section 2.2.2). The pi calculus of ProVerif supports types. There are built-in types channel, bitstring and bool. ProVerif statically checks types, which helps the user avoid mod- eling errors. However, ProVerif ignores types during analysis, i.e., types do not affect the dynamic semantics of processes. This enables ProVerif to detect type flaw at- tacks [61].

2.4.3 Analysis Technique and Approximation In this section, we introduce how ProVerif translates the processes into Horn clauses. Given a process and a set of names which model the protocol, ProVerif first instru- ments the process to define formal terms (i.e., function symbols, which are introduced later in this section) associated with the names, and then builds a set of Horn clauses that encode protocol executions including the behavior of the attacker. This section also introduces the basic idea of the resolution-based algorithm used by ProVerif to determine whether a fact is derivable from the Horn clauses. The instrumentation records dependencies and keeps track of sessions in order to model freshness. The new names are treated as function symbols, which take the messages received by inputs before the new action and the session identifiers as arguments. Each replication of the process is labeled with a distinct, fresh session identifier. The identifier indicates which copy (or session) is executed. Each restriction new a in processes representing honest principals is labeled as a function symbol a[t , s], where t may be (1) a sequence of messages received before the new name is generated, and/or (2) the results of non-deterministic destructor applications before the new action; and where s is a sequence of session identifiers that label replications before the new action. Using function symbols for new names, at most one name corresponds to a given a[t , s] in each run of the process. Therefore, different names are not merged 17

by the verifier. In fact, moving the restrictions downwards in the process includes more received messages in the first argument of the function symbol. Therefore, the analysis is more precise and more costly. A new name b created by the attacker is labeled as a function symbol b0[b[s ]] , where s is a sequence of session identifiers that label replications before the new action. The symbol b0 is a special name which is distinct from other such symbols. It is easy to generate the instrumentation for the attacker by using such a special symbol. Since the attacker can generate names at any time, there is no relation between the generation of new names and the messages previously received by the attacker. The Horn clauses are in the form F1 ∧ · · · ∧ Fn ⇒ F, where F1,..., Fn , and F are facts. Several facts are defined as follows: The fact attacker(p) represents that the attacker knows p. The fact message(p, p’) represents that the message p’ may be sent on the channel p. The fact m-event(p) represents that event p must have been executed. The fact event(p) represents that event p may have been executed. ProVerif first builds the initial knowledge of the attacker. Each public free name a is known by the attacker, so the clause attacker(a []) is generated. Since the at- tacker can generate an unbounded number of new names, the clause attacker(b0[x]) is included in the attacker’s clauses. For each constructor f(M1,..., Mn ), if the attacker has the knowledge of M1,..., Mn , then the attacker can apply the public constructor. This is represented by the clause attacker(M1) ∧ · · · ∧ attacker(Mn ) ⇒ attacker (f(M1,..., Mn )). Similarly, for each public destructor reduction g(M1,..., Mn ) → M, if the attacker has the knowledge of M1,..., Mn , then the attacker can apply the public destructor. The destructor is represented by the clause attacker(M1) ∧ · · · ∧ attacker(Mn ) ⇒ attacker(M). The attacker can listen to all channels he/she has, so the clause message(x,y) ∧ attacker(x) ⇒ attacker(y) is generated. The attacker can also send the messages he/she has on the channels known by the attacker, so the clause attacker(x) ∧ attacker(y) ⇒ message(x,y) is generated. A protocol is typically specified in terms of the process calculus described in Section 2.4.2. A process is translated into a set of clauses. These clauses have the form H ⇒ F, meaning that if the steps defined by H have happened then the step defined by F can happen. The translation uses a sequence of facts (H) which has the form F1, ∧ ..., ∧ Fn to keep track of messages received and the events that have been executed. Initially, this sequence is empty. The nil process does nothing, so the translation of the nil process is empty. The translation of message output out(M, N); P in the context of an enclosing process adds a clause H ⇒ message(M, N), where H is a sequence of facts. Since the messages received and events executed before this output are recorded in H, the clause signifies that if all facts in H are true, then the message (output N on the channel M) is triggered. The translation of message input in(M, x: t ); P extends H with the fact of the inputing message as H ∧ message(M, x). The translation of parallel composition of two processes is the union of the clauses for both processes. Replication does not need to be translated, because Horn clauses can be applied many times arbitrarily. 18

The translation only inserts new session identifiers into the environment. Since the new names are substituted with function symbols in the instrumentation process, no more translation is needed here. The translation of term evaluation is the union of two sets of clauses: those for the process where the evaluation succeeds (bounded variables are replaced by the corresponding terms), and those for the process where the evaluation fails. Similarly, the translation of the conditional is the union of clauses for the processes where the condition is true, and clauses for the processes where the condition is false. The translation of events extends H with the fact m-event(M) as H ∧ m-event(M). Adding m-event into the hypothesis means the following process can be executed only if the event has occurred before. Furthermore, the translation of the event also adds another clause H ⇒ m-event(M) to signify that the event is triggered when all facts in H are true. The translation ignores the replications of actions, because the Horn clauses can be applied any number of times. This approximation (implicit replications of actions) helps for efficient verification with infinite state space and with any number of protocol runs. However, the approximation can cause false attacks. A particular case of this approximation is that if a message has been sent on a private channel at some point, it may be sent again later. Security properties in ProVerif are specified as queries. A secrecy property is specified as a query of the attacker’s knowledge (the fact attacker(M)). When the fact attacker(M) is derivable from the Horn clauses, the attacker may have the knowledge of M. When the fact attacker(M) is not derivable from the clauses, there is no way that the attacker can gain the knowledge of M. The authentication properties are specified as correspondence assertions in the form of event(e1(M)) event(e2(M)). If all clauses that conclude event e1 contain event e2 in their hypotheses, then event e1 is derivable only when event e2 holds, so the correspondence assertion is proven. To determine whether a fact is derivable from the Horn clauses, ProVerif uses a resolution-based algorithm [25]. The basic idea is to combine pairs of clauses by unification. When the hypothesis of one clause C and the conclusion of another clause C’ are unifiable, a new clause C’ ◦ C can be inferred by removing the conclusion of C’ and replacing it with the hypothesis of C. The facts which are not in the form of attacker(x) or m-event(x) are selected in each clause, and the resolution is performed only on the selected facts. The search for a derivation consists of two phases: in the first phase, the clauses representing the protocol and the attacker are inserted. After simplification and elimination, ProVerif executes a fixpoint iteration that adds clauses created by the resolution. In the second phase, it executes a backward depth-first search, which starts with the goal as the root of the derivation and tries to grow the tree. Each branch of the tree grows upwards until it is complete, before the algorithm moves on to grow the next branch. The solving algorithm is described in [25] in detail. This solving algorithm is not always guaranteed to terminate. But it is proven to terminate for tagged protocols [29] with some conditions. A tagged protocol is de- fined as a protocol in which a unique constant is added to each message. By adding the 19

unique constants, each application of a constructor can be distinguished from other constructors. It is shown that the solving algorithm terminates on tagged protocols using only public channels, public-key cryptography with atomic keys, shared-key cryptography and hash functions.

2.4.4 Applications This section highlights the applications of ProVerif on a number of protocols. Chang and Shmatikov [36] use ProVerif to analyze the Bluetooth device pairing protocols. They confirm the offline guessing attack [64] in the Bluetooth device pairing protocol specified in Bluetooth standard version 1.2 and find an attack scenario in Bluetooth SSP when the same device is involved in concurrent SSP sessions. In the attack scenario, the number displayed on the screen may not have been computed in the session which the user is trying to authenticate. This attack may not be practical, since the real implementation may not allow concurrent sessions of pairing. Abadi et al. [14] analyze the Just Fast Key protocol using ProVerif and find some minor limitations and weaknesses. Abadi et al. [12] use ProVerif to verify a certified email protocol and prove the main security properties. Blanchet and Chaudhuri [28] use ProVerif to analyze the protocol of secure file sharing on untrusted storage. They find an integrity attack and propose the fix. Chen and Ryan [37] confirm an attack on current authorization protocols for TPM using ProVerif. They propose and prove correctness of a new authorization protocol for TPM. ProVerif is used to analyze and verify an electronic voting protocol by Kremer and Ryan [67]. ProVerif is used to prove strong secrecy properties in work of Brus`oet al [35] on privacy for RFID.

2.5 Prior Work on Formal Analysis of Mobile Telephony Protocols

We discussed some prior work on analysis of mobile telephony protocols using the informal analysis techniques in Section 2.1.2. In this section, we highlight some work for mobile telephony protocols using formal techniques. The UMTS AKA is manually proved using an enhanced BAN-logic and the Temporal Logic of Actions (TLA) in the 3GPP specification [2]. Tsay and Mjølsnes [89] find an attack on the UMTS and LTE AKA using CryptoVerif, an automated protocol analyzer based on a computational model. In fact the attack lives at the symbolic level. It depends on insecurity of the connection between the serving network and the home network. In the attack, the attacker sends out the victim’s IMSI and his own IMSI at the same time to trigger two concurrent AKA sessions. The attacker then redirects the authentication vector response in- tended for him to the SN and makes the SN believe that the authentication vector is for the victim. At the same time, the attacker blocks the authentication vector mes- sage for the victim. Then the attacker redirects the authentication challenge message intended for the victim to himself. Because the authentication vector is originally 20

generated for the attacker, the attacker can compute the correct response. So the attacker can complete the authentication with the SN by impersonating the victim, causing HN bill the victim for the service used by the attacker. In our work we assume the connection between serving network and home network is secure. (Although the standard specifies the protocols, their implementations are operator-specific.) Lee et al. [68] analyze the anonymity property of the UMTS and LTE AKA and connection establishment protocols using formal security (computational) models. The assumption in this work is that the attacker is not capable of impersonating any network devices and the underlying cryptographic system is perfect. They manually prove the protocols meet the anonymity requirement, under these assumptions. Arapinis et al. [17] find two attacks against anonymity in UMTS, using ProVerif. To perform the first attack, the attacker sends the paging request message with a victim IMSI to check whether the victim is in a particular area. By sending the paging request multiple times, the attacker can learn the correlation between the IMSI and the TMSI (These terms are introduced in Chapter 3.). In the second at- tack, the attacker first intercepts one legitimate AKA and records the authentication challenge message. The attacker then replays this authentication challenge message to learn whether the victim is in the area by checking the return failure message. 21

Chapter 3 Modeling and Analysis of GSM

This chapter provides an overview of the GSM AKA and its security goals (Sec- tion 3.1) and presents our model of the protocol (Section 3.2), the specifications of security properties, and our findings (Section 3.3). The security goals, design deci- sions, and security property specifications are applicable to other protocols, so this chapter serves as an introduction for all three technologies.

3.1 Overview of GSM AKA

This section describes the GSM AKA and informally specifies the security goals. We divide the AKA into blocks and explain which blocks intend to achieve which goals. The GSM network architecture is depicted in Figure 3.1 [94, 76]. The figure is taken from [76]. A GSM network consists of several functional entities. A Mobile Station (MS) is a combination of the Mobile Equipment (ME) and the Subscriber Identity Module (SIM ). The SIM card contains the subscriber’s data such as the user’s identification number and a list of available networks. The SIM card also contains the algorithms for authentication and ciphering. In a GSM network, the MS connects to a Serving Network (SN ) via a particular Base Transceiver Station (BTS). An SN may be the MS’s wireless service provider, i.e., its HN or a Foreign Network (FN ). An MS might receive service from an FN in areas where its HN does not provide service. The SN consists of Mobile Switching Centers (MSC ) and Vis- itor Location Registers (VLR). One MSC controls several Base Station Subsystems (BSS). The Base Station Controller (BSC ) is the central network element of BSS and controls the radio network. Each BSC maintains multiple BTSs. The VLR con- tains the information of MSs currently in the service area and keeps track of the MSs’ locations. The Home Network (HN ) contains MSCs, the Home Location Registers (HLR) and the Authentication Centers (AuC ). The HLR maintains the permanent information of subscribers and also keeps track of the MS’s location. The AuC stores the long-term key Ki and contains the algorithms to generate authentication data. The goal of the GSM authentication is to authenticate the MS to the SN and to establish an encryption key that can then be used to protect the user data exchange between the MS and BS. In addition to the authentication of the MS, GSM is also designed to keep the encryption key secret. If the traffic between the MS and SN is encrypted under the encryption key, the Dolev-Yao attacker (see Section 2.2.1) is not supposed to be able to learn the message payloads. Figure 3.2 shows the AKA. We divide the AKA into blocks following [76], which will be used in the interoperation cases. In block GSM I of the protocol, an MS first transmits its Temporary Mobile Subscriber Identity (TMSI ) to the MSC/VLR. The 22

SN HN

VLR MSC MSC

BSS HLR

BSC

MS BTS BTS AuC

ME + SIM

MS: Mobile Station ME: Mobile Equipment SIM: Subscriber Identity Module SN: Serving Network MSC: Mobile Switching Center VLR: Visitor Location Register BSS: Base Station Subsystem BSC: Base Station Controller BTS: Base Transceiver Station HN: Home Network HLR: Home Location Register AuC: Authentication Center

Figure 3.1: GSM architecture [94, 76]

CAPabilities (CAP), i.e., the encryption algorithms the MS supports is also sent to the BS. In case the MSC/VLR does not recognize the TMSI, i.e., the MSC/VLR cannot resolve the received TMSI to a unique International Mobile Subscriber Identity (IMSI ), the MSC/VLR will require the MS to send its unique IMSI, and will allocate a new TMSI to the MS. (Allocating a new TMSI is not shown in Figure 3.2; it occurs after the successful authentication.) In block GSM II, the MSC requests authentication vectors from the MS’s HN (see Message 5 in Figure 3.2) by sending the IMSI. The MS and the HN share a long- term symmetric secret key Ki . Using this pre-shared secret key Ki and a random nonce RAND, the HN generates an authentication vector consisting of the three components RAND, XRES, and a session key Kc. XRES and Kc are computed using the algorithms A3 and A8 [94] respectively. Upon receiving the authentication vector (Message 6), the MSC starts a chal- lenge response exchange with the MS in block GSM III. Specifically, the MSC sends the challenge RAND to the MS (Message 7). Based on the received RAND and the pre-shared key Ki stored on its SIM card, the MS computes the session key Kc as well as a response RES to the received challenge RAND. Subsequently, the MS sends the computed response RES to the MSC. If RES matches the response XRES (which the MSC received from the HN as part of the authentication vector), then the MS has successfully authenticated itself to the SN. In block GSM IV, the MSC forwards the session key to the BS on a secure channel. The BS then decides which encryption algorithm will be used to encrypt the 23

MS BS MSC HN

1. CAP GSM I GSM 2. TMSI

3. User ID Request 4. IMSI

5. IMSI GSM II GSM Generate RAND XRES = A3(Ki, RAND) KC = A8(Ki, RAND) 6. RAND, XRES, KC . GSM IIIGSM 7. RAND

RES = A3(Ki, RAND)

KC = A8(Ki, RAND) 8. RES Verify RES = XRES

9. KC

GSM IV GSM Decide algorithms 10. Selected algorithms

11. CMComplete

Figure 3.2: GSM message sequence diagram [94, 76] communication on the air interface between the BS and the MS (based on the CAP it received from the MS earlier). The BS informs the MS of its choice in the Cipher Mode Command (CMC ) message (Message 9) and starts the possibly encrypted communication. The MSC/VLR generates a new TMSI for the MS and sends it to the MS. The new TMSI is recorded for subsequent traffic. The protocol assures the SN of the authenticity of the MS in case the response RES received from the MS matches the XRES received from the HN as part of the authentication vector. Only an MS holding the pre-shared key Ki will be able to com- pute the correct result RES in response to the random challenge RAND (assuming the security of algorithms A3 and A8). However, GSM does not provide any assurance for the MS that it is in fact connected to a legitimate BS of the SN. The false base station attack was first de- scribed in [53]. The false base station attack is a man-in-the-middle attack, i.e., the false base station sits in between the MS and the legitimate BS, pretending to be a legitimate BS when communicating with the MS and pretending to be a legitimate MS when communicating with the actual BS. Since the MS sends its capabilities CAP in the clear, it is possible for a false base station to intercept and modify that 24

information before forwarding it to a legitimate BS. In particular, it can change the capabilities CAP it received from the MS so that the legitimate BS will believe that the MS cannot support encryption of data or voice traffic. The false BS will simply relay Messages 7 and 8 between the MS and the legitimate BS thus facilitating the proper authentication of the MS to the legitimate BS. The verification of whether or not the RES matches the XRES succeeds and the BS believes it is serving the MS. The legitimate BS has no choice but to select the no-encryption option as it believes that the MS does not support encryption. (Of course, the BS could refuse to service the MS). Consequently, the false BS will be able to listen in and arbitrarily modify the unencrypted communication between the MS and the legitimate BS. In summary, the following security properties are expected: • Key Secrecy The pre-shared key Ki and the cipher key Kc should be kept secret, i.e., the keys are unknown to the attacker.

• Conditional Payload Secrecy The data traffic should remain secret against the attacker if the SN chooses to use encryption. Vulnerabilities of the encryption mechanisms are not taken into ac- count, because the attacker model is the Dolev-Yao attacker model, which assumes perfect cryptography (Section 2.2.1).

• Authentication of the MS to the SN The GSM AKA is designed to provide for the authentication of the MS to the SN.

The GSM AKA is not intended to guarantee the following properties:

• Payload Secrecy (unconditional) The secrecy of the data traffic cannot be guaranteed in general, e.g., if the SN decides not to use encryption.

• Authentication of the SN to the MS The GSM AKA does not provide for the authentication of the SN to the MS.

3.2 Modeling the GSM AKA

In this section we provide an overview of the main design choices and design rationales. We also present detailed explanation of the ProVerif model.

3.2.1 Design Choices In this section, we list the key design choices used in the model. Modeling secure communication using a private channel: In our work, it is assumed that the communication between the SN and the HN is adequately secure. One way of modeling the secure communication can be done by using a private 25

channel between the SN and the HN. Traffic on a private channel is not accessible to the attacker, while messages on a non-private channel can be copied, deleted, and fabricated by the attacker. Another way of modeling the secure communication between the SN and the HN is by encrypting the communication on a public channel. A secret key is shared between the SN and the HN and is never disclosed. The communication between the SN and the HN are encrypted and decrypted using the secret shared key. Since perfect cryptography is assumed in the Dolev-Yao attacker model (Section 2.2.1), the communication over the public channel is secure as long as the shared key is kept secret. The model using encryption on communication between the SN and the HN is more complex than the one using private channel, because when modeling secure communication using encryption, each message has to be encrypted when it is sent out and has to be decrypted when it is received. We use a private channel to model the secure communication between the SN and the HN in our model. A consequence of using private channel is that if we use injective correspon- dence assertion to specify authentication properties for multiple sessions, false attacks will be found due to the approximation used by ProVerif (see Section 2.4.3). Since standard devices do not support multiple sessions of authentication, we feel it is not important to require injectivity when specifying authentication properties. If an or- dinary correspondence assertion holds, then the injective version will in fact hold as long as the device does not support multiple sessions. Using message headers to identify messages: In our model, each message has a header to indicate the type of the message content. Using message headers allows us to use only one channel between two principals. If message headers are not used and only one channel is used between two principals, type flaw attacks [61] may exist. In addition, with message headers in the model, each principal checks whether the message header in the received message matches the expected header. If it does not match, the message is simply discarded. This mechanism dramatically reduces the state space of the model. In practice, the general message format is defined in [11]. Some fields are specified to help the communicating parties to identify messages. The message types are listed in [62]. For example, message type “IDENT REQ” is used in the message sent by the BTS to the MS to request the identification of the MS. So, we believe it is reasonable to use message headers to identify the messages. Using boolean variables to represent capabilities: The capabilities of the MS are a set of encryption algorithms supported by the MS. By employing the Dolev- Yao attacker model which assumes perfect cryptography, any encryption algorithm is assumed adequately secure in our model. Thus, we only consider two kinds of capabilities: capable of encryption or not. So we model that the MSs may or may not support encryption, but we abstract the particular algorithms prescribed by the standard, using just a boolean variable. By using rewrite rules, the MS process can 26

non-deterministically choose whether it is capable of encryption or not. The analysis of ProVerif will consider all possible executions, which thus include those where the MS has encryption and those where it does not. This is similar than analyzing two different models for the two kinds of MSs. Omitting TMSI/ID request messages: When an MS first roams into an FN, an IMSI is always requested. As mentioned in Section 3.1, if the SN cannot resolve the received TMSI, the SN will require the MS to send the IMSI. An active attacker can always intercept the message containing the TMSI and send a “wrong” TMSI to the SN, so that the SN cannot resolve this “wrong” TMSI; thus forces the SN to request the MS to send its IMSI. To simplify our model, the TMSI and ID request messages are omitted. Using a fresh value to represent an IMSI: IMSI is the permanent identifier of a subscriber and it is used to uniquely identify the mobile subscriber. An IMSI consists of three parts [3]: (a) Mobile Country Code (MCC ), which identifies the country that the subscriber domiciles, (b) Mobile Network Code (MNC ), which identifies the HN of the subscriber, and (c) Mobile Subscriber Identification Number (MSIN ), which identifies the subscriber within the HN. The IMSIs of the MSs could be modeled as a sequence of numbers, represented by integers in ProVerif [28], to uniquely identify the subscribers. In our model, we use fresh value to represent the IMSI. This is a modeling convenience: it models uniqueness; it means we cannot find attacks that somehow exploit information carried by the IMSI. Fresh values are unguessable by the attacker. However, in our model, the MS sends the IMSI in clear over the public channel as it should according to Figure 3.1. Thus, the attacker can learn the IMSI by eavesdropping on the public channel. In practice, an active attacker can gain the IMSI using the so-called “IMSI catchers” [53]. Using a table to model registration of the MS: It is assumed that reg- istration of the MS devices, including key distribution, is done securely by providers. In practice, the AuC maintains a database of the credential pair (IMSI, Ki). As discussed in [30], key distribution can be modeled using private channels, using con- structors and private destructors, or using a table. When modeling key distribution using a private channel c, one process outputs an unbounded number of copies of the credential pair (IMSI, Ki) over the private channel (out(c, (IMSI, Ki))). To get the key corresponding to the IMSI, another process reads on the private channel by in(c, (=IMSI, k:key)). When modeling the key distribution using constructors and private destructors, the IMSI is defined as a function (constructor) of the Ki, which is declared as a private free name. This constructor is public, so that the attacker can also use the constructor to associate the key he/she generates with an IMSI. The destructor returns the key from the IMSI. The destructor is private so that the attacker cannot obtain all the keys from the IMSIs. Our model uses a private table to associate keys with identities. In ProVerif, processes can access and populate the tables, but not delete entries. Two actions can 27

be executed on the table, insert and get. The insert action inserts a record into a table. The get action tries to retrieve a record which matches some pattern, if no record is found, the process blocks; if several records can be matched, one possibility is chosen, however, ProVerif considers all the possibilities when reasoning. Modeling key distribution using private channels is equivalent to modeling it using tables [30]. One advantage of modeling key distribution using constructors and destructors is that it sometimes may solve the termination issues caused by tables. We model this database as a table, because it is easy to understand and our model has no termination problem. In practice, the database schema may or may not actually be defined as the one in our model; but if we find attacks, those attacks do not exploit flaws in registration or key distribution. Adding the IMSI to the authentication data response message: In our model, the IMSI is included in the authentication data response message, which is not specified in the standard (but might well be present in an implementation). Without it, ProVerif finds a candidate derivation from which a trace cannot be automatically reconstructed. We manually analyze the derivation and find that it is a false attack, which arises due to conservative approximations (Section 2.4.3). The authentication data response message is sent to the SN on the private channel after the HN generates the authentication vectors. Due to the approximation, ProVerif finds the derivation where this message is sent again later. In the false attack, the authentication data response message for one IMSI may be sent to the SN in response to a request with another IMSI. To rule out such false attacks, the IMSI is added to the authentication data response message to identify the responses. Adding a data message to specify the secrecy of the data traffic: At the end of the AKA, the SN informs the MS of its choice of encryption and starts communication, which may or may not be encrypted due to the choice of the SN. We want to check the secrecy of the data traffic when encryption is enabled. To check this secrecy property, a data message is included at the end of the model, even though it is not part of the AKA per se. Adding private free names to test the secrecy of session keys: The standard secrecy queries of ProVerif can only check the secrecy of private free names. To test the secrecy of session keys, we use the general ProVerif technique for testing the secrecy of bound variables: encrypting some private free names with the session keys and sending the encrypted messages over a public channel and testing the secrecy of those free names. Since the attacker can gain the encrypted message by eavesdropping on the public channel, the secrecy of the free names implies the secrecy of the session keys. Abstracting algorithms and algorithm identifiers in key derivation functions: Since perfect cryptography is assumed in the Dolev-Yao attacker model, and we only model whether encryption is enabled or not, it does not matter which algorithm is chosen. Therefore, the algorithms and the algorithm identifiers are ab- stracted from key derivation functions. 28

Modeling the MS to engage only one session As mentioned previously, the IMSI is represented as a fresh value. For each execution explored by ProVerif, the MS gets a fresh IMSI, i.e. the MS is modeled as it only engages one session. To model than an MS can engage in multiple authentications, we made a model that applies the replication operator to the part of the process that follows generating the IMSI and registering it with the long term key Ki (Section 2.4.2). The result of the model in which the MS engages multiple sessions of AKA is the same as the result of the model in which the MS only engages one session. This has been tried all the models of all AKA scenarios and the results do not change. So we present the models in which the MS only engages one session.

3.2.2 GSM Model In this section, we discuss the GSM model along with the diagram annotated ac- cord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S1_GSM_I-IV.pv. Figure 3.3 augments the protocol diagram of Figure 3.2, as a guide to our model. We abstract from the details of the SN, which consists of the BS and the MSC. In the model, we use one process to represent the SN. Labels, like cap ms and cap sn for the first message, are the names of the relevant variables in the processes that model protocol roles. Besides variable names, the other augmentation is the addition of events (the dashed boxes). As described in Section 2.2.2, these are instrumentation used in order to specify authenticity properties as correspondence assertions. Such properties take the form “if event E happens then event F must have happened previously”. For example, whenever the SN decides to proceed with communication, using a particular Kc, because it successfully verified the response to a challenge, then that MS must indeed have sent the response and computed Kc for itself. We specify this by putting events begSN and endSN in block GSM III. We include events begMS and endMS to specify authentication of the SN to the MS. Recall from Section 3.1, this property is not expected to hold in GSM. In the events used to specify the authentication of the MS to the SN, we choose the identity of the MS (IMSI ) and the session key (Kc) as the parameters. Because Kc is derived from the permanent key Ki and the random number RAND, the two events agree on Kc implies that they agree on RAND. Since the response is generated from the Ki and the RAND, agreement on Kc also implies the agreement on the response. The event begSN is put immediately before sending the response to the SN. It cannot be put earlier, because the parameters of the events are not present until this point. It cannot be put later either, otherwise, there would be executions in which endSN is executed prior to begSN, due to relative timing. This would violate the corresponding property but would not indicate an actual protocol flaw. The event endSN is put immediately after receiving the response from the MS. It cannot be put earlier, otherwise, we cannot capture the stage where the SN has received the response 29

MS SN HN

GSM I GSM 1. CAP cap_ms cap_sn 2. IMSI

imsi_ms imsi_sn 3. IMSI imsi_sn imsi_hn GSM II GSM Generate rand_hn xres_hn = a3(Ki, rand_hn), kc_hn = a8(Ki, rand_hn)

imsi_hn_sn imsi_hn rand_sn 4. IMSI, RAND, XRES, KC rand_hn xres_sn xres_hn kc_sn kc_hn 5. RAND rand_ms rand_sn res__ms = a3(Ki, rand_ms), kc_ms = a8(Ki, rand_ms)

GSM IIIGSM event begSN(imsi_ms,kc_ms) 6. RES res_ms res_sn

Verify res_sn = xres_sn

event endSN(imsi_hn_sn, kc_sn)

Decide whether to use encryption

GSM IV GSM event begMS(imsi_hn_sn, kc_sn) 7. cap_sn enableEnc_ms cap_sn

event endMS(imsi_ms, kc_ms) if cap_sn is false event disableEnc

8. CMComplete

9. payload, if no encryption msg_ms {payload}_kc_sn, otherwise Decrypt message if enableEnc_ms is true

Figure 3.3: GSM diagram annotated in accord with our model. Compared to Fig- ure 3.2, our model omits TMSI/ID Request (messages numbered 2 and 3 in Fig- ure 3.2), abstracts from the details of the SN, and adds a first message of data traffic

and authenticated the MS. The end event could be placed later, which means that the SN has reached the point where the response is verified earlier. However, putting the end event at the exact point where the response is verified is natural and provides better understanding of what the correspondence assertion captures. Ideally, we decompose a protocol into blocks that have an identifiable purpose, and sometimes this purpose can be formalized by events within the block. The MS, SN, and HN are modeled as processes that send and receive messages over two shared channels. The MS and the SN communicate over the public channel, while the SN and the HN securely communicate over the private channel. (∗ Public channel between the MS and the SN ∗) f r e e pubChannel: channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel: channel [ p r i v a t e ].

Besides the built-in types channel, bitstring , and bool, we declare additional types. 30

type key . (∗ Permanent key ∗) type i d e n t . (∗ Identity of MS ∗) type nonce . (∗ Random number ∗) type msgHdr . (∗ Constant message header ∗) type r e s p . (∗ Response ∗) type sessKey . (∗ S e s s i o n key ∗) We also define a number of (distinct) constant values as message headers to identify messages. The comments refer to message numbers in Figure 3.3. const CAP: msgHdr. (∗ Header of Msg 1 ∗) const ID : msgHdr . (∗ Header of Msg 2 ∗) const AV REQ: msgHdr. (∗ Header of Msg 3 ∗) const AV: msgHdr . (∗ Header of Msg 4 ∗) const CHALLENGE : msgHdr . (∗ Header of Msg 5 ∗) const RES : msgHdr . (∗ Header of Msg 6 ∗) const CMC: msgHdr. (∗ Header of Msg 7 ∗) const CMComplete: msgHdr. (∗ Header of Msg 8 ∗) In ProVerif, the cryptographic functions are declared as constructors and their alge- braic properties are defined by rewrite rules (see Section 2.4.2). In our model, the following constructors and destructors are defined.

1 fun a3(nonce, key) : resp. 2 fun a8(nonce, key): sessKey. 3 fun s e n c r y p t ( b i t s t r i n g , sessKey ) : b i t s t r i n g . 4 reduc forall m: b i t s t r i n g , k: sessKey; 5 sdecrypt(sencrypt(m, k), k) = m. 6 reduc encCapability() = true; encCapability() = false. The destructor in lines 4–5 says how decryption inverts encryption: any party, in- cluding the attacker, can compute sdecrypt(X,k) if he/she has obtained X and k, so m can be obtained if X is sencrypt(m,k). In the symbolic model of cryptography, the attacker can learn nothing from sencrypt(m,k) if he/she does not have k. Functions, and rewriting via equations, are available to the attacker unless declared private. As described in Section 3.2.1, a public function with a private destructor could be used to model key distributions. However, in this work, we choose to use table to model the key distribution. ProVerif allows non-deterministic rewrite rules, e.g., in line 6 there are two equations for encCapability so that the MS process can choose whether its capability includes encryption or not (see Section 3.2.1). We declare the events used in the correspondence assertions as follows: event begSN(ident , sessKey). event endSN(ident , sessKey). event begMS(ident , sessKey). event endMS(ident , sessKey). Our model uses a private table which associates keys with identities to model the registration of the MS. (∗ The key table consists of pairs (ident, key) shared between 31

the MS and the HN. Table is not accessible by the attacker ∗) table keys(ident , key). The dynamic part of the model is declared as follows: process ((!processMS) | (!processSN) | (!processHN)) The main process forks multiple sessions for each kind of process (indicated by the replication symbol, !). The MS is represented by the following process. The comments refer to message numbers in Figure 3.3.

1 l e t processMS = 2 (∗ Registration and setup ∗) 3 new imsi ms : i d e n t ; 4 new k i : key ; 5 insert keys(imsi ms , k i ) ; (∗ pre−shared identity and key ∗) 6 l e t cap ms : bool = encCapability() in (∗ choose capability ∗) 7 (∗ The protocol ∗) 8 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 9 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 10 in ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) 11 (∗ Compute response ∗) 12 l e t res ms: resp = a3(rand ms , k i ) in 13 (∗ Compute encryption key ∗) 14 l e t kc ms: sessKey = a8(rand ms , k i ) in 15 (∗ MS is authenticating itself to SN ∗) 16 event begSN ( imsi ms , kc ms ) ; 17 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 18 in (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) 19 event endMS( imsi ms , kc ms ) ; 20 out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) 21 in (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) 22 out (pubChannel, sencrypt(secretKc , kc ms ) ) ; 23 i f enableEnc ms = t r u e then 24 l e t msgcontent: b i t s t r i n g = sdecrypt(msg, kc ms ) in 0 .

An instance of processMS models the initial activation of an MS followed by a single attempt at authentication. In lines 3–4, the MS generates a fresh IMSI and a fresh Ki ; in line 5 these are inserted in the table. In our models, only the HN reads the table and only the MS writes it. In line 6, the MS non-deterministically decides on its encryption capability. In lines 8–9 the MS sends its capability and IMSI. The message in line 8 is the header literal CAP paired with boolean cap ms; the one in line 9 pairs the ID header with a value of type ident. In line 10, the process waits until a message is available on the public channel. The message must match the designated format or the process terminates prematurely. The syntax expresses that the message should have two parts, the first being the literal value CHALLENGE, the second being of type nonce. If the message 32

matches, the nonce gets assigned to local variable rand ms, the scope of which is the rest of the process. In lines 12 and 14, cryptographic functions are computed and their values are assigned to variables res ms and kc ms. The events in lines 16 and 19 instrument the process to facilitate specification of security properties. Event begSN records the IMSI and Kc, to express that, if the response is successfully verified by the SN, then the SN will consider that it has successfully authenticated the MS with this IMSI and established a shared key Kc with it. To specify the key secrecy, we use the technique discussed in Section 3.2.1. We declare a secret f r e e s e c r e t K c : b i t s t r i n g [ p r i v a t e ]. (∗ a secret to be protected by Kc∗)

and encrypt it under Kc, and send the ciphertext out over the public channel (line 21). The last lines of the MS process receive a message with payload, and decrypt it if encryption was chosen. The process 0 halts immediately. The process representing the SN is defined as follows. The comments refer to message numbers in Figure 3.3.

1 l e t processSN = 2 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 3 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 4 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 5 in (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , 6 x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) 7 out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) 8 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 9 i f r e s s n = x r e s s n then (∗ Check response ∗) 10 event endSN ( i m s i h n s n , k c s n ) ; 11 event begMS( i m s i h n s n , k c s n ) ; 12 out (pubChannel , (CMC, cap sn ) ) ; (∗ [ Msg 7 ] ∗) 13 in (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) 14 i f cap sn = f a l s e then 15 event disableEnc; 16 out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) 17 e l s e 18 out (pubChannel, (MSG, sencrypt(payload , kc s n ) ) ) . (∗ [ Msg 9 ] ∗) To be able to specify secrecy of data traffic following authentication, the model in- cludes message payload sent in line 16 or 18 and declared as f r e e payload : b i t s t r i n g [ p r i v a t e ].

(One might expect to generate this value using new payload inside the process code; we do not, because we need to refer to payload in specifications.) The SN encrypts payload, or not, based on the choice received in line 2. If encryption is not chosen, an event in line 15 records that fact for use in specifications. The process representing the HN is defined as follows.

1 l e t processHN = 2 in (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) 33

3 new rand hn : nonce ; (∗ Generate a fresh random number ∗) 4 get keys (= imsi hn , k i h n ) in (∗ attempt to look up key ∗) 5 l e t x r e s hn: resp = a3(rand hn , k i h n ) in 6 l e t kc hn: sessKey = a8(rand hn , k i h n ) in 7 (∗ Send out authentication vector [Msg 4] ∗) 8 out (secureChannel , (AV, imsi hn , rand hn , x r e s h n , kc hn ) ) .

In line 4 it uses the get operation on the private table of IMSI/Ki pairs for registered MSs. The process blocks at this point if there is no pair for the value received into variable imsi hn.

3.3 Security Property Specifications and Findings

This section presents the specifications of secrecy and authentication properties. We then present the analysis result which includes the proved security properties and the attacks found by ProVerif on the failed properties. We specify the properties as follows: • Key Secrecy (secrecy of Ki and Kc) 1 not attacker (new k i ) . 2 query attacker (secretKc). • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Authentication of the MS to the SN query id: ident, k: sessKey; event (endSN(id , k)) event (begSN(id , k)). • Payload Secrecy query attacker ( payload ) . • Authentication of the SN to the MS query id: ident, k: sessKey; event (endMS(id , k)) event (begMS(id , k)). Line 1 of the key secrecy specification is a secrecy assumption which is used to speed up the resolution process of ProVerif. It is assumed that the key is unknown to the attacker. At the end of the solving process, ProVerif checks that the key is indeed not known by the attacker. If the attacker learns the key, the proof fails with an error message. Line 2 specifies that the attacker does not obtain the secret secretKc. The built- in predicate attacker expresses the standard Dolev-Yao notion of “attacker knowledge” [50]: it says of a term that it can be obtained by the attacker from values that have been sent over public channels, by applying functions and rewriting by the specified equations (e.g., it can decrypt if it obtains the right key). The query of key secrecy implies that Kc remains secret since otherwise the attacker would obtain secretKc. The property is unconditional: the key remains secret regardless of whether encryption is chosen. Furthermore, because Kc is computed as a function of RAND, which is sent in the clear, and Ki , secrecy of Kc implies secrecy of Ki . (Recall that Ki is a fresh value, unguessable in the Dolev-Yao model.) 34

Table 3.1: Analysis result of GSM model Key Conditional Authentication of Payload Authentication of Secrecy Payload Secrecy the MS to the SN Secrecy the SN to the MS Proved Proved Proved Failed Failed

The conditional payload secrecy property expresses a requirement: if the at- tacker obtains the secret payload then the event disableEnc must have previously taken place in the SN. The authentication properties are specified as correspondence assertions (see Section 2.2.2). The property “Authentication of the MS to the SN” says that when- ever the event endSN occurs with some arguments id and k, there must have been a prior occurrence of event begSN with the same arguments. Note that the former event occurs in line 10 in the process of the SN; it happens only following the successful check of the expected response from the MS. This property captures authentication of the MS to the SN, because event begSN only occurs at one place, line 13 of the MS process. This query says that if the SN believes it has established a session key Kc associated with an MS using this particular IMSI, for which the HN has provided a challenge and expected response, then indeed there is an MS that reached that stage of its protocol role, for that IMSI and Kc. Note that the IMSI and Kc are parameters of the events. On the other hand, the protocol is clearly not designed to provide authenticity of the MS capability, so that is not included as an event parameter. The event endSN occurs only following successful verification in the SN, as that is the step that is intended to establish authentication. The event begSN is placed in the MS process just before it sends the response, i.e., after it has computed the Kc to which the event refers. The event should not be placed later in the MS process, because successful verification by the SN does not give the SN evidence that the MS has progressed any further. The property of payload secrecy says that payload remains secret. This is not a requirement for GSM; the attacker can certainly obtain payload, e.g., if the MS is not capable of encryption. Nonetheless, we check the property in order to gain confidence in our model, and ProVerif indeed finds a trace which we present later. Table 3.1 shows the analysis result of the above properties. The properties are proved means that there is no attacks against the properties at the Dolev-Yao (see Section 2.2.1) abstract level. ProVerif finds attacks on the failed properties. The protocol is not intended to authenticate the SN to the MS . However, as a sanity check on our model and for comparison with other AKAs, we specify the authentication property. ProVerif does find a trace that violates the property:

1 new imsi ms creating imsi m s 1 2 new ki creating ki 2 3 insert keys(imsi ms 1 , k i 2 ) 4 out (pubChannel , (CAP,true)) 5 out (pubChannel , (ID,imsi m s 1 ) ) 35

6 in ( pubChannel , (CHALLENGE, a 3 ) ) 7 event (begSN(imsi ms 1 , a8 ( a 3 , k i 2 ) ) ) 8 out (pubChannel , (RES,a3(a 3 , k i 2 ) ) ) 9 in (pubChannel , (CMC,a 4 ) ) 10 event (endMS(imsi ms 1 , a8 ( a 3 , k i 2 ) ) )

In this trace, imsi ms 1 and ki 2 are the fresh symbolic values.1 The MS sends out its encryption capability and identification in lines 4–5. The challenge and CMC messages received in line 6 and line 9 are generated and sent by the attacker. The attacker plays as a false BS and feeds the MS with arbitrary challenge and encryption option. This violates the correspondence assertion by executing the event endMS without previously executing the begMS. In this scenario, the attacker cannot provide real service. A more interesting man-in-the-middle scenario is the one ProVerif finds in violation of the payload secrecy:2

1 new imsi ms creating imsi m s 1 2 new ki creating ki 3 3 insert keys(imsi ms 1 , k i 3 ) 4 out (pubChannel , (CAP,true)) 5 out (pubChannel , (ID,imsi m s 1 ) ) 6 in (pubChannel , (CAP, false )) 7 in (pubChannel , (ID,imsi m s 1 ) ) 8 out (secureChannel , (AV REQ , i m s i m s 1 ) ) 9 new rand hn creating rand hn 2 10 get keys ( imsi ms 1 , k i 3 ) 11 out (secureChannel , (AV,imsi ms 1 , rand hn 2 , 12 a3 ( rand hn 2 , k i 3 ) , a8 ( rand hn 2 , k i 3 ) ) ) 13 out (pubChannel , (CHALLENGE, rand hn 2 ) ) 14 in (pubChannel , (CHALLENGE, rand hn 2 ) ) 15 event (begSN(imsi ms 1 , a8 ( rand hn 2 , k i 3 ) ) ) 16 out (pubChannel , (RES,a3(rand hn 2 , k i 3 ) ) ) 17 in (pubChannel , (RES,a3(rand hn 2 , k i 3 ) ) ) 18 event (endSN(imsi ms 1 , a8 ( rand hn 2 , k i 3 ) ) ) 19 event (begMS(imsi ms 1 , a8 ( rand hn 2 , k i 3 ) ) ) 20 out (pubChannel , (CMC, false )) 21 event (disableEnc) 22 out (pubChannel , (MSG,payload)) The MS sends out its encryption capability and identification in lines 4–5 of the trace. The attacker intercepts the capability message and changes it to no-encryption, so the SN receives the modified capability in line 6. In lines 9–11, the HN gener- ates the authentication vector and sends it to the SN. Lines 13–17 are the one-way challenge-response authentication between the SN and the MS. Since the SN receives

1We modified the ProVerif output to use smaller numbers, for readability. 2This trace is found by ProVerif when processSN is not replicated. Otherwise, ProVerif only finds a candidate derivation, from which we reconstruct the same attack by hand (cf. [28]). A process under replication engages in an unbounded number of sessions. 36

no-encryption from the attacker, it decides not to use encryption and sends the deci- sion to the MS in line 19. This is the same attack scenario as in the false base station attack [53]. 37

Chapter 4 Modeling and Analysis of UMTS

This chapter provides an overview of the UMTS AKA and its security goals (Sec- tion 4.1) and presents our model of the protocol (Section 4.2), the specifications of security properties, and our findings (Section 4.3). We assume readers are familiar with GSM as presented in Chapter 3. So we go quickly and focus on what’s new and different. In Chapter 6, we revisit authentication properties of UMTS in contrast to GSM and LTE.

4.1 Overview of UMTS AKA

This section describes the UMTS AKA and informally specifies the security goals. Figure 4.1 shows the architecture of a UMTS network [94, 76]. The figure is borrowed from [76]. As in GSM, UMTS entities are grouped into three domains: the MS, the SN, and the HN. The Universal Subscriber Identity Module (USIM ) is similar in functionality to the SIM of the GSM network. The Universal Terrestrial Radio Access Network (UTRAN ) is the access network for UMTS networks. The UTRAN is subdivided into individual Radio Network Subsystems (RNS), which consist of Radio Network Controllers (RNC ) and NodeBs. Like the BSC of the GSM network, the RNC is the controlling unit of the UTRAN. Following the GSM model, a single controller (RNC) may possibly control a large number of base stations, which are referred to as NodeBs. Figure 4.2 shows the UMTS AKA. The workings to facilitate the connecting of an MS to a BS of an SN in UMTS follows the same principles as those in GSM. The main differences between the workings in GSM and UMTS are that those in UMTS are intended to provide mutual authentication of the MS and the SN and they also support integrity protection and freshness guarantees. Specifically, in UMTS II, upon receiving an authentication request from the SN (Message 5 in Figure 4.2), the HN computes an authentication vector that is more extensive than the one issued in GSM. In addition to determining a challenge response pair RAND and XRES as in GSM, in UMTS the HN also computes a Message Authentication Code (MAC ), a Cipher Key (CK ), an Integrity Protection Key (IK ), and an Anonymity Key (AK ). At the core of all computations again is the random nonce RAND as well as the pre-shared key Ki. In addition, the UMTS specification includes a so-called Sequence Number (SQN ) as well as an Authentication Management Field (AMF). In UMTS III, upon receiving the authentication vector (Message 6), the SN initiates the challenge response exchange with the MS as was the case in GSM. Unlike in GSM, the MS receives the Authentication Token (AUTN ) as part of Message 7 which allows the MS to determine whether or not this is a fresh authentication chal- 38

SN HN

VLR MSC MSC

UTRAN HLR

RNC

MS NodeB NodeB AuC

ME + USIM

MS: Mobile Station Node B: Base Transceiver Station VLR: Visitor Location Register ME: Mobile Equipment MSC: Mobile Switching Center RNC: Radio Network Controller SN: Serving Network HLR: Home Location Register AuC: Authentication Center HN: Home Network USIM: Universal Subscriber Identity Module UTRAN: Universal Terrestrial Radio Access Network

Figure 4.1: UMTS architecture [94, 76] lenge. Upon receiving the response RES from the MS (Message 8), the SN checks whether or not it matches XRES. If so, then the MS has successfully authenticated to the SN. In UMTS IV, the SN then proceeds to deciding on the encryption algorithm. In GSM, the SN only informs the MS of its choice of encryption algorithm to be used to protect the subsequent communication. In contrast, in UMTS, the SN includes the CAP (which include both the MS’s encryption and integrity protection capabilities) in its message to the MS as it received them as part of Message 1. Message 10 is integrity protected. Based on Message 10, the MS can verify that the SN received the CAP as the MS sent them. In addition, the integrity protecting as part of Message 10 allows the SN to authenticate itself to the MS. The security of UMTS networks is based and built on the security of GSM networks. However, UMTS provides new and enhanced security features. UMTS provides mutual authentication between the MS and the SN. The SN has correctly authenticated the MS if RES matches XRES. In turn, the authentication of the SN by the MS requires two conditions: First, the AUTN (sent in Message 7) must be fresh—preventing the replay of authentication data—and second, there must be a correctly integrity-protected Message 10. The mandatory integrity protection in UMTS prevents the insertion and modification of messages between the MS and the BS. This integrity protection enables the MS to verify the instruction from the SN (Message 10) and also provides protection against bidding-down attacks [53] where an attacker forces to not use any protection on the traffic between the MS and the 39

MS BS MSC HN 1. CAP

UMTS 2. TMSI 3. User ID Request

I 4. IMSI

5. IMSI

UMTS Generate RAND & SQN MAC = f1(Ki, AMF, SQN, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND)

II IK = f4(Ki, RAND), AK = f5(Ki, RAND) AUTN = SQNAK || AMF || MAC

6. RAND, XRES, CK, IK, AUTN

7. RAND, AUTN

UMTS RES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AK = f5(Ki, RAND) SQN = 1st(AUTN) AK

XMAC = f1(Ki, 2nd(AUTN), SQN, RAND)

III Verify 3rd(AUTN) = XMAC

Verify SQN is in correct range

8. RES Verify RES = XRES

9. CK, IK

UMTS Decide algorithms ALG, Generate FRESH MAC-I = f9((ALG, CAP, FRESH), IK)

IV 10. ALG, CAP,

FRESH, MAC-I XMAC-I = f9((ALG, CAP, FRESH), IK) Verify MAC-I = XMAC-I, Verify CAP 11. SMComplete

Figure 4.2: UMTS AKA [94, 76]

SN. The following security properties are expected:

• Key Secrecy The pre-shared key Ki, the cipher key CK , and the integrity key IK should be unknown to the attacker.

• Conditional Payload Secrecy The data traffic should remain unknown to the attacker if the SN chooses to use encryption.

• Mutual Authentication between the MS and the SN The UMTS AKA is designed to provide for the mutual authentication between the MS and the SN. 40

It is clear that UMTS does not preserve the payload secrecy. For example, if the SN decides not to use encryption, the attacker can learn the payload.

4.2 Modeling the UMTS AKA

In this section we provide an overview of the main design choices and design rationales in modeling UMTS. We also present detailed explanation of the ProVerif model.

4.2.1 Design Choices The UMTS model reuses the design choices used in the GSM model. In this section, we describe the additional design choices used in the UMTS model. In UMTS, the authentication vectors generated by the HN include sequence number SQNs to help ensure freshness. Both the MS and the HN keep track of their own counters of SQN respectively. In particular, the HN keeps track of an individual counter SQN for each user. The MS stores the highest sequence number it has accepted in the USIM. When the MS receives the challenge message, it verifies the received SQN is in the correct range. If we model SQNs, they could be represented by integers.1 We tried model without SQN and we could prove the expected properties. So we omit the SQN for simplicity. Moreover, in case of finding an attack, we could have changed the model to include the SQN in the authentication vector to check whether this affected the results. In the UMTS standard, each authentication vector also includes an AMF to indicate whether this authentication vector is used in Evolved Packet System (EPS) context or non-EPS (GSM or UMTS) context. This could be modeled by adding a boolean variable which indicates whether the EPS context is in use. AMF is also used to support multiple AKA algorithms for disaster recovery purpose, to change SQN verification parameters and to set the lifetime of keys. Since we model in UMTS context, which is non-EPS context, and do not model the feature of SQN verification and key lifetime, we also do not include the AMF in our model.

4.2.2 UMTS Model In this section, we discuss the UMTS model along with the diagram annotated ac- cord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S2_UMTS_I-IV.pv. In Figure 4.3 we augment the protocol diagram of Figure 4.2 with details of the ProVerif model. Figure 4.3 also shows the locations of the events which are used in correspondence assertions to specify authentication properties. As with GSM, we

1As described in [28], the integers can be modeled as: zero is 0; the successor of an integer i can be represented by a constructor succ( i ); and two integers (i , j) is compared by a predicate geq(i , j). 41

MS SN HN

UMTS I UMTS 1. CAP 2. IMSI

3. IMSI

UMTS II UMTS Generate rand_hn, Compute mac_hn, xres_hn, ck_hn, ik_hn and autn_hn 4. IMSI, RAND, XRES,

CK, IK, AUTN 5. RAND, AUTN Compute res_ms, ck_ms, ik_ms, xmac_ms UMTS IIIUMTS Verify mac_ms=xmac_ms

event begSN(imsi_ms, ck_ms, ik_ms) 6. RES

Verify res_sn = xres_sn event endSN(imsi_hn_sn, ck_sn, ik_sn)

Decide whether to use encryption Generate fresh_sn, Compute mac_i_sn

UMTS IV UMTS event begMS(imsi_hn_sn, ck_sn,ik_sn, cap_sn)

7. cap_sn,

CAP, FRESH, MAC-I Verify CAP, MAC-I if cap_sn is false event endMS(imsi_ms, ck_ms, ik_ms, cap_ms) event disableEnc

8. SMComplete, integrity protected

9. payload, FRESH, MAC, if no encryption {payload}_ck_sn, FRESH, MAC, otherwise VerifyMAC, decrypt message if alg_ms supports encryption

Figure 4.3: UMTS AKA (Figure 4.2) annotated in accord with our model

omit the TMSI and ID Request messages. As mentioned in Section 4.2.1, we also abstract from the SQN and AMF, which are included in the standard. In addition to the types defined in the GSM model (Section 3.2.2), we also define the types for UMTS session keys and message MACs. type c ip h e rK e y . type integKey . type msgMac . The following constructors and destructors are defined in our model: fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): msgMac. fun s e n c r y p t ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; sdecrypt(sencrypt(m, k), k) = m. fun sencryptInteg( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; 42

sdecryptInteg(sencryptInteg(m, k), k) = m. UMTS authentication establishes the cipher key CK and the integrity key IK , so these are included in the parameters of the events. The protocol also ensures authenticity of the MS capability, which is also included as an event parameter in the correspondence assertion expressing the authentication of the SN to the MS. The events are declared as: event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). The process of the MS is as follows. The comments refer to message numbers in Figure 4.3.

1 l e t processMS = 2 (∗ registration and setup ∗) 3 new imsi ms : i d e n t ; 4 new k i : key ; 5 insert keys(imsi ms , k i ) ; 6 l e t cap ms : bool = encCapability() in (∗ choose capability ∗) 7 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 8 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 9 in ( pubChannel , (=CHALLENGE, rand ms : nonce , 10 mac ms : mac ) ) ; (∗ [ Msg 5 ] ∗) 11 i f f 1 ( ki , rand ms ) = mac ms then 12 l e t res ms: resp = f2(ki, rand ms ) in 13 l e t ck ms: cipherKey = f3(ki, rand ms ) in 14 l e t ik ms: integKey = f4(ki, rand ms ) in 15 event begSN ( imsi ms , ck ms , ik ms ) ; 16 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 17 in (pubChannel , (=SMC, enableEnc ms : bool , =cap ms , 18 f r e s h ms: nonce, =f9((enableEnc ms , cap ms , f r e s h m s ) , 19 ik ms ) ) ) ; (∗ [ Msg 7 ] ∗) 20 event endMS( imsi ms , ck ms , ik ms , cap ms ) ; 21 out (pubChannel , (SMComplete, f9(smcompleteMsg, ik ms ) ) ) ; 22 (∗ [ Msg 8 ] ∗) 23 in (pubChannel , (=MSG, msg: b i t s t r i n g , fresh msg ms : nonce , 24 =f9((msg, fresh msg ms ) , ik ms ) ) ) ; (∗ [ Msg 9 ] ∗) 25 out (pubChannel, sencrypt(secretCk , ck ms ) ) ; 26 out (pubChannel, sencryptInteg(secretIk , ik ms ) ) ; 27 i f enableEnc ms = t r u e then 28 l e t msgcontent: b i t s t r i n g = sdecrypt(msg, ck ms ) in 0 . The registration process of the MS device is modeled in lines 2–5. The MS generates the identification (IMSI) and the pre-shared key (Ki) and inserts them into the table. As in the GSM model, only the HN process reads from the table and only the MS process writes to it. Upon receiving the integrity-protected challenge in lines 9–10, the MS first verifies the MAC (line 11), and then computes the responses and keys (lines 12–14). In lines 17–19 it checks that Message 7 has the two expected values, 43

and in lines 23–24 it checks for the expected value in Message 10. As in GSM, to specify the secrecy of CK and IK , we use the technique discussed in Section 3.2.1. We declare secret values f r e e s e c r e t C k : b i t s t r i n g [ p r i v a t e ]. f r e e s e c r e t I k : b i t s t r i n g [ p r i v a t e ]. and encrypt it under CK and under IK respectively, and send the ciphertexts out over the public channel (lines 25–26 in the process of the MS). The process of the SN is defined as follows. The comments refer to message numbers in Figure 4.3.

1 l e t processSN = 2 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 3 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 4 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 5 in (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , 6 x r e s s n : resp , c k sn: cipherKey, ik sn: integKey, 7 mac sn : mac ) ) ; (∗ [ Msg 4 ] ∗) 8 out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) 9 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 10 i f r e s s n = x r e s s n then 11 event endSN ( i m s i h n s n , ck sn , i k s n ) ; 12 new f r e s h s n : nonce ; 13 event begMS( i m s i h n s n , ck sn , i k s n , cap sn ) ; 14 out (pubChannel , (SMC, cap sn , cap sn , f r e s h s n , 15 f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 7 ] ∗) 16 in (pubChannel , (=SMComplete, =f9(smcompleteMsg, ik s n ) ) ) ; 17 (∗ [ Msg 8 ] ∗) 18 new f r e s h m s g s n : nonce ; 19 i f cap sn = f a l s e then 20 event disableEnc; 21 out (pubChannel, (MSG, payload , fresh m s g s n , 22 f9((payload , fresh m s g s n ) , i k s n ) ) ) (∗ [ Msg 9 ] ∗) 23 e l s e 24 out (pubChannel, (MSG, sencrypt(payload , ck s n ) , f r e s h m s g s n , 25 f9((sencrypt(payload , ck s n ) , f r e s h m s g s n ) , i k s n ) ) ) . 26 (∗ [ Msg 9 ] ∗) In lines 5–7, the SN receives the authentication vector from the HN on the secure channel. After checking that the response received from the MS matches the expected response in line 9, the SN sends out the integrity-protected SMC message (in lines 14– 15), and includes the capabilities of the MS (received at line 2) in the SMC message. The process of the HN is defined as follows.

1 l e t processHN = 2 in (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) 3 new rand hn : nonce ; 4 get keys (= imsi hn , k i h n ) in 5 l e t mac hn: mac = f1(ki hn , rand hn ) in 6 l e t x r e s hn: resp = f2(ki hn , rand hn ) in 44

7 l e t ck hn: cipherKey = f3(ki hn , rand hn ) in 8 l e t i k hn: integKey = f4(ki hn , rand hn ) in 9 out (secureChannel , (AV, imsi hn , rand hn , x r e s h n , 10 ck hn , ik hn , mac hn ) ) . (∗ [ Msg 4 ] ∗) As in the GSM model, the HN gets the pre-shared key in line 4 and sends out the authentication vector on the secure channel in lines 9–10, which includes the integrity protection computed in line 5.

4.3 Security Property Specifications and Findings

This section presents the specifications of secrecy and authentication properties. We then present the analysis result of the security properties. The secrecy and authentication properties are specified similarly to those in the GSM model. • Key Secrecy (secrecy of Ki, CK, and IK) 1 not attacker (new k i ) . 2 query attacker (secretCk). 3 query attacker (secretIk). • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Mutual Authentication between the MS and the SN 1 query x1: ident, x2: cipherKey, x3: integKey; 2 event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 3 query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; 4 event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). • Payload Secrecy query attacker ( payload ) . As in GSM, the secrecy assumption in line 1 of the key secrecy stipulates that the pre-shared key Ki cannot be learned by the attacker. The query of conditional payload secrecy specifies that if the SN has enabled encryption, then the data traffic remains secret (in contrast with the property specified in “Payload Secrecy”, this property is conditional). The payload secrecy, which specifies the secrecy of data traffic, fails as expected: as in GSM, the MS can choose no-encryption, and regardless of the choice the attacker can modify the capability message to claim the MS has no encryption. However, if the MS chooses the capability of encryption and the attacker modifies that, this will be detected by the MS (in line 13 in the process of the MS) which will stop responding. Table 4.1 shows the analysis result of the above properties. Recall that we omit the SQN when modeling the protocol, the mutual authentication properties are proved by ProVerif. The purpose of using SQN is to provide fresh authentication vector, so that an attack in which the attacker records earlier authentication challenge and re-uses it to establish session keys is prevented. Since we model a single round of the AKA, the result shows that SQN is not needed in single round authentication. 45

Table 4.1: Analysis result of UMTS model Key Conditional Authentication of Payload Authentication of Secrecy Payload Secrecy the MS to the SN Secrecy the SN to the MS Proved Proved Proved Failed Proved 46

Chapter 5 Modeling and Analysis of LTE

This chapter provides an overview of the LTE AKA and its security goals (Section 5.1) and presents our model of the protocol (Section 5.2), the specifications of security properties, and our findings (Section 5.3). Like Chapter 4, we go quickly and focus on what’s new and different from GSM and UMTS. We revisit the authentication properties of LTE in Chapter 6 where we will compare them with the ones in GSM and UMTS.

5.1 Overview of LTE AKA

This section describes the LTE AKA and informally specifies the security goals. In contrast to GSM and UMTS, LTE provides different key hierarchy. LTE also intro- duces the security context concept. In addition, LTE provides implicit authentication of the serving network’s identity by binding the serving network identity with the keys. Figure 5.1 shows the architecture of a LTE network [94, 52]. Entities are grouped into three domains (the MS domain, the SN domain, and the HN domain), which function similarly to those in GSM and UMTS. Unlike the UTRAN (see UMTS architecture Figure 4.1), which has a star model (each RNC controls many BSs), the structure of the Evolved Universal Terrestrial Radio Access Network (E-UTRAN ) is quite simple. It is only composed of one network element: the evolved Node B (eNB), which directly connects to the Mobility Management Entity (MME). The features supported by the BS controller (BSS in GSM, RNC in UMTS) have been distributed between the eNB and the MME. The MME is the main control element for the access network. It initiates the authentication, keeps track of the location of the MSs, retrieves the MSs’ subscription profile from the HN, and manages service connectivity. In contrast to UMTS security, LTE introduces an enhanced key derivation hier- archy that allows the distinguishing of protection mechanisms on Non Access Stratum (NAS) and Access Stratum (AS). The NAS traffic is the communication between the MS and the MME. The AS traffic is the communication between the MS and the eNB. In addition, LTE defines a comprehensive security context framework, including native vs. mapped security contexts, current vs. non-current security contexts, and full vs. partial contexts [8]. A security context typically consists of a set of security parameters including cryptography keys and identifiers for respective cryptographic mechanisms. A native security context is established by a run of LTE AKA, while a mapped security context is converted from another system during inter-system mo- bility 1. A current security context is the one which is activated most recently, while

1Security context has already existed before inter-system mobility, while interoperation scenario 47

SN HN

VLR MME MME

E-UTRAN HLR NAS eNodeB

MS eNodeB AuC AS ME + USIM

MS: Mobile Station MME: Mobility Management Entity VLR: Visitor Location Register ME: Mobile Equipment HLR: Home Location Register AuC: Authentication Cente SN: Serving Network eNodeB: Base Transceiver Station (evolved NodeB) HN: Home Network USIM: Universal Subscriber Identity Module E-UTRAN: Evolved Universal Terrestrial Radio Access Network AS: Access Stratum NAS: Non-Access Stratum

Figure 5.1: LTE architecture [94, 52] a non-current one is not currently activated and exists simultaneously with the cur- rent one. A full security context contains the NAS keys and the identifiers of the NAS cipher and integrity algorithms, while a partial security context does not in- clude them, i.e., no successful NAS Security Mode Command (SMC ) procedure has been run for a partial security context. A partial native security context is always a non-current security context and it can be transformed into a full native security context by executing the NAS SMC procedure. The goal of the LTE AKA is to provide mutual authentication between the MS and a specific SN with a SN identifier and to establish a security context to protect the communication between the MS and the SN. Figure 5.2 shows the authentication scenario. The LTE AKA can be triggered by the initial network attach request, the Tracking Area Update (TAU ) request, or the service request [5]. When a NAS signalling connection exists, the network can initiate an AKA at any time [5]. Before the service request or the NAS signalling connection establishing, the attach request must have already been executed [5]. Therefore, the first block of the LTE AKA can contain an attach request or a TAU request. If the AKA starts with an attach request, the first block (LTE I in Figure 5.2) contains the transmission of the identity and the security capabilities of the MS. If instead of the initial network attach request, the AKA starts with a TAU request, in the first block (LTE I’, Figure 5.3), an additional nonce NONCEMS is sent to the MME. The nonce in the TAU request is only used when mapping an UMTS to in this work is used to establish initial security context. Inter-system mobility could be idle mode mobility or handover. 48

MS BS MME HN

1.CAP LTE LTE 2. GUTI

3. Identity Request

I 4. IMSI 5. IMSI, SNid, Network Type Generate RAND & SQN LTE LTE MAC = f1(Ki, AMF, SQN, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND)

II IK = f4(Ki, RAND), AK = f5(Ki, RAND) AUTN=SQNAK || AMF || MAC KASME=KDF(CK, IK, SNid, SQNAK) 6. RAND, AUTN, XRES, KASME

7. RAND, AUTN, KSIASME

AK = f5(Ki, RAND), SQN = 1st(AUTN)AK

LTE LTE Verify SQN in correct range XMAC = f1(Ki, 2nd(AUTN), SQN, RAND) rd Verify 3 (AUTN) = XMAC, RES = f2(Ki, RAND)

III CK = f3(Ki, RAND), IK = f4(Ki, RAND)

st KASME = KDF(CK, IK, SNid, 1 (AUTN)) 8. RES

Verify RES = XRES

KNASenc = KDF (KASME, NAS-enc-alg, Alg-ID) KNASint = KDF(KASME, NAS-int-alg, Alg-ID) Decide NAS-Algs, NAS-MAC = EIA((CAP, Algs),KNASint) 9. CAP, NAS-Algs, [NONCES], NAS-MAC LTE LTE KNASenc = KDF (KASME, NAS-enc-alg, Alg-ID) K = KDF(K , NAS-int-alg, Alg-ID) NASint ASME

IV XNAS-MAC = EIA((CAP, Algs),KNASint) Verify XNAS-MAC = NAS-MAC Start ciphering/deciphering and integrity protection 10. NAS SMComplete ciphered , integrity protected Verify integrity of message 10

KeNB = KDF(KASME)

11. CAP, KeNB

KeNB = KDF (KASME) KRRCenc = KDF (KeNB, RRC-enc-alg, Alg-ID) KRRCint = KDF(KeNB, RRC-int-alg, Alg-ID) KUPenc = KDF (KeNB, UP-enc-alg, Alg-ID) Decide AS-Algs, AS-MAC = EIA(Algs, KRRCint)

LTE LTE 12. AS-Algs, AS-MAC

V KeNB = KDF (KASME)

KRRCenc = KDF (KeNB, RRC-enc-alg, Alg-ID) KRRCint = KDF(KeNB, RRC-int-alg, Alg-ID) KUPenc = KDF (KeNB, UP-enc-alg, Alg-ID) XAS-MAC = EIA(Algs, KRRCint) Verify XAS-MAC = AS-MAC 13. AS SMComplete Integrity protected Verify integrity of message 13

Figure 5.2: LTE AKA an EPS security context [8]. However, since the MS does not know when the mapping will happen, the nonce is always included in the TAU request message [52]. In LTE AKA, the nonce is never used. So the first block is always LTE I. LTE I’ will be used in one interoperation scenario (Chapter 9). In LTE II, the HN derives the authentication vector from the UMTS authen- tication vector (Section 4.1). Unlike in GSM and UMTS, the HN derives the master key KASME and provides it to the MME together with the respective authentication 49

MS BS MME

1. CAP LTE LTE 2. GUTI

3. NONCE_MS

I

4. Identity Request 5. IMSI

Figure 5.3: LTE I’ when the AKA starts with a TAU request

vector. The id of the SN is an input to the key KASME derivation, i.e., the derived key is bound to a specific MME. In LTE III, the MME sends the authentication challenge, which includes the random challenge RAND, the authentication token AUTN , and the key identifier KSIASME . The KSIASME is used to identify the KASME and the session keys derived from the KASME . Upon receiving the challenge, the MS verifies the freshness and the integrity of the authentication vector. The MS then computes the response and the master key and sends the response to the MME. The MME then checks whether the response matches the expected response. After executing the challenge-response procedure (LTE III), the MS and the MME proceed to the NAS SMC procedure (LTE IV) in which the MME derives the NAS encryption and integrity keys and decides the encryption and integrity protection algorithms based on the capabilities of the MS. The decided algorithms, along with the CAP received as part of message 1, are sent from the MME to the MS in an integrity protected NAS SMC message. Upon the receipt of the SMC message, the MS verifies the integrity of the message and confirms that the security capabilities match the ones the MS has sent out. In case starting with LTE I’, if the KASME is derived by the MME taking the nonces NONCEMS and NONCEMME as input, both nonces are included in the integrity protected message. In such case, in addition to the capabilities, the MS also verifies the NONCEMS matches the one originally sent in LTE I’ (this is discussed further in Chapter 9). When the MS needs to send or receive data, the AS SMC procedure is exe- cuted. The MME sends the MS’s security capabilities and KASME to an eNB, which decides the AS algorithms and derives the eNB key KeNB from the KASME . The eNB also derives the encryption and integrity protection keys for the Radio Resource Control (RRC ) traffic and the User Plane (UP) traffic. The RRC keys are used to encrypt and protect the integrity of RRC signaling traffic. The UP cipher key is used to encrypt user data. The AS security context is established by sending the AS SMC message from the eNB to the MS. The AS SMC message contains the selected algorithms and is integrity protected with the RRC integrity key. The AS security mode complete message replied by the MS is also integrity protected with the RRC integrity key. The AS SMC message does not include the security capabilities of the 50

MS. The LTE AKA provides mutual authentication between the MS and the SN. Because the master key KASME is derived using the SN identity as a parameter, and the cipher and integrity keys are derived from the master key. The successful use of derived keys enables the MS to indirectly authenticate the specific MME. The following security properties are expected:

• Key Secrecy The pre-shared key Ki, the local master key KASME , the eNB key KeNB , and the derived NAS and AS integrity keys and cipher keys should be unknown to the attacker.

• Conditional Payload Secrecy The data traffic should remain unknown to the attacker if the SN chooses to use encryption.

• Mutual Authentication between MS and MME The 4G AKA is designed to provide for the mutual authentication between the MS and the specific MME.

• Authentication of the BS to the MS The 4G AKA is designed to provide for the authentication of the BS to the MS.

It is clear that 4G does not preserve the payload secrecy. For example, if the SN decides not to use encryption, the attacker can learn the payload.

5.2 Modeling the LTE AKA

In this section we provide an overview of the key design choices and design rationales. We also present detailed explanation of the ProVerif model.

5.2.1 Design Choices The LTE model reuses the design choices used in the GSM and UMTS model. In this section, we discuss the design choices that distinguish our model from the GSM and UMTS models. Abstracting the KSI from the authentication challenge message: When challenging the MS in the AKA, the MME includes the KSIASME , which is allocated by the MME and used to identify the KASME . The purpose of the KSIASME is to identify a native KASME without invoking the AKA. Since we model a fresh AKA, the KSIASME is omitted from the authentication challenge message. Including both the IMSI and the SN identity in the authentication data response message: We explain the design choice of including the IMSI in the authentication data response message in Section 3.2.1 (due to the approximations of 51

ProVerif, false attack can be found without the MS identity in the authentication data response message). For similar reasons, the SN identity is also included in the authentication data response message. Including the SN identity in the authentication challenge message: The SN identity is included in the authentication challenge message, which is not specified in the standard. During the AKA, both the HN and the MS compute the KASME from CK , IK , and SN identity. However, the specification does not include how the MS gets the SN identity. We model the MS to obtain the SN identity through the authentication challenge message. Separating the eNB process from the MME process: Two main com- ponents of the SN are the MME and the eNB. As mentioned in Section 5.1, the NAS SMC messages are exchanged between the MME and the MS and the AS SMC mes- sages are exchanged between the eNB and the MS. In the model, both the NAS and AS SMC procedures are included. We use a separate eNB process to specify the AS SMC procedure. Modeling communication between the BS and the MME using a private channel In addition to assuming the security of communication between the MME and the HN, we also assume that communication between the eNB and the MME is secure. For this reason, a private channel is declared to model the secure communication between the BS and the MME.

5.2.2 LTE Model In this section, we present the LTE model along with the diagram annotated ac- cord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S3_LTE_I-V.pv. Figure 5.4 augments the protocol diagram of Figure 5.2 with details of the ProVerif model. As mentioned before, the MME communicates with the HN and BS on secure channels. (∗ Secure channel between MME and HN ∗) f r e e secureChannel: channel [ p r i v a t e ]. (∗ Secure channel between MME and BS ∗) f r e e sChannelSnBts: channel [ p r i v a t e ]. In addition to the built-in types, we declare additional types. type key . (∗ pre−s h a r e d Ki ∗) type i d e n t . (∗ identity of the MS and the SN ∗) type nonce . (∗ random number ∗) type msgHdr . (∗ message header ∗) type r e s p . (∗ r e s p o n s e ∗) type c ip h e rK e y . (∗ cipher key in UMTS authentication vectors ∗) type integKey . (∗ integrity key in UMTS authentication vectors ∗) type mac . (∗ mac in authentication vectors ∗) type msgMac . (∗ integrity protection of messages ∗) type asmeKey . (∗ K ASME ∗) 52

MS BS MME 4G HN

LTE I LTE 1.CAP 2. IMSI

3. IMSI, SNid, Network Type

LTE IILTE Generate RAND ,MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

KASME=KDF(CK, IK, SNid) 4. IMSI, SNid RAND, AUTN, XRES, KASME 5. RAND, AUTN, SNid XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND)

LTE IIILTE CK = f3(Ki, RAND), IK = f4(Ki, RAND) KASME = KDF(CK, IK, SNid,) 6. RES

Verify RES = XRES

KNASenc = KDF (KASME,), KNASint = KDF(KASME,) Decide enableEnc?, NAS-MAC = EIA((enableEnc, CAP), KNASint)

event begMS(imsi_sn, snid_sn, kasme_sn, cap_sn) 7. eableEnc, CAP, NAS-MAC

KNASenc = KDF (KASME), KNASint = KDF(KASME) XNAS-MAC = EIA((CAP, enableEnc), KNASint) LTE IV LTE Verify XNAS-MAC = NAS-MAC Start ciphering/deciphering and integrity protection

event endMS(imsi_ms, snid_ms, kasme_ms, cap_ms) event begSN(imsi_ms, snid_ms, kasme_ms) 8. NAS Security Mode Complete ifenableEnbciphered , integrity protected otherwise integrity protected Verify the integrity of message 8 event endSN(imsi_sn, snid_sn, kasme_sn)

KeNB = KDF(KASME)

9. CAP, KeNB

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) Decide enableENC, AS-MAC = EIA(enableEnc, KRRCint) Start integrity protection

LTE V LTE event begMS_ENB(imsi_sn, kenb_sn, cap_sn)

10. enableEnc, AS-MAC

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) XAS-MAC = EIA( enableEnc, KRRCint) Verify XAS-MAC = AS-MAC

event endMS_ENB(imsi_ms, kenb_ms, cap_ms)

11. AS SMC Complete Integrity protected

12. payload, if no encryption {payload}_KRRCenc, otherwise

Decrypt message ifenableEnc_ms is true

Figure 5.4: LTE AKA (Figure 5.2) annotated in accord with our model type nasEncKey . (∗ NAS encryption key ∗) type nasIntKey . (∗ NAS inegerity key ∗) 53

type enbKey . (∗ type o f K enb ∗) type asEncKey . (∗ AS encryption key ∗) type a s I n t K e y . (∗ AS integrity key ∗) type upEncKey . (∗ UP encryption key ∗) Similarly to the GSM and UMTS model, we also define a number of distinct constant values as message headers to identify messages (not shown). The key derivation functions and the cryptographic functions are declared as: fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun kdf asme(cipherKey , integKey , ident): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun k d f enb(asmeKey): enbKey. fun k d f a s enc(enbKey): asEncKey. fun k d f a s int(enbKey): asIntKey. fun k d f u p enc(enbKey): upEncKey. fun f i n t e g a s ( b i t s t r i n g , asIntKey): msgMac. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , asEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asEncKey; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , asIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asIntKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m. fun senc up ( b i t s t r i n g , upEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: upEncKey; sdec up ( senc up(m, k), k) =m. The type system of ProVerif occasionally makes it difficult to apply functions to arguments due to type mismatches. We can overcome this by defining a special type of constructor, which acts as an identity function. We define a type converter which converts bool into bitstring . fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. The type converter just changes the types and has no other effect. Because the type converter constructor is declared as a data constructor, the attacker can construct and decompose it. That means the attacker can recover b from the term bool2bitstring (b). Recall that ProVerif statically checks types, to aid debugging, but ignores types during reasoning. We use this default option. Therefore, the functions marked typeConverter are removed when generating Horn clauses. 54

The non-deterministic choice of the MS’s capabilities and the table used to model the association of keys and identities are the same as those in the GSM model. The events used in the correspondence assertions to specify the authentication properties are declared as: event begSN(ident , ident , asmeKey). event endSN(ident , ident , asmeKey). event begMS(ident , ident , asmeKey, bool ). event endMS(ident , ident , asmeKey, bool ). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). There are four main processes in our model representing the behavior of the MS, the eNB, the MME, and the HN respectively. In the models of GSM (Section 3.2.2) and UMTS (Section 4.2.2), the SN is represented by a single process. The reason that the SN can be modeled in one process is that it is assumed that the communication between the BS and the MSC is secure. We could also model the SN in LTE in one process, however, because the NAS SMC procedure has two options to enable encryption or not. The AS SMC procedure, which is modeled in the eNB process, is executed in both options. To avoid duplicating code, we could model the AS SMC procedure as a parameterized procedure (as in the MS process) or as a separate process. We choose to model it as a process, since it is natural to model a component as a process. The MS process is defined as follows. The comments refer to message numbers in Figure 5.4.

1 (∗ AS SMC procedure in process MS ∗) 2 l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = 3 l e t kenb ms: enbKey = kdf e n b ( kasme ms ) in 4 l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) in 5 l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) in 6 l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) in 7 in (pubChannel , (=ASSMC, enableEnc as ms : bool , =f i n t e g a s 8 (bool2bitstring(enableEnc as ms ) , k a s i n t m s ) ) ) ; (∗ [ Msg 10] ∗) 9 out (pubChannel , (ASSMComplete, as smcomplete msg , 10 f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 11] ∗) 11 event endMS ENB( imsi ms , kenb ms , cap ms ) ; 12 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , 13 =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 12] ∗) 14 out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; 15 out (pubChannel, senc i n t as(secret , kasint m s ) ) ; 16 out (pubChannel , senc up(secret , kupenc ms ) ) ; 17 i f enableEnc as ms = t r u e then 18 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) in 0 . 19 20 (∗ process respresenting MS ∗) 21 l e t processMS = 22 new imsi ms : i d e n t ; 23 new k i : key ; 55

24 insert keys(imsi ms , k i ) ; 25 l e t cap ms : bool = encCapability() in 26 out (pubChannel , (CAP, cap ms ) ) ; 27 out (pubChannel, (ID, imsi ms ) ) ; 28 in ( pubChannel , (=CHALLENGE, rand ms : nonce , 29 =f1(ki , rand ms ) , snid ms: ident)); (∗ [ Msg 5 ] ∗) 30 l e t res ms: resp = f2(ki, rand ms ) in 31 l e t ck ms: cipherKey = f3(ki, rand ms ) in 32 l e t ik ms: integKey = f4(ki, rand ms ) in 33 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , snid ms ) in 34 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 35 l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) in 36 l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) in 37 in (pubChannel , (=NASSMC, enableEnc nas ms : bool , =cap ms , 38 =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; 39 (∗ [ Msg 7 ] ∗) 40 event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; 41 out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; 42 out (pubChannel, senc i n t nas(secret , knasint m s ) ) ; 43 event begSN ( imsi ms , snid ms , kasme ms ) ; 44 i f enableEnc nas ms = f a l s e then 45 out (pubChannel , (NASSMComplete, nas smcomplete msg , 46 f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) 47 pMSAS( kasme ms , imsi ms , cap ms ) 48 e l s e 49 out (pubChannel , (NASSMComplete, 50 s e n c r y p t n a s ( nas smcomplete msg, knasenc ms ) , 51 f i n t e g nas(sencrypt n a s ( nas smcomplete msg , 52 knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) 53 pMSAS( kasme ms , imsi ms , cap ms ) . Similarly to the GSM model, this model specifies the registration process of the MS device in lines 22–24. In lines 28–29, the MS receives and checks the authentication challenge message. The MS computes the KASME in line 33. In lines 37–39, the MS receives the NAS SMC message and verifies the integrity and the received capabil- ities. The MS then sends out the SMC complete message which is ciphered if the encryption is enabled and integrity protected (lines 45–46 or 49–52). Lines 47 and 53 call a parameterized process which specifies the AS SMC procedure in lines 3–10 and receives the data message in lines 12–13. As in the GSM model, to test the secrecy of the keys, the MS encrypts a private free name with the keys, and sends them out on the public channel (lines 41–42 and 14–16). The process representing the MME is defined as follows. The comments refer to message numbers in Figure 5.4.

1 l e t processMME = 2 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 3 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 4 new s n i d s n : i d e n t ; 5 out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) 6 in (secureChannel , (=AV, =imsi s n , =s n i d s n , r a n d s n : nonce , 56

7 x r e s sn: resp, mac sn: mac, kasme sn: asmeKey)); (∗ [ Msg 4 ] ∗) 8 out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; 9 (∗ [ Msg 5 ] ∗) 10 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) 11 event begMS( i m s i s n , s n i d s n , kasme sn , cap sn ) ; 12 l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) in 13 l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) in 14 out (pubChannel , (NASSMC, cap sn , cap sn , 15 f i n t e g n a s ( ( cap sn , cap sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) 16 in (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , 17 =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) 18 i f cap sn = t r u e then 19 i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then 20 event endSN ( i m s i s n , s n i d s n , kasme sn ) ; 21 out (sChannelSnBts , (kasme sn , i m s i s n , cap sn ) ) 22 e l s e 0 23 e l s e 24 i f cap sn = f a l s e then 25 i f msg nas = nas smcomplete msg then 26 event endSN ( i m s i s n , s n i d s n , kasme sn ) ; 27 out (sChannelSnBts , (kasme sn , i m s i s n , cap sn ) ) 28 e l s e 0 29 e l s e 0 . In lines 5–7, the MME communicates with the HN to gain the authentication vector. The MME sends out a challenge in line 8 and receives and verifies the response from the MS in line 10. The NAS SMC procedure of the MME side is specified in lines 14–17. In lines 21 and 27, the MME sends the KASME , as well as the identity and capabilities of the MS, to the eNB through the private channel. The code of the eNB process is defined as follows. The comments refer to message numbers in Figure 5.4.

1 l e t processENB = 2 in (sChannelSnBts , (kasme enb: asmeKey, imsi e n b : i d e n t , 3 cap enb : bool )); 4 l e t kenb enb: enbKey = kdf e n b ( kasme enb ) in 5 l e t kasenc enb: asEncKey = kdf a s e n c ( kenb enb ) in 6 l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) in 7 l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) in 8 event begMS ENB( i m s i e n b , kenb enb , cap enb ) ; 9 out (pubChannel , (ASSMC, cap enb , 10 f i n t e g as(bool2bitstring(cap enb), kasint e n b ) ) ) ; (∗ [ Msg 10] ∗) 11 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 12 =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 11] ∗) 13 i f cap enb = f a l s e then 14 event disableEnc; 15 out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) 16 (∗ [ Msg 12] ∗) 17 e l s e 18 out (pubChannel , (MSG, sencrypt as(payload , kasenc enb ) , 19 f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . 57

20 (∗ [ Msg 12] ∗)

The eNB receives the KASME and the identity and capabilities of the MS from the MME in lines 2–3. The AS keys are derived in lines 4–7. The AS SMC procedure is modeled in lines 9–12. After successfully executing the AS SMC procedure, the eNB sends out the data message either in line 15 or in lines 18–19, depending on whether the encryption is enabled or not. The HN process is defined as follows.

1 l e t processHN = 2 in (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); 3 (∗ [ Msg 3 ] ∗) 4 new rand hn : nonce ; 5 get keys (= imsi hn , k i h n ) in 6 l e t mac hn: mac = f1(ki hn , rand hn ) in 7 l e t x r e s hn: resp = f2(ki hn , rand hn ) in 8 l e t ck hn: cipherKey = f3(ki hn , rand hn ) in 9 l e t i k hn: integKey = f4(ki hn , rand hn ) in 10 l e t kasme hn: asmeKey = kdf asme ( ck hn , ik hn , s n i d h n ) in 11 out (secureChannel , (AV, imsi hn , snid hn , rand hn , 12 x r e s h n , mac hn , kasme hn ) ) . (∗ [ Msg 4 ] ∗)

The HN gets the pre-shared key in line 5 and computes the KASME in line 10. Note that the CK and IK computed in lines 8–9 never leave the HN.

5.3 Security Property Specifications and Findings

This section presents the specifications of secrecy and authentication properties. We then present the analysis result of the security properties. The secrecy and authentication properties are specified as:

1 query attacker ( payload ) . 2 query attacker ( payload ) event (disableEnc). 3 query attacker ( s e c r e t ) . 4 query x1: ident, x2: ident, x3: asmeKey; 5 event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 6 query x1: ident, x2: ident, x3: asmeKey, x4: bool ; 7 event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). 8 query x1: ident, x2: enbKey, x3: bool ; 9 event (endMS ENB(x1, x2, x3)) event (begMS ENB(x1, x2, x3)). Like in the UMTS model, an additional data message is introduced to test the secrecy of the data. As expected, the payload can be learned by the attacker when the MS is not capable of encryption. The conditional secrecy (line 2) expresses that if the attacker obtains the secret payload then the event disableEnc must have previously taken place. Because the NAS and AS keys are computed only from KASME , the secrecy of any NAS or AS key implies the secrecy of KASME . The authentication of the MS to the MME (lines 4–5) is specified in such a way that if the event endSN with arguments IMSI, SN identity and KASME is executed, 58

Table 5.1: Analysis result of LTE model Conditional Auth. of Auth. of Auth. of Key Payload Payload the MS to the MME the BS to Secrecy Secrecy Secrecy the SN to the MS the MS Proved Proved Proved Failed Proved Proved

then the event begSN must have been executed previously with the same arguments. In fact, the SN identity can be implied by the KASME . To emphasize that the two parties agree on the identity of the SN, we include the SN identity in the parame- ters of the correspondence assertion. The event endSN is inserted after receiving and checking the security mode complete message. Since the KASME is computed from the CK, the IK and the SN identity, and they are not used in the challenge-response round, until receiving and confirming the security mode complete message, the MME cannot conclude that the MS receives the correct SN identity and derives the same KASME . The authentication of the MME to the MS is specified in lines 6–7. Besides the identities and keys, the MS also provides for the authenticity of the security capa- bilities, so we include the capabilities in the parameters of events. In addition to the authentication between the MS and the MME, the protocol should also provide for the authentication of the BS to the MS, which is specified in lines 8–9. The security capabilities (modeled as encryption options) are included in the parameters of the events to specify that the events should agree on the encryption option. Table 5.1 shows the analysis result of the above properties. 59

Chapter 6 Comparative Authenticity

In this chapter, we compare the authenticity achieved by the different generations of the technologies. We review differences between corresponding blocks in the different technologies, which are defined in Chapter 3–5. We compare the specifications of the authentication properties (correspondence assertions), including the parameters used in the correspondence assertions. During the discussion, we establish some terminolo- gies for different types of the authenticity. This discussion of the authenticity in pure AKAs serves as a basis for our later comparison of the authenticity of interoperation scenarios (Chapters 8 and 9).

6.1 Authentication of the MS to the SN

In this section, we compare the standards in terms of the authentication of the MS to the SN.

6.1.1 GSM vs. UMTS In this section, we introduce the authentication of the MS to the SN in GSM and UMTS using the challenge response procedure to check if the MS has the correct per- manent key Ki. We compare the corresponding blocks in GSM and UMTS, in which the MS achieves to authenticate itself to the SN. We consider the formal specifica- tions of the authentication properties, i.e., the correspondence assertions. In addition to the parameters used in the correspondence assertions, we also discuss the crypto- graphic material implied by the parameters. Both protocols provide the same type of authentication using similar challenge-response procedures. As we described in Chapter 3, in GSM, the MS and the HN share the permanent key Ki, which never leaves the MS and the HN. The HN generates the authentication vector based on the random number RAND and the permanent key Ki. The HN sends the authentication vector to the MSC. Note that the MSC cannot create the challenge and the response. The MSC authenticates the MS by testing if the MS has the knowledge of the Ki. The testing is done by sending the RAND as challenge to the MS and checking if the response from the MS matches the expected response in the authentication vector. If the responses match, which means the MS knows the permanent key Ki, then the MS is authenticated. In order to refer this type of authenticity, we use the term challenge-response authentication. The left part of Figure 6.1 shows the block GSM III, which contains the chal- lenge response procedure, including the events used in the correspondence assertions. The correspondence assertion that specifies authentication of the MS to the SN in GSM is 60

MS SN MS SN

5. RAND 5. RAND, AUTN

res__ms = a3(Ki, rand_ms), IIIUMTS Compute res_ms, ck_ms, ik_ms, xmac_ms

GSM IIIGSM kc_ms = a8(Ki, rand_ms) Verify mac_ms=xmac_ms

event begSN(imsi_ms,kc_ms) event begSN(imsi_ms, ck_ms, ik_ms)

6. RES 6. RES

Verify res_sn = xres_sn Verify res_sn = xres_sn

event endSN(imsi_hn_sn, kc_sn) event endSN(imsi_hn_sn, ck_sn, ik_sn)

Figure 6.1: Events used to specify the authentication of MS to SN in GSM and UMTS

event endSN(IMSI, Kc) event begSN(IMSI, Kc) We choose the identity of the MS and the session key as parameters of the correspon- dence assertions. The correspondence assertion says that if the SN reaches the point in its protocol marked by event endSN, for a given IMSI and session keys, then there is a legitimate MS that reached the point marked begSN, with the same IMSI and session key. Because the session key is derived from the Ki and the RAND, the events’ agreement on the key implies agreement on the Ki and the RAND as well. That is, if SN reaches the point marked endSN for a particular IMSI , with associated long-term Ki and with nonce RAND provided by HN, then there is an MS that reaches the point marked begSN, has long-term key Ki and is responding using RAND. In UMTS (Chapter 4), the MS authenticates itself in the similar way as it does in GSM. In the challenge from the MSC, in addition to the random number RAND, an authentication token is also included. The sequence number in the authentication token helps the MS to reject any older or pre-used authentication challenge. Despite the authentication token being included in the challenge, the authentication of the MS to the SN in UMTS is the same type as the authentication of the MS to the SN in GSM, which is challenge-response authentication in our terminology. The right part of Figure 6.1 shows the block UMTS III, which contains the challenge response procedure, including the events used in the correspondence asser- tions. The correspondence assertion that specifies authentication of the MS to the SN in UMTS is

event endSN(IMSI, CK, IK) event begSN(IMSI, CK, IK) The correspondence assertion has the same meaning as the one in GSM.

6.1.2 UMTS vs. LTE We now carry out the same kind of analysis as in Section 6.1.1. The conclusion is that LTE provides the same type of authentication as in GSM and UMTS. 61

MS MME

5. RAND, AUTN, SNid

XMAC = f1(Ki, RAND)

LTE MAC = XMAC, RES = f2(Ki, RAND) MS SN CK = f3(Ki, RAND), IK = f4(Ki, RAND)

III KASME = KDF(CK, IK, SNid,)

5. RAND, AUTN 6. RES

UMTS IIIUMTS Compute res_ms, ck_ms, ik_ms, xmac_ms Verify RES = XRES Verify mac_ms=xmac_ms

event begSN(imsi_ms, ck_ms, ik_ms) 7. eableEnc, CAP, NAS-MAC

6. RES KNASenc = KDF (KASME), KNASint = KDF(KASME) Verify res_sn = xres_sn XNAS-MAC = EIA((CAP, enableEnc), KNASint) Verify XNAS-MAC = NAS-MAC

event endSN(imsi_hn_sn, ck_sn, ik_sn) IVLTE event begSN(imsi_ms, snid_ms, kasme_ms)

8. NAS-SMComplete msg,

NAS-SMComplete-MAC

Verify NAS-SMComplete-MAC

event endSN(imsi_sn, snid_sn, kasme_sn)

Figure 6.2: Events used to specify the authentication of MS to SN in UMTS and LTE

In LTE, the MME authenticates the MS by sending the challenge received from the HN and checking whether the response received from the MS matches the expected response. If the responses match, the MME concludes the MS has the permanent key Ki. Similar to UMTS, the authentication token included in the challenge does not make difference of the type of the authenticity. Therefore the authentication of the MS to the SN in LTE is also challenge-response authentication. The right part of Figure 6.2 shows the blocks LTE III-IV including the events used in the correspondence assertions. The correspondence assertion that specifies authentication of the MS to the SN in LTE is event endSN(IMSI, SNid, K ASME) event begSN(IMSI, SNid, K ASME) The correspondence assertion means that if the SN with identity SNid reaches the point endSN it knows there is an MS with the same IMSI which reaches begSN using the same master key KASME . The KASME is generated from the permanent key Ki, the random number RAND, and the serving network identity SNid. In LTE III, the SN ensures that the MS has the correct Ki and RAND by checking the response. By contrast, agreement on the key KASME cannot be confirmed until the key is used. So the events used in the correspondence assertion are placed in LTE IV, where the key is used. Agreement on KASME implies agreement on Ki and the RAND from which it is derived. Despite the SNid being included as a parameter of the events, given that the SN knows its own identity it makes no difference for the type of the authentication of the MS to the SN. 62

6.2 Authentication of the SN to the MS

In this section, we compare the standards in terms of the authentication of the SN to the MS.

6.2.1 GSM vs. UMTS As described in Chapter 3, GSM does not provide authentication of the SN to the MS. In UMTS, the MS does authenticate the SN, by verifying the integrity of the SMC message (in UMTS IV) to ensure the SN knows the correct integrity key which is obtained from the HN. The knowledge checked by the MS is based on the derived integrity key. This authentication is not challenge response, rather is based on check- ing knowledge of the integrity key. In order to refer this type of authentication of the SN to the MS, we use the term use-based proved knowledge authentication. The two components of the SN, i.e. the BS and the MSC, are each authenti- cated in different way. In UMTS, the MAC of the SMC message is generated by the BS. By successfully verifying the MAC, the MS in fact concludes that the BS has the knowledge of the correct integrity key. Therefore this is use-based proved knowledge authentication of the BS to the MS. The authentication of the MSC to the MS is based on the following reasoning: the MS trusts that the HN and the MSC follow the protocol. The BS proves to the MS that it knows the integrity key; the only way the BS obtains the integrity key is from the MSC which can only get it from the HN. In order to refer this type of authentication of the MSC to the MS, we use the term indirect use-based proved knowledge authentication. The left part of Figure 6.3 shows the block UMTS IV including the events used to specify the correspondence assertion, which is event endMS(IMSI, CK, IK, CAP) event begMS(IMSI, CK, IK, CAP) It means that if the MS with the IMSI reaches the event endSN then an SN must have reached its begSN with the same session keys and the same capabilities of the MS. Because the session keys are generated from the permanent key Ki and the nonce RAND, agreement on the keys implies agreement on Ki and RAND. (Recall from chapter 4 that in the UMTS model we combine the BS with the MSC) The CAP is used as a parameter in the events to check if the BS receives the correct capabilities, which prevents the false base station attack [53]. This is not relevant to the authentication of the BS to the MS, because the authentication is established by the knowledge of the integrity key.

6.2.2 UMTS vs. LTE Recall that the authentication of the BS to the MS in UMTS is the use-based proved knowledge authentication and the authentication of the MSC to the MS in UMTS is the indirect use-based proved knowledge authentication. 63

MS BS MME event begMS(imsi_sn, snid_sn, kasme_sn, cap_sn) 7. eableEnc, CAP, NAS-MAC

KNASenc = KDF (KASME)

LTE IV LTE KNASint = KDF(KASME) XNAS-MAC = EIA(

(CAP, enableEnc), KNASint) Verify XNAS-MAC = NAS-MAC event endMS(imsi_ms, snid_ms, kasme_ms, cap_ms) MS SN 8. NAS SMComplete msg NAS-SMComplete-MAC event begMS(imsi_hn_sn, ck_sn,ik_sn, cap_sn) Verify NAS-SMComplete-MAC 7. eableEnc, CAP, FRESH, MAC-I

KeNB = KDF(KASME)

UMTS IV

XNAS-MAC = EIA((CAP, enableEnc), CK) 9. CAP,KeNB Verify XNAS-MAC = NAS-MAC KeNB = KDF (KASME), KRRCenc = KDF (KeNB)

LTE V LTE KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) event endMS(imsi_ms, ck_ms, ik_ms, cap_ms) Decide enableENC,

AS-MAC = EIA(enableEnc,KRRCint) 8. SMComplete, integrity protected event begMS_ENB(imsi_sn, kenb_sn, cap_sn) 10. enableEnc, AS-MAC

KeNB = KDF (KASME) KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB) KUPenc = KDF (KeNB) XAS-MAC = EIA( enableEnc, KRRCint) Verify XAS-MAC = AS-MAC event endMS_ENB(imsi_ms, kenb_ms, cap_ms) 11. AS SMComplete msg AS-SMComplete-MAC Verify AS-SMComplete-MAC

Figure 6.3: Events used to specify the authentication of SN to MS in UMTS and LTE

The LTE AKA separates the NAS and AS traffic and derives different keys for the corresponding stratum. The NAS and AS security contexts are established by the NAS SMC procedure and the AS SMC procedure respectively. These two procedures enable the authentication of the MME and the BS to the MS respectively. The MS authenticates the MME by verifying the integrity of the NAS MSC message to check if the MME has the knowledge of the NAS integrity key, which is derived from the KASME . The KASME is derived by the HN from the CK , the IK , and the identity of the SN SNid. Also the CK and IK are derived from the Ki and the RAND. So the identity of the SN is bound to the KASME and keys derived from KASME . Compared with UMTS, the MME directly proves that it has the knowledge of the integrity key and the MS obtains additional assurance of the identity of the SN. The authentication of the MME to the MS in LTE is called use-based proved knowledge with SNid authentication. The MS authenticates the BS also by verifying the integrity of the AS SMC message, which is generated by the BS, to check whether the BS has the knowledge of the correct AS integrity key. The AS integrity key is derived from the KeNB ; the KeNB is derived from the KASME . So the identity of the SN is also bound to the AS integrity key. Which means that the authentication of the BS to the MS in LTE is 64

also the use-based proved knowledge with SNid authentication. The events used to specify the authentication of the MME to the MS are placed in LTE IV in the right part of Figure 6.3. The correspondence assertion is event endMS(IMSI, SNid, K ASME, CAP) event begMS(IMSI, SNid, K ASME, CAP) which says that if an MS with given IMSI reaches its endMS it knows that the MME with the same SNid reaches its point begMS with the same master key and the same capabilities sent by the MS. Authentication of the BS to the MS is specified using the events in LTE V in the right part of Figure 6.3. The correspondence assertion is

event endMS ENB(IMSI,K eNB , CAP) event begMS ENB(IMSI,K eNB , CAP)

Because the KeNB is derived from the KASME , and the KASME is derived from the Ki, the RAND, and the SNid, agreement on KeNB implies agreement on the Ki, the RAND, and the SNid. The correspondence assertion says that if an MS with given IMSI reaches its endMS ENB then it knows there is a BS, attached to an MME with identity SNid, which reaches its begMS ENB with the same intermediate key and the same capabilities of the MS.

6.3 Summary

We identify four main types of authentication that can be described in terms of the major components, MS, BS, MSC/MME, and HN. challenge-response Authentication is based on a random challenge and the re- sponse is used to prove that the responding party has the correct key and used it to respond to the challenge. For example, the authentication of the MS to the SN in all the pure AKAs is challenge-response authentication. use-based proved knowledge Authentication is based on that one party possesses the correct integrity key and uses it to generate the MAC. For example, the authentication of the BS to the MS in UMTS is use-based proved knowledge authentication. indirect use-based proved knowledge Authentication is indirect and based on the use-based proved knowledge. The reasoning is that two participants con- nected by a secure channel trust each other to follow the protocol, and the only way one can get a derived key is by obtaining it from the other. For example, the authentication of the MSC to the MS in UMTS is indirect use-based proved knowledge authentication. use-based proved knowledge with SNid This is like use-based proved knowl- edge authentication, but with the addition that the SNid is provided to the 65

Table 6.1: Types of authentication achieved by the pure AKAs

Auth. of SN to MS Auth. of MS to SN Auth. of MSC/MME to MS Auth. of BS to MS GSM challenge-response UMTS challenge-response indirect use-based proved knowledge use-based proved knowledge LTE challenge-response use-based proved knowledge with SNid use-based proved knowledge with SNid

Table 6.2: Parameters of the correspondence assertions used in the proved authenti- cation properties Implied parameters in addition to RAND and Ki are put in parentheses

Auth. of SN to MS Auth. of MS to SN Auth. of MSC/MME to MS Auth. of BS to MS GSM IMSI , Kc UMTS IMSI , CK , IK IMSI , CK , IK , CAP LTE IMSI , SNid, KASME IMSI , SNid, KASME , CAP IMSI , Kenb , CAP (SNid)

MS and the integrity key is derived not only from the long-term key but also from the SNid. For example, the authentication of the MME to the MS in LTE is use-based proved knowledge with SNid authentication.

Table 6.1 summarizes the types of authenticity achieved by the pure AKAs. We have compared the specifications of the authentication properties by iden- tifying the corresponding blocks which contains the events and discussing the param- eters used in the correspondence assertions. Table 6.2 shows the parameters used in the correspondence assertions. The “parameters” in parentheses are implied by key derivations rather than being explicit in events. Since all the session keys are derived from the RAND and the Ki, those are also implied in every case, so we only list the additional implied parameters. 66

Chapter 7 Establishing a Initial Security Context in Interoperation

In this chapter, we systematically enumerate all possible interoperation cases, i.e., combination of system components from different technologies. We first summarize the system components in Section 7.1. Since each of the five main system components can be 2G, 3G, or 4G, there are 35 = 243 cases in which deployed components from different technologies might interact. We justify which cases are explicitly allowed (Section 7.2), which cases are disallowed (Section 7.3), and which cases are uncertain (Section 7.4). Our analysis is based on the standards [1, 6, 8, 11, 7] and other documentations [52].

7.1 System Components

In this section, we summarize the main components which are introduced previous chapters. The three main components in the network architecture of GSM, UMTS, and LTE are the MS, the SN, the HN. The MS is the combination of the ME and an identity module. The ME is the user device that contains the radio functionality and the encryption/integrity mechanisms used to protect the traffic between the MS and the network. A 4G ME also includes the functionality to derive an LTE master secret key KASME . In GSM, the identity module of the SIM contains the unique IMSI, the subscriber’s permanent secret key Ki, as well as the mechanisms used for GSM AKA and GSM session key derivation. The UMTS identity module (USIM) includes the IMSI, Ki, and the UMTS AKA and session key derivation functionality. It furthermore may contain the SIM functionality, i.e., the GSM AKA and key derivation functionality. In contrast to a 3G USIM, an LTE USIM (also referred to as enhanced USIM) provides for additional functionality including enhanced capability for the storing of a security context. The SN typically consists of the BS and either the MSC in GSM and UMTS, or the MME in LTE. The BS is the network access point which manages the radio resources and establishes the connection to the MS. In GSM, the BS includes the BTS which connects to the BSC. In GSM, encryption terminates at the BTS or at the SGSN in GPRS. In UMTS, the BS includes the NodeB which connects to the RNC. Encryption and integrity protection in UMTS terminates in the RNC. In LTE, BS is the eNodeB. LTE distinguishes the protection of the connection between the MS and the eNodeB—the so-called AS and the connection between the MS and MME— the so-called NAS. In LTE, the MME is the end-point for the NAS and the respective protection mechanisms. The HN includes the HLR and the AuC in GSM and UMTS, respectively the Home Subscriber Server (HSS) in LTE. The HN stores all subscriber data including 67

Table 7.1: Legend used in Table 7.2 Rows Cases Normal font with no color Allowed Green color and bold font Uncertain Grey color and italic font Disallowed Blue color and in bold italic font Involving only 2G/3G components

the IMSI and permanent shared secret key Ki. It furthermore, holds its (own) algo- rithms for deriving session keys as well as generating authentication vectors. A 4G HN also includes the functionality for deriving an LTE master secret key KASME . Each one of the five main system components (the identity module, the ME, the BS, the MSC/MME, and the HN) can be 2G, 3G, or 4G—thus resulting in 35 = 243 possible combinations. Each combination corresponds to an interoperation case. Table 7.2 shows the details for the cases. The rows marked with blue color and in bold italic font are the cases involving only 2G/3G components. These cases have been analyzed in [1, 87] and will be further detailed in Chapter 8. We classify the cases involving 4G components in the following sections. Section 7.2 gives the allowed interoperation cases. Section 7.3 gives the disallowed interoperation cases. Section 7.4 gives the uncertain cases. Table 7.1 explains the color/font scheme we used in Table 7.2.

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 1 4G 4G 4G 2 3G 4G 4G A1,A4 3 2G 4G 4G A1,A4 4 4G 3G 4G R5 5 3G 3G 4G 6 2G 3G 4G 7 4G 2G 4G R4 8 3G 2G 4G R4 9 2G 2G 4G 10 4G 4G 3G A2,A4 11 3G 4G 3G A1,A2,A4 12 2G 4G 3G A1,A2,A4 13 4G 3G 3G R5 14 4G 4G 3G 3G 3G A2 15 2G 3G 3G A2 68

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 16 4G 2G 3G R4 17 3G 2G 3G R4 18 2G 2G 3G A2 19 4G 4G 2G R6 20 3G 4G 2G A1,A2,A4 21 2G 4G 2G A1,A2,A4 22 4G 3G 2G R5 23 3G 3G 2G A2,A3 24 2G 3G 2G A2,A3 25 4G 2G 2G R4 26 3G 2G 2G R4 27 2G 2G 2G A2,A3 28 4G 4G 4G R3 29 3G 4G 4G A1,A4 30 2G 4G 4G A1,A4 31 4G 3G 4G R3,R5 32 3G 3G 4G 33 2G 3G 4G 34 4G 2G 4G R3,R4 35 3G 2G 4G R4 36 2G 2G 4G 37 4G 4G 3G R3 38 3G 4G 3G A1,A2,A4 39 2G 4G 3G A1,A2,A4 40 4G 3G 3G R3,R5 41 4G 3G 3G 3G 3G A2 42 2G 3G 3G A2 43 4G 2G 3G R3,R4 44 3G 2G 3G R4 45 2G 2G 3G A2 46 4G 4G 2G R3 47 3G 4G 2G A1,A2,A4 48 2G 4G 2G A1,A2,A4 49 4G 3G 2G R3,R5 50 3G 3G 2G A2,A3 51 2G 3G 2G A2,A3 52 4G 2G 2G R3,R4 69

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 53 3G 2G 2G R4 54 2G 2G 2G A2,A3 55 4G 4G 4G R2 56 3G 4G 4G R2 57 2G 4G 4G A1,A4 58 4G 3G 4G R2,R5 59 3G 3G 4G R2 60 2G 3G 4G 61 4G 2G 4G R2,R4 62 3G 2G 4G R2,R4 63 2G 2G 4G 64 4G 4G 3G R2 65 3G 4G 3G R2 66 2G 4G 3G A1,A2,A4 67 4G 3G 3G R2,R5 68 4G 2G 3G 3G 3G R2 69 2G 3G 3G A2 70 4G 2G 3G R2,R4 71 3G 2G 3G R2,R4 72 2G 2G 3G A2 73 4G 4G 2G R2 74 3G 4G 2G R2 75 2G 4G 2G A1,A2,A4 76 4G 3G 2G R2,R5 77 3G 3G 2G R2 78 2G 3G 2G A2,A3 79 4G 2G 2G R2,R4 80 3G 2G 2G R2,R4 81 2G 2G 2G A2,A3 82 4G 4G 4G 83 3G 4G 4G A1,A4 84 2G 4G 4G A1,A4 85 4G 3G 4G R5 86 3G 3G 4G 87 2G 3G 4G 88 4G 2G 4G R4 89 3G 2G 4G R4 70

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 90 2G 2G 4G 91 4G 4G 3G A4 92 3G 4G 3G A1,A4 93 2G 4G 3G A1,A4 94 4G 3G 3G R5 95 3G 4G 3G 3G 3G 96 2G 3G 3G 97 4G 2G 3G R4 98 3G 2G 3G R4 99 2G 2G 3G 100 4G 4G 2G R6 101 3G 4G 2G A1,A4 102 2G 4G 2G A1,A4 103 4G 3G 2G R5 104 3G 3G 2G 105 2G 3G 2G 106 4G 2G 2G R4 107 3G 2G 2G R4 108 2G 2G 2G 109 4G 4G 4G R3 110 3G 4G 4G A1,A4 111 2G 4G 4G A1,A4 112 4G 3G 4G R3,R5 113 3G 3G 4G 114 2G 3G 4G 115 4G 2G 4G R3,R4 116 3G 2G 4G R4 117 2G 2G 4G 118 4G 4G 3G R3 119 3G 4G 3G A1,A4 120 2G 4G 3G A1,A4 121 4G 3G 3G R3,R5 122 3G 3G 3G 3G 3G 123 2G 3G 3G 124 4G 2G 3G R3,R4 125 3G 2G 3G R4 126 2G 2G 3G 71

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 127 4G 4G 2G R3 128 3G 4G 2G A1,A4 129 2G 4G 2G A1,A4 130 4G 3G 2G R3,R5 131 3G 3G 2G R7 132 2G 3G 2G 133 4G 2G 2G R3,R4 134 3G 2G 2G R4 135 2G 2G 2G 136 4G 4G 4G R2 137 3G 4G 4G R2 138 2G 4G 4G A1,A4 139 4G 3G 4G R2,R5 140 3G 3G 4G R2 141 2G 3G 4G 142 4G 2G 4G R2,R4 143 3G 2G 4G R2,R4 144 2G 2G 4G 145 4G 4G 3G R2 146 3G 4G 3G R2 147 2G 4G 3G A1,A4 148 4G 3G 3G R2,R5 149 3G 2G 3G 3G 3G R2 150 2G 3G 3G 151 4G 2G 3G R2,R4 152 3G 2G 3G R2,R4 153 2G 2G 3G 154 4G 4G 2G R2 155 3G 4G 2G R2 156 2G 4G 2G A1,A4 157 4G 3G 2G R2,R5 158 3G 3G 2G R2 159 2G 3G 2G 160 4G 2G 2G R2,R4 161 3G 2G 2G R2,R4 162 2G 2G 2G 163 4G 4G 4G R1 72

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 164 3G 4G 4G R1 165 2G 4G 4G R1 166 4G 3G 4G R1,R5 167 3G 3G 4G 168 2G 3G 4G 169 4G 2G 4G R1,R4 170 3G 2G 4G R1,R4 171 2G 2G 4G 172 4G 4G 3G R1 173 3G 4G 3G R1 174 2G 4G 3G R1 175 4G 3G 3G R1,R5 176 2G 4G 3G 3G 3G 177 2G 3G 3G 178 4G 2G 3G R1,R4 179 3G 2G 3G R4 180 2G 2G 3G 181 4G 4G 2G R1 182 3G 4G 2G R1 183 2G 4G 2G R1 184 4G 3G 2G R1,R5 185 3G 3G 2G 186 2G 3G 2G 187 4G 2G 2G R1,R4 188 3G 2G 2G R4 189 2G 2G 2G 190 4G 4G 4G R1,R3 191 3G 4G 4G R1 192 2G 4G 4G R1 193 4G 3G 4G R1,R3, R5 194 3G 3G 4G 195 2G 3G 4G 196 4G 2G 4G R1,R3,R4 197 3G 2G 4G R1,R4 198 2G 2G 4G 199 4G 4G 3G R1,R3 200 3G 4G 3G R1 73

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 201 2G 4G 3G R1 202 4G 3G 3G R1,R3,R5 203 2G 3G 3G 3G 3G 204 2G 3G 3G 205 4G 2G 3G R1,R3,R4 206 3G 2G 3G R4 207 2G 2G 3G 208 4G 4G 2G R1,R3 209 3G 4G 2G R1 210 2G 4G 2G R1 211 4G 3G 2G R1,R3,R5 212 3G 3G 2G 213 2G 3G 2G 214 4G 2G 2G R1,R3,R4 215 3G 2G 2G R4 216 2G 2G 2G 217 4G 4G 4G R1,R2 218 3G 4G 4G R1,R2 219 2G 4G 4G R1 220 4G 3G 4G R1,R2,R5 221 3G 3G 4G R1,R2 222 2G 3G 4G 223 4G 2G 4G R1,R2,R4 224 3G 2G 4G R1,R2,R4 225 2G 2G 4G 226 4G 4G 3G R1,R2 227 3G 4G 3G R1,R2 228 2G 4G 3G R1 229 4G 3G 3G R1,R2,R5 230 2G 2G 3G 3G 3G R2 231 2G 3G 3G 232 4G 2G 3G R1,R2,R4 233 3G 2G 3G R2,R4 234 2G 2G 3G 235 4G 4G 2G R1,R2 236 3G 4G 2G R1,R2 237 2G 4G 2G R1 74

Table 7.2: Classifying the 243 interoperation cases (leg- end explained in Table 7.1)

Components Condition to Reasons for ID Identity Support ME BS MSC/ HN Disallowance Module MME Occurrence 238 4G 3G 2G R1,R5 239 3G 3G 2G R1,R2 240 2G 3G 2G 241 4G 2G 2G R1,R2,R4 242 3G 2G 2G R2,R4 243 2G 2G 2G

7.2 Allowed Interoperation Cases

In this section, we list some facts about the system components according to the 3GPP specifications which explicitly allow certain cases. For the identity module, the SIM supports 2G AKA only [1]. A USIM supports both 2G and 3G AKA [1]. Similarly, a 4G USIM supports 2G, 3G, and 4G AKA [52]. Since a large number of USIMs is in current use, a 4G ME with the USIM is allowed to access the 4G network. Since the 4G ME is capable of deriving LTE keys and storing security contexts [6], the combination of a 4G ME with a USIM supports 4G AKA. For the ME, it is possible to use a SIM or a USIM with a 2G ME [1]. Since the 4G USIM is an enhanced version of the USIM, this implies that it is possible to also use a 4G USIM with a 2G ME. Similarly, since a SIM or USIM can be used with a 3G ME, [1], it is also possible to use a 4G USIM with a 3G ME. A 4G ME can be used with a SIM [52] or USIM [8] and certainly with a 4G USIM. A 2G ME only supports GERAN [1]. A 3G ME supports GERAN and UTRAN [1], and a 4G ME supports GERAN, UTRAN, and E-UTRAN [52]. For the BS, a 2G BS is only capable of handling a GSM session key Kc [1], which means a 2G BS only supports a 2G ciphering mode setting [11]. Similarly, a 3G BS requires the UMTS cipher key CK and the UMTS integrity key IK [1]— supporting only the 3G security mode set-up and operation [7]. A 4G BS requires KeNB and only supports the 4G AS security mode command procedure and operation [8]. For the MSC/MME, a 2G MSC can only control a 2G BS and only supports 2G AKA [1]. A 3G MSC can control both a 2G BS and a 3G BS and can support both 2G and 3G AKA [1]. An MME can control a 4G BS and can support the 4G AKA [8]. For the HN, a 2G HN can maintain 2G and 3G subscriptions [1]. A 3G HN can maintain 2G and 3G subscriptions [1]. A 4G HN can maintain 3G and 4G 75

subscriptions [8]. Based on the above facts, we identify 38 allowed cases, which are the rows in normal font with no color in Table 7.2.

7.3 Disallowed Interoperation Cases

In this section, we list the reasons, which are extracted from the 3GPP specifications, to rule out 138 cases. The 3GPP specifications explicitly specifies the incompatibilities of some com- binations of the network components. The incompatibilities lead us to rule out the 138 cases, which are the rows in gray color and italic font in Table 7.2. The following reasons for disallowing various cases are referred in the table.

R1 Use of SIMs to access the 4G network is not allowed [8].

R2 A 2G ME cannot interoperate with a 3G or 4G BS [1].

R3 A 3G ME does not support the 4G radio access interface [1].

R4 A 2G MSC cannot control a 3G or 4G BS [1].

R5 A 3G MSC cannot control a 4G BS [1].

R6 An MME refuses to convert a GSM security context to 4G security context. Consequently, this rules out all interoperation cases which would require the deriving of the master key KASME from the GSM cipher key Kc [8]. R7 A 3G ME with USIM attaching to a 3G BS shall only participate in 3G AKA and shall not participate in 2G AKA [7]. This rules out the case in which a USIM subscribed to a 2G HN is used in a 3G ME that connects to a 3G BS, as the 2G HN can only support 2G AKA.

7.4 Uncertain Interoperation Cases

The 3GPP specifications do not provide indication as to whether or not the remain- ing 48 cases are allowable. These cases are marked in green color and bold font in Table 7.2. For those cases, Table 7.2 refers to these conditions under which they could occur:

A1 An MME can control a 3G BS or a 2G BS.

A2 A 3G HN or 2G HN can maintain 4G subscriptions.

A3 A 4G HN can maintain 2G subscriptions.

A4 An MME can support the 2G or 3G AKA. 76

These assumptions are inferred from the facts that listed in previous sections. A1, A3, and A4 are assumed based on the assumption that the components of later technologies supports the functionality of the corresponding components in earlier technologies. A2 is assumed based on the fact that a 2G HN can maintain 3G sub- scriptions. 77

Chapter 8 Modeling and Analysis of Interoperation Scenarios involving GSM and UMTS Procedures Only

This chapter begins our investigation of interoperation scenarios, i.e., hybrid proce- dures built from blocks from two different generations. It concentrates on the cases only involving GSM and UMTS components. The interoperation scenarios of these cases involve GSM and UMTS blocks only. These cases and scenarios are explicitly specified in the 3GPP specification [1]. Just like the pure protocols (Chapters 3–5), each scenario is presented as message sequence charts and provided with the model and analysis. In Chapter 9, we complete the picture by considering cases that involve some LTE components. Some of those cases fall into the scenarios in this chapter or into the pure AKAs. Others require additional scenarios to be given in Chapter 9. This organization is intended to break the analysis and results into digestible parts.

8.1 Determining the Scenarios only involving GSM and UMTS Compo- nents

In this section, we list the reasons to determine what AKA scenarios will occur for each case. We list all scenarios for the cases only involving GSM and UMTS components. Some of the scenarios are the pure case AKAs. We discuss the remaining three scenarios in the following sections. The interoperation scenarios involving GSM and UMTS components have been studied in [1, 76, 87]. In order to determine a suitable AKA for a specific interoper- ation case, first we determine which messages should be in the first block. The AKA might be triggered by initial network request or Routing Area Request (RAU ). No matter which message triggers the AKA, the first block always contains the transmit- ting of the IMSI and CAP as in GSM I or UMTS I. In fact, from the security point of view, the GSM I and the UMTS I are equivalent to each other. Second, we consider the authentication vector that is generated in the HN and subsequently provided to the MSC. How and what kind of authentication vector is generated by the HN depends on HN’s capabilities, the type of MSC requesting/re- ceiving the authentication vector, the type of BS, and the type of the identity module. Third, the authentication vector determines what kind of challenge-response procedure is carried out. Fourth, we consider the type of the BS, which determines the type of the security mode setup procedure. Depending on the type of BS it controls, the MSC might have to convert the encryption/integrity keys. Table 8.1 gives the reasoning we used to determine the AKA scenarios. To be 78

Table 8.1: Reasons used for determining AKA scenarios (see Table 9.1 for full set)

C Upon request by a 3G MSC, the 3G HN generates and sends out 3G AVs [7, Section 6.3.2 Page 21-23]. Type of AV D Upon request by a 2G MSC with a 3G IMSI, the 3G HN generates 2G AVs from 3G AVs [1, Section 6.1 Case 4 Page13, Page 30-32]. E 2G HN only supports to generate 2G AVs [1, Section 4.4 Page 9]. F Upon request by a MSC with a 2G IMSI, the 3G HN always generates and delivers the 2G AVs [1, Section 6.3.1 Page 19, Page 30-32]. H 3G BS only supports 3G SMC [1, Section 6.3.1 Case 1 Page 20]. Type of BS I 2G BS only supports 2G SMC [1, Section 6.1 Case 2 Page 13]. K XG ME supports XG SMC [8, 7, Section 7.2.4.5 Page 33, TS 33.102 Section 6.4.5 Page 31-33] Type of ME L 3G ME supports 2G SMC [1, Section 6.1 Case 2 Page 13]. M The 3G BS requires CK and IK, the MSC generates them from Kc by applying conversion Conversion function c3 [1, Section 6.3.1 Case1 Page 20]. N 2G BS is not capable of handling of cipher and integrity keys. The MSC converts the CK and IK into Kc [1, Section 6.1 Case 2 Page 13]. First Block V Triggered by attach request or RAU request, the first block is GSM I or UMTS I [4, Section 6.5], [5, Section 5.3.3]

consistent with the labels for the reasons to determine the scenarios of interoperation cases involving LTE components (Chapter 9), We use the same labels as in the full table (Table 9.1) in Chapter 9. Based on the reasoning, we categorize the cases into 5 distinct scenarios, which are consistent with the scenarios in [1, 76]:

S1 GSM authentication.

S2 UMTS AKA.

S4 A UMTS MS roams to an SN with a GSM BS and GSM MSC.

S5 A GSM MS roams to an SN with a UMTS BS and UMTS MSC.

S6 A UMTS MS roams to an SN with a GSM BS and a UMTS MSC.

To be consistent with the labels of the complete scenarios of the interoperation cases involving LTE components (Chapter 9), we use the same labels for the scenarios. In the description of the scenarios, a UMTS MS means that an MS uses a USIM smart card and its home network is 3G HN; a GSM MS means that an 2G ME equipped with a SIM. Table 8.2 shows the authentication scenarios of the interoperation cases in- volving GSM and UMTS components only including the rationale which refers to Table 8.1. Scenarios S1 and S2 have been discussed in Chapter 3 and 4, and we use the name S3 for pure LTE (Chapter 5). The remaining three scenarios S4–S6 will be discussed in the following sections. 79

Table 8.2: Classifying the interoperation cases involving GSM and UMTS components only. (The reasons are in Table 8.1)

Components ID Identity Scenario Reason ME BS MSC HN Module 122 3G 3G 3G S2 CHKV 123 2G 3G 3G S6 CILNV 126 3G 3G 2G 2G 3G S4 DILV 132 2G 3G 2G S1 EILV 135 2G 2G 2G S1 EILV 150 2G 3G 3G S6 CIKNV 153 2G 2G 3G S4 DIKV 3G 2G 159 2G 3G 2G S1 EIKV 162 2G 2G 2G S1 EIKV 203 3G 3G 3G S5 FHKMV 204 2G 3G 3G S1 FILV 207 2G 2G 3G S1 FILV 2G 2G 212 3G 3G 2G S5 EHKMV 213 2G 3G 2G S1 EILV 216 2G 2G 2G S1 EILV 231 2G 3G 3G S1 FIKV 234 2G 2G 3G S1 FIKV 2G 2G 240 2G 3G 2G S1 EIKV 243 2G 2G 2G S1 EIKV

8.2 Scenario S4: A UMTS MS roams to an SN with a GSM BS and GSM MSC

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings.

8.2.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM and UMTS diagrams. Figure 8.1 shows the authentication scenario. The MS sends its identity and capabilities to the SN as in the GSM I in Figure 3.2. The GSM SN then requests authentication vectors from the UMTS HN by sending the MS’s identity. Because the SN can only support GSM authentication vectors (authentication triplets), the HN 80

UMTS MS GSM BS, GSM MSC UMTS HN

GSM I

IMSI

Generate RAND & SQN MAC = f1(Ki, AMF, SQN, RAND) XRES_U = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AK = f5(Ki, RAND) AUTN = SQNAK || AMF || MAC XRES_G=c2(XRES_U), KC = c3(CK, IK)

RAND, XRES_G, KC

RAND RES_U = f2(Ki, RAND), CK =f3(Ki, RAND) IK = f4(Ki, RAND), RES_G=c2(RES_U), KC = c3(CK, IK) RES_G

Verify RES_G = XRES_G

GSM IV

Figure 8.1: UMTS subscriber roams into GSM network

produces authentication triplets with conversion functions. In this case, the UMTS CK and IK are converted into the GSM cipher key Kc, and the expected response is also converted by the function c2. Upon receiving the challenge from the GSM SN, the MS applies the same conversion functions to derive the GSM encryption key Kc and the response. The SN then verifies that the received response is the same as the expected response. This is followed by the remainder of the standard GSM IV. The goal of this scenario is to authenticate the MS and to establish an encryp- tion key that can then be used to protect the user data. This scenario is prone to the false base station attack as the GSM cipher command is not integrity protected and does not include the MS’s CAP.

8.2.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S4_GSM_I-IV_convert(3GAV-2GAV).pv. Figure 8.2 augments the protocol diagram of Figure 8.1 with details of the ProVerif model and shows the locations of the events which are used to specify au- thentication properties. Most of the code in this model is inherited from the GSM model and the UMTS model. The conversion functions are defined as: fun c2(resp):resp. fun c3(cipherKey , integKey): sessKey. Since the SN only supports GSM authentication, the events and queries are specified the same way as in GSM authentication (Section 3.3). The three processes represent- 81

UMTS MS GSM BS, GSM MSC UMTS HN GSM I GSM 1. CAP

2. IMSI

3. IMSI

UMTS II’UMTS Generate RAND & SQN MAC = f1(Ki, AMF, SQN, RAND) XRES_U = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AK = f5(Ki, RAND) AUTN = SQNAK || AMF || MAC XRES_G=c2(XRES_U), KC = c3(CK, IK)

4. RAND, XRES_G, KC

5. RAND RES_U = f2(Ki, RAND), CK =f3(Ki, RAND)

GSM III’GSM IK = f4(Ki, RAND), RES_G=c2(RES_U), KC = c3(CK, IK)

event begSN(imsi_ms, kc_ms)

6. RES_G Verify RES_G = XRES_G

event endSN(imsi_hn_sn, kc_sn)

Decide whether to use encryption

GSM IV GSM event begMS(imsi_hn_sn, kc_sn) 7. Selected algorithms

event endMS(imsi_ms, kc_ms) if cap_sn is false event disableEnc 8. CMC Complete

9. payload, if no encryption {payload}_kc_sn, otherwise Decrypt message if enableEnc_ms is true

Figure 8.2: UMTS subscriber roams into GSM network, annotated in accord with our model ing the MS, the SN, and the HN respectively are defined as follows. The comments refer to message numbers in Figure 8.2.

1 (∗ Process respresenting MS ∗) 2 l e t processMS = 3 new imsi ms : i d e n t ; 4 new k i : key ; 5 insert keys(imsi ms , k i ) ; 6 l e t cap ms : bool = encCapability() in 7 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 8 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 9 in ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) 10 l e t r e s m s u: resp = f2(ki, rand ms ) in 11 l e t ck ms: cipherKey = f3(ki, rand ms ) in 12 l e t ik ms: integKey = f4(ki, rand ms ) in 13 l e t r e s m s g: resp = c2(res m s u ) in 14 l e t kc ms: sessKey = c3(ck ms , ik ms ) in 15 event begSN ( imsi ms , kc ms ) ; 16 out ( pubChannel , (RES , r e s m s g ) ) ; (∗ [ Msg 6 ] ∗) 82

17 in (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) 18 event endMS( imsi ms , kc ms ) ; 19 out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) 20 in (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) 21 out (pubChannel, sencrypt(secretKc , kc ms ) ) ; 22 i f enableEnc ms = t r u e then 23 l e t msgcontent: b i t s t r i n g = sdecrypt(msg, kc ms ) in 24 0 . 25 26 l e t processSN = 27 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 28 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 29 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 30 in (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , 31 x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) 32 out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) 33 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 34 i f r e s s n = x r e s s n then 35 event endSN ( i m s i h n s n , k c s n ) ; 36 event begMS( i m s i h n s n , k c s n ) ; 37 out (pubChannel , (CMC, cap sn ) ) ; (∗ [ Msg 7 ] ∗) 38 in (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) 39 i f cap sn = f a l s e then 40 event disableEnc; 41 out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) 42 e l s e 43 out (pubChannel, (MSG, sencrypt(payload , kc s n ) ) ) . (∗ [ Msg 9 ] ∗) 44 45 l e t processHN = 46 in (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) 47 new rand hn : nonce ; 48 get keys (= imsi hn , k i h n ) in 49 l e t mac hn: mac = f1(ki hn , rand hn ) in 50 l e t x r e s h n u: resp = f2(ki hn , rand hn ) in 51 l e t ck hn: cipherKey = f3(ki hn , rand hn ) in 52 l e t i k hn: integKey = f4(ki hn , rand hn ) in 53 l e t x r e s h n g: resp = c2(xres h n u ) in 54 l e t kc hn: sessKey = c3(ck hn , i k h n ) in 55 out (secureChannel , (AV, imsi hn , rand hn , x r e s h n g , kc hn ) ) . The MS converts the response and the keys in lines 13–14. Similarly, in lines 53–54, the process of the HN converts the response and the keys.

8.2.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. We specify the security properties as following:

• Key Secrecy (secrecy of Ki and Kc) 83

Table 8.3: Analysis result of S4 model Key Conditional Authentication of Payload Authentication of Secrecy Payload Secrecy the MS to the SN Secrecy the SN to the MS Proved Proved Proved Failed Failed

1 not attacker (new k i ) . 2 query attacker (secretKc). • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Authentication of the MS to the SN query id: ident, k: sessKey; event (endSN(id , k)) event (begSN(id , k)). • Authentication of the SN to the MS query id: ident, k: sessKey; event (endMS(id , k)) event (begMS(id , k)). • Payload Secrecy query attacker ( payload ) . The analysis results are the same as in GSM authentication (Section 3.3). Table 8.3 shows the analysis result of the above properties. Proverif fails and finds an attack against the authentication of the SN to the MS. In this attack, the attacker impersonates as a false BS and feeds the MS with arbitrary challenge and encryption option. ProVerif finds a similar man-in-the-middle attack as in the GSM model when checking payload secrecy. The attack trace shows that the attacker intercepts the message that contains the MS’s capabilities and changes them to no-encryption, which forces the SN to choose not to encrypt the payload.

8.3 Scenario S5: A GSM MS roams to an SN with a UMTS BS and UMTS MSC

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings.

8.3.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM and UMTS diagrams. The components of the scenario shown in Figure 8.3 exchange messages fol- lowing the GSM I, II, and III (see Figure 3.2). In this case, the UMTS BS forwards all GSM traffic transparently. The GSM encryption key K c is then expanded to CK and IK using conversion functions both in the SN and in the MS. The MS and the SN then follow the steps of UMTS IV (Figure 4.2). The goal of this scenario is to provide for mutual authentication between the MS and the SN and to establish an encryption key that can then be used to protect the user data. 84

MS BS MSC HN

GSM I

GSM II

GSM III

CK = c4(Kc) CK = c4(Kc) IK = c5(Kc) IK = c5(Kc)

UMTS IV

Figure 8.3: GSM MS roams into UMTS network

8.3.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S5_GSM_I-III_UMTS_IV.pv. Figure 8.4 provides details of the ProVerif model and shows the locations of the events which are used to specify authentication properties. Most of this model’s code is also inherited from the GSM model and the UMTS model. The conversion functions are defined as: fun c4(sessKey): cipherKey. fun c5(sessKey): integKey.

Since the SN authenticates the MS as in the GSM AKA, the events begSN and endSN use the GSM session key as one parameter. The MS authenticates the SN as in UMTS authentication, and the events begMS and endMS use UMTS keys as parameters. The events are declared as: event begSN(ident , sessKey). event endSN(ident , sessKey). event begMS(ident , cipherKey , integKey). event endMS(ident , cipherKey , integKey). To specify the secrecy properties of the GSM session key Kc, the UMTS cipher key CK , and the UMTS integrity key IK , we declare a secret (the technique is discussed in Section 3.2.1): f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. The secret is encrypted under the Kc, the CK , and the IK respectively and is sent out over the public channel. The MS process and the SN process are specified as follows. The comments refer to message numbers in Figure 8.4. 85

GSM MS UMTS BS, UMTS MSC GSM HN

GSM I GSM 1. CAP

2. IMSI

3. IMSI

GSM II GSM Generate rand_hn xres_hn = a3(rand_hn, Ki) kc_hn = a8(rand_hn, Ki)

4. IMSI, RAND, XRES, KC

5. RAND

res_ms = a3(rand_ms, Ki) GSM IIIGSM kc_ms = a8(rand_ms, Ki) event begSN(imsi_ms,kc_ms)

6. RES

Verify res_sn = xres_sn

event endSN(imsi_hn_sn, kc_sn)

ck_ms = c4(kc_ms) ck_sn = c4(kc_sn) ik_ms = c5(kc_ms) ik_sn = c5(kc_sn)

Decide whether to use encryption Generate fresh_sn MAC-I_sn = f9((enableEnc_sn, cap_sn, fresh_sn), ik_sn) event begMS(imsi_hn_sn, ck_sn, ik_sn, cap_sn)

UMTS IV UMTS 7. enableEnc, CAP, FRESH, MAC-I

Verify cap_ms = cap_sn_ms and MAC-I if enableEnc_sn is false

event endMS(imsi_ms, ck_ms, ik_ms, cap_ms) event disableEnc

8. SMC complete, MAC-I Verify MAC-I

9. payload, FRESH, MAC, if no encryption {payload}_ck_sn, FRESH, MAC, otherwise Verify MAC, decrypt message if alg_ms supports encryption

Figure 8.4: GSM subscriber roams into UMTS network annotated in accord with our model

1 l e t processMS = 2 new imsi ms : i d e n t ; 3 new k i : key ; 4 insert keys(imsi ms , k i ) ; 5 l e t cap ms : bool = encCapability() in 6 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 7 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 8 in ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) 9 l e t res ms: resp = a3(rand ms , k i ) in 10 l e t kc ms: sessKey = a8(rand ms , k i ) in 11 event begSN ( imsi ms , kc ms ) ; 86

12 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 13 l e t ck ms:cipherKey = c4(kc ms ) in 14 l e t ik ms:integKey = c5(kc ms ) in 15 in (pubChannel , (=SMC, enableEnc ms : bool , =cap ms , f r e s h m s : nonce , 16 =f9((enableEnc ms , cap ms , f r e s h m s ) , ik ms ) ) ) ; (∗ [ Msg 7 ] ∗) 17 event endMS( imsi ms , ck ms , ik ms , cap ms ) ; 18 out (pubChannel , (SMComplete, f9(smcompleteMsg, ik ms ) ) ) ; 19 (∗ [ Msg 8 ] ∗) 20 in (pubChannel , (=MSG, msg: b i t s t r i n g , fresh msg ms : nonce , 21 =f9((msg, fresh msg ms ) , ik ms ) ) ) ; (∗ [ Msg 9 ] ∗) 22 out (pubChannel, sencryptSess(secret , kc ms ) ) ; 23 out (pubChannel, sencrypt(secretCk , ck ms ) ) ; 24 out (pubChannel, sencryptInteg(secretIk , ik ms ) ) ; 25 i f enableEnc ms = t r u e then 26 l e t msgcontent: b i t s t r i n g = sdecrypt(msg, ck ms ) in 0 . 27 28 l e t processSN = 29 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 30 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 31 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 32 in (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , 33 x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) 34 out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) 35 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 36 i f r e s s n = x r e s s n then 37 event endSN ( i m s i h n s n , k c s n ) ; 38 l e t c k sn:cipherKey = c4(kc s n ) in 39 l e t i k sn:integKey = c5(kc s n ) in 40 new f r e s h s n : nonce ; 41 event begMS( i m s i h n s n , ck sn , i k s n , cap sn ) ; 42 out (pubChannel , (SMC, cap sn , cap sn , f r e s h s n , 43 f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 7 ] ∗) 44 in (pubChannel , (=SMComplete, =f9(smcompleteMsg, ik s n ) ) ) ; 45 (∗ [ Msg 8 ] ∗) 46 new f r e s h m s g s n : nonce ; 47 i f cap sn = f a l s e then 48 event disableEnc; 49 out (pubChannel, (MSG, payload , fresh m s g s n , 50 f9((payload , fresh m s g s n ) , i k s n ) ) ) (∗ [ Msg 9 ] ∗) 51 e l s e 52 out (pubChannel, (MSG, sencrypt(payload , ck s n ) , f r e s h m s g s n , 53 f9((sencrypt(payload , ck s n ) , f r e s h m s g s n ) , i k s n ) ) ) . 54 (∗ [ Msg 9 ] ∗) The HN process is the same as the HN process in the GSM model. The MS converts the CK and IK from GSM cipher key Kc in lines 13–14, and the SN converts them in lines 38-39. 87

Table 8.4: Analysis result of S5 model Key Conditional Authentication of Payload Authentication of Secrecy Payload Secrecy the MS to the SN Secrecy the SN to the MS Proved Proved Proved Failed Proved

8.3.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. The secrecy and authentication properties are specified as:

• Key Secrecy (secrecy of Ki, Kc, CK, and IK) not attacker (new k i ) . query attacker ( s e c r e t ) . query attacker (secretCk). query attacker (secretIk). • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Mutual Authentication between the MS and the SN query d:ident , k:sessKey; event (endSN(d,k)) event (begSN(d,k)). query d:ident , c:cipherKey , i:integKey; event (endMS(d,c, i )) event (begMS(d,c, i )). • Payload Secrecy query attacker ( payload ) .

Table 8.4 shows the analysis result of the above properties. As expected, the payload secrecy property fails. The attack trace found by ProVerif shows that the attacker intercepts and modifies the encryption capability of the MS to no capability of en- cryption, thus forcing the SN to choose not to enable encryption and to send out payload in clear text. The attacker can at least learn the contents of the first message sent by the SN.

8.4 Scenario S6: A UMTS MS roams to an SN with a GSM BS and a UMTS MSC

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings. 88

MS BS MSC HN

UMTS I

UMTS II

UMTS III

Kc = c3(CK, IK) Kc = c3(CK, IK)

GSM IV

Figure 8.5: UMTS subscriber roams into mixed network [94, 76]

8.4.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM and UMTS diagrams. The scenario in which a UMTS MS roams to an SN with a GSM BS and a UMTS MSC is shown in Figure 8.5. Since the MS and UMTS MSC support the UMTS I, II, and III (shown in Figure 4.2), these three blocks of message exchanges are executed. The GSM BS forwards the traffic transparently. Because this roaming scenario uses the GSM BS, the CK and IK are not supported. A conversion function has to be used both in the MS and in the SN to generate the GSM encryption key Kc. Since the GSM BS does not support the SMC procedure of the UMTS, the MS and the SN proceed with GSM IV from Figure 3.2. The goal of this scenario is to provide for mutual authentication between the MS and the SN and to establish an encryption key that can then be used to protect the user data.

8.4.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S6_UMTS_I-III_GSM_IV.pv. Building on the protocol diagram of Figure 8.5, Figure 8.6 shows details of the ProVerif model and the locations of the events which are used to specify authentica- tion properties. Once again, most of this model’s code is inherited from the GSM model and the UMTS model. The conversion function is defined as: fun c3(cipherKey , integKey): sessKey. Since the SN authenticates the MS as in UMTS authentication, the events begSN and endSN use UMTS keys in the authentication property specification. The events are declared as: 89

UMTS MS GSM BS, UMTS MSC UMTS HN

UMTS I UMTS 1. CAP 2. IMSI

3. IMSI

UMTS II UMTS Generate rand_hn, Compute mac_hn, xres_hn, ck_hn, ik_hn and autn_hn

4.IMSI, RAND, XRES, CK, IK, AUTN 5. RAND, AUTN

Compute res_ms, ck_ms, ik_ms, xmac_ms

UMTS IIIUMTS Verify mac_ms=xmac_ms

event begSN(imsi_ms,ck_ms, ik_ms) 6. RES

Verify res_sn = xres_sn

event endSN(imsi_hn_sn, ck_sn, ik_sn)

kc_ms = c3(ck_ms, ik_ms) kc_sn = c3(ck_sn, ik_sn)

Decide whether to use encryption GSM event begMS(imsi_hn_sn, kc_sn)

7. Selected algorithms

IV

event endMS(imsi_ms, kc_ms) if cap_sn is false event disableEnc 8. CMC Complete

8. payload, if no encryption {payload}_kc_sn, otherwise Decrypt message if enableEnc_ms is true

Figure 8.6: UMTS subscriber roams into mixed network annotated in accord with our model event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , sessKey). event endMS(ident , sessKey). Similar to previous cases, we use a secret to specify the secrecy of the Kc, the CK and the IK . The MS process and the SN process are defined as follows. The comments refer to message numbers in Figure 8.6.

1 l e t processMS = 2 new imsi ms : i d e n t ; 3 new k i : key ; 4 insert keys(imsi ms , k i ) ; 5 l e t cap ms : bool = encCapability() in 6 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 7 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 90

8 in ( pubChannel , (=CHALLENGE, rand ms: nonce, mac ms : mac ) ) ; 9 (∗ [ Msg 5 ] ∗) 10 i f f 1 ( ki , rand ms ) = mac ms then 11 l e t res ms: resp = f2(ki, rand ms ) in 12 l e t ck ms: cipherKey = f3(ki, rand ms ) in 13 l e t ik ms: integKey = f4(ki, rand ms ) in 14 event begSN ( imsi ms , ck ms , ik ms ) ; 15 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 16 l e t kc ms: sessKey = c3(ck ms , ik ms ) in 17 in (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) 18 event endMS( imsi ms , kc ms ) ; 19 out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) 20 in (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) 21 out (pubChannel, sencrypt(secretKc , kc ms ) ) ; 22 out (pubChannel, sencryptInteg(secretIk , ik ms ) ) ; 23 out (pubChannel, sencryptCipher(secretCk , ck ms ) ) ; 24 i f enableEnc ms = t r u e then 25 l e t msgcontent: b i t s t r i n g = sdecrypt(msg, kc ms ) in 0 . 26 27 (∗ Process respresenting SN ∗) 28 l e t processSN = 29 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 30 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 31 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 32 in (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , 33 x r e s s n : resp , c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; 34 (∗ [ Msg 4 ] ∗) 35 out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) 36 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 37 i f r e s s n = x r e s s n then 38 event endSN ( i m s i h n s n , ck sn , i k s n ) ; 39 l e t k c sn: sessKey = c3(ck sn , i k s n ) in 40 event begMS( i m s i h n s n , k c s n ) ; 41 out (pubChannel , (CMC, cap sn ) ) ; (∗ [ Msg 7 ] ∗) 42 in (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) 43 i f cap sn = f a l s e then 44 event disableEnc; 45 out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) 46 e l s e 47 out (pubChannel, (MSG, sencrypt(payload , kc s n ) ) ) . 48 (∗ [ Msg 9 ] ∗) The HN process is the same as the HN process in the UMTS model. The MS converts the GSM cipher key Kc from CK and IK in line 16, and the SN converts it in line 39.

8.4.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. 91

Table 8.5: Analysis result of S6 model Key Conditional Authentication of Payload Authentication of Secrecy Payload Secrecy the MS to the SN Secrecy the SN to the MS Proved Proved Proved Failed Failed

The secrecy and authentication properties are specified as:

• Key Secrecy (secrecy of Ki, Kc, CK, and IK) not attacker (new k i ) . query attacker (secretKc). query attacker (secretCk). query attacker (secretIk). • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Mutual Authentication between the MS and the SN 1 query d:ident , c:cipherKey , i:integKey; 2 event (endSN(d,c, i )) event (begSN(d,c, i )). 3 query d:ident , k:sessKey; event (endMS(d,k)) event (begMS(d,k)). • Payload Secrecy query attacker ( payload ) . Table 8.5 shows the analysis result of the above properties. The query of payload secrecy fails and ProVerif finds a trace similar to the one we describe for the same query against the GSM (Section 3.3). The attacker intercepts and modifies the en- cryption capability of the MS to no capability of encryption, thus forcing the SN to choose not to encrypt the payload and send out it in clear text. What is interesting is that the required authentication of the SN to the MS (the query in line 3 of the mutual authentication between the MS and the SN) is violated and yields the following attack trace:

1 new imsi ms creating imsi m s 1 2 new ki creating ki 2 3 insert keys(imsi ms 1 , k i 2 ) 4 out (pubChannel , (CAP,true)) 5 out (pubChannel , (ID,imsi m s 1 ) ) 6 in (pubChannel , (CAP, false )) 7 in (pubChannel , (ID,imsi m s 1 ) ) 8 outsecureChannel , (AV REQ , i m s i m s 1 ) ) 9 new rand hn creating rand hn 3 10 get keys ( imsi ms 1 , k i 2 ) 11 outsecureChannel , (AV,imsi ms 1 , rand hn 3 , f 2 ( k i 2 , rand hn 3 ) , 12 f 3 ( k i 2 , rand hn 3 ) , f 4 ( k i 2 , rand hn 3 ) , f 1 ( k i 2 , rand hn 3 ) ) ) 13 out (pubChannel , (CHALLENGE, rand hn 3 , f 1 ( k i 2 , rand hn 3 ) ) ) 14 in (pubChannel , (CHALLENGE, rand hn 3 , f 1 ( k i 2 , rand hn 3 ) ) ) 15 event (begSN(imsi ms 1 , f 3 ( k i 2 , rand hn 3 ) , f 4 ( k i 2 , rand hn 3 ) ) ) 16 out (pubChannel , (RES,f2(ki 2 , rand hn 3 ) ) ) 17 in (pubChannel , (CMC, false )) 18 event (endMS(imsi ms 1 , c3 ( f 3 ( k i 2 , rand hn 3 ) , f 4 ( k i 2 , rand hn 3 ) ) ) ) 92

In the attack trace, the attacker first acts as a BS to intercept the capability message and replace it with no-encryption. The attacker forwards the challenge and response messages to the MS and the BS. Since there is no integrity protection, the attacker forges the CMC message and sends it to the MS. That means the MS can receive the CMC message without executing the event in line 40 in the SN process. As a result, the correspondence assertion event(endMS(d,k)) event(begMS(d,k)) is violated by executing the event endMS without previously executing the event begMS. 93

Chapter 9 Modeling and Analysis of Scenarios involving LTE Procedures

In this chapter, we determine the authentication scenarios of the cases involving LTE system components (Section 9.1). Some cases fall into pure AKAs (Chapter 3–5). Other cases fall into scenarios introduced in Chapter 8 which use only blocks from the GSM and UMTS AKAs. The remaining cases fall into scenarios that use protocol blocks from LTE; those scenarios are discussed in this chapter. Just like the previous chapters, each scenario is presented as message sequence charts and provided with the model and analysis (Sections 9.2–9.5). Table 9.2 gives complete classification for all interoperation cases of 3 generations (including what is in Table 8.2).

9.1 Determining the Scenarios involving LTE Components

In this section, we list the reasons to determine what authentication scenarios occur for each case. It turns out there are 10 distinct authentication scenarios. 3 of them are the native GSM, UMTS, and LTE AKAs. Chapter 8 discussed 3 interoperation authentication scenarios involving GSM and UMTS procedures only. The remaining 4 scenarios will be discussed in the following sections. We follow the same rationale as in Section 8.1 to determine the authentication scenario block by block for each case. First we consider which message might trig- ger the AKA to determine the messages transmitted in the first block. Second, we consider what kind of authentication vector should be generated and subsequently provided to the MSC/MME in the second block. The kind of authentication vector is depend on the type and capabilities of the HN, the MSC, the BS, and the identity module. Third, we consider the challenge response procedure, which is determined by the kind of authentication vector, in the third block. Fourth, we consider whether the NAS SMC procedure is possible for the cases containing the MME as one com- ponent. If it is possible, we consider if the NAS SMC procedure is optional. If it is optional, we check both possibilities. Fifth, we consider the type of the BS, which determines the type of the security mode setup procedure. Depending on the type of BS it controls, the MSC/MME might have to convert the encryption/integrity keys. Table 9.1 provides the detailed reasons. Using this approach, we categorize the allowable and uncertain interoperation cases involving LTE system components into 10 distinct scenarios:

S1 GSM I–IV.

S2 UMTS I–IV.

S3 LTE I–V. 94

Table 9.1: Reasons used for determining AKA scenarios

A Upon request by an MME with network type equals E-UTRAN, the 4G HN generates and delivers the 4G AVs (separation bit = 1) [8, Section 6 Page 20-21]. B Upon request by an MME with network type equals UTRAN or GERAN, the 4G HN gen- erates and delivers the 4G AVs, plus CK and IK (separation bit = 0) [8, Section 6 Page 20-21]. Type of AV C Upon request by a 3G VLR/SGSN, the 3G HN generates and sends out 3G AVs [7, Section 6.3.2 Page 21-23]. D Upon request by a 2G VLR/SGSN with a 3G IMSI, the 3G HN generates 2G AVs from 3G AVs [1, Section 6.1 Case 4 Page13, Page 30-32]. E 2G HN only supports to generate 2G AVs [1, Section 4.4 Page 9]. F Upon request by a VLR/SGSN/MME with a 2G IMSI, the 3G HN always generates and delivers the 2G AVs [1, Section 6.3.1 Page 19, Page 30-32]. O Upon request by a 3G VLR/SGSN, the 4G HN generates 3G AVs [8, Section 6.1.2 Page 21, or derived from D]. P Upon request by a 2G VLR/SGSN with 3G/4G IMSI, the 4G HN generates 2G AVs from UMTS AVs [Derived from D]. Q Upon request by an MME, the 3G HN generates 3G AVs [1, Section 6.1 Case 5 Page 14, Section 6.2.2 Case 6 Page 18, and derived from E]. R Upon request by a 2G VLR/SGSN with a 4G IMSI, the 3G HN generates 2G AVs from 3G AVs [Derived from D]. S Upon request by a VLR/SGSN/MME with a 2G IMSI, the 4G HN always generates and delivers the 2G AVs [Derived from F]. G 4G BS only supports 4G SMC [8, Section 7.2.4.5 Page 33]. Type of BS H 3G BS only supports 3G SMC [1, Section 6.3.1 Case 1 Page 20]. I 2G BS only supports 2G SMC [1, Section 6.1 Case 2 Page 13]. J The 4G ME supports to derive KASME and store the security contexts. [6, Section 5.4.2.1 Page 61] Type of ME K XG ME supports XG SMC [8, Section 7.2.4.5 Page 33],[7, Section 6.4.5 Page 31-33] L 3G ME supports 2G SMC [1, Section 6.1 Case 2 Page 13]. T 4G ME supports 2G/3G SMC [Derived from L] M The 3G BS requires CK and IK, the VLR/SGSN/MME generates them from Kc by applying Conversion conversion function c3 [1, Section 6.3.1 Case 1 Page 20]. N 2G BS is not capable of handling of cipher and integrity keys. The VLR/SGSN/MME converts the CK and IK into Kc [1, Section 6.1 Case 2 Page 13]. U Because the 4G BS requires KeNB , which is derived from the KASME , the VLR/SGSN/MME generates KASME from the CK, IK and sends it to the BS [Derived from M] or [8, Section 9.1.2 Page 51]. V Triggered by attach request or RAU request, the first block is GSM I or UMTS I [4, Section First Block 6.5], [5, Section 5.3.3] W Triggered by LTE attach request or TAU request in which the nonce is never used, the first block is LTE I [8, Section 9.1.2]. X Triggered by TAU request and the nonce is used in latter blocks, the first block is LTE I’ [5, Section 8.2.4.1], [52, Section 11.1.2].

S4 GSM I k UMTS II’ k GSM III’–IV, conv(3G AV → 2G AV).

S5 GSM I–III k UMTS IV, conv(Kc → CK IK , VLR/SGSN).

S6 UMTS I–III k GSM IV, conv(CK IK → Kc, VLR/SGSN).

S7 LTE I k UMTS II–III k [optionally, LTE IV] k LTE V, conv(CK IK → KASME , MME).

S8 LTE I’ k UMTS II–III k LTE IV–V, conv(CK IK nonces → KASME , MME). 95

S9 GSM I k LTE II–III k [optionally, LTE IV] k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK.

S10 UMTS I k LTE II–III k [optionally, LTE IV] k UMTS IV, AV = 4G AV + CK + IK.

The blocks are as introduced in Figs. 3.2, 4.2, and 5.2. With notation “a k b” we indicate that block b follows after block a. Scenarios S7, S9, and S10 have blocks marked in brackets as optional. It is consistent with the specifications to either include or omit these blocks, so we analyze versions with and without the block. The notation “conv(K 1 → K 2, C)” denotes that network component C con- verts key K 1 into K 2. Furthermore, “AV = 4G AV + CK + IK” indicates that the 4G HN provides not only the 4G authentication vector to the MME but also includes the UMTS encryption key CK and integrity key IK. S1–S3 are the pure cases and are discussed in Chapter 3–5. Scenarios S4–S6 coincide with scenarios described in Chapter 8. In Table 9.2, we determine and categorize the AKA for all of the allowed and uncertain cases involving LTE system components, including the rationale which refers to Table 9.1. Table 9.2: Classifying the interoperation cases (for GSM, UMTS, and LTE)

Components Reason ID Scenario Identity Stated in ME BS MSC/ HN Interpretation Module MME spec 1 4G 4G 4G S3 AGKW 2 3G 4G 4G S10 BHV T 3 2G 4G 4G S9 BINV T 5 3G 3G 4G S2 HV OT 6 2G 3G 4G S6 INV OT 9 2G 2G 4G S4 IV PT 10 4G 4G 3G S7/8 GKWX QT 11 3G 4G 3G S2 HV QT 12 4G 4G 2G 4G 3G S6 INV QT 14 3G 3G 3G S2 CHV T 15 2G 3G 3G S6 CINV T 18 2G 2G 3G S4 IV RT 20 3G 4G 2G S5 EHMV T 21 2G 4G 2G S1 EIV T 23 3G 3G 2G S5 EIV T 24 2G 3G 2G S1 EIV T 27 2G 2G 2G S1 EIV T 96

Table 9.2: Classifying the interoperation cases (for GSM, UMTS, and LTE)

Components Reason ID Scenario Identity Stated in ME BS MSC/ HN Interpretation Module MME spec 29 3G 4G 4G S10 BHKV 30 2G 4G 4G S9 BILNV 32 3G 3G 4G S2 HKV O 33 2G 3G 4G S6 ILNV O 36 2G 2G 4G S4 ILV P 38 3G 4G 3G S2 HKV Q 39 2G 4G 3G S6 ILNV Q 41 4G 3G 3G 3G 3G S2 CHKV 42 2G 3G 3G S6 CILNV 45 2G 2G 3G S4 ILV R 47 3G 4G 2G S5 EHKMV 48 2G 4G 2G S1 EILV 50 3G 3G 2G S5 EHKMV 51 2G 3G 2G S1 EILV 54 2G 2G 2G S1 EILV 57 2G 4G 4G S9 BIKNV 60 2G 3G 4G S6 IKNV O 63 2G 2G 4G S4 IKV P 66 2G 4G 3G S6 IKNV Q 69 4G 2G 2G 3G 3G S6 CIKNV 72 2G 2G 3G S4 IKV R 75 2G 4G 2G S1 EIKV 78 2G 3G 2G S1 EIKV 81 2G 2G 2G S1 EIKV 82 4G 4G 4G S3 AGJKW 83 3G 4G 4G S10 BHV T 84 2G 4G 4G S9 BINV T 86 3G 3G 4G S2 HV QT 87 2G 3G 4G S6 INV QT 90 2G 2G 4G S4 IV PT 91 4G 4G 3G S7/8 GKWX QU 92 3G 4G 3G S2 HV QT 93 3G 4G 2G 4G 3G S6 INV QT 95 3G 3G 3G S2 CHV T 96 2G 3G 3G S6 CINV T 99 2G 2G 3G S4 DIV T 97

Table 9.2: Classifying the interoperation cases (for GSM, UMTS, and LTE)

Components Reason ID Scenario Identity Stated in ME BS MSC/ HN Interpretation Module MME spec 101 3G 4G 2G S5 EHMV T 102 2G 4G 2G S1 EIV T 104 3G 3G 2G S5 EHMV T 105 2G 3G 2G S1 EIV T 108 2G 2G 2G S1 EIV T 110 3G 4G 4G S2 BHKV 111 2G 4G 4G S6 BILNV 113 3G 3G 4G S2 HKV O 114 2G 3G 4G S6 ILNV O 117 2G 2G 4G S4 ILV P 119 3G 4G 3G S2 HKV Q 120 3G 3G 2G 4G 3G S6 ILNV Q 122 3G 3G 3G S2 CHKV 123 2G 3G 3G S6 CILNV 126 2G 2G 3G S4 DILV 128 3G 4G 2G S5 EHKMV 129 2G 4G 2G S1 EILV 132 2G 3G 2G S1 EILV 135 2G 2G 2G S1 EILV 138 2G 4G 4G S6 BIKNV 141 2G 3G 4G S6 IKNV O 144 2G 2G 4G S4 IKV P 147 2G 4G 3G S6 IKNV Q 150 3G 2G 2G 3G 3G S6 CIKNV 153 2G 2G 3G S4 DIKV 156 2G 4G 2G S1 EIKV 159 2G 3G 2G S1 EIKV 162 2G 2G 2G S1 EIKV 167 3G 3G 4G S5 HMV ST 168 2G 3G 4G S1 IV ST 171 2G 2G 4G S1 IV ST 176 3G 3G 3G S5 FHMV T 177 2G 4G 2G 3G 3G S1 FIV T 180 2G 2G 3G S1 FIV T 185 3G 3G 2G S5 EHMV T 186 2G 3G 2G S1 EIV T 98

Table 9.2: Classifying the interoperation cases (for GSM, UMTS, and LTE)

Components Reason ID Scenario Identity Stated in ME BS MSC/ HN Interpretation Module MME spec 189 2G 2G 2G S1 EIV T 194 3G 3G 4G S5 HKMV S 195 2G 3G 4G S1 ILV S 198 2G 2G 4G S1 ILV S 203 3G 3G 3G S5 FHKMV 204 2G 3G 2G 3G 3G S1 FILV 207 2G 2G 3G S1 FILV 212 3G 3G 2G S5 EHKMV 213 2G 3G 2G S1 EILV 216 2G 2G 2G S1 EILV 222 2G 3G 4G S1 IKV S 225 2G 2G 4G S1 IKV S 231 2G 2G 2G 3G 3G S1 FIKV 234 2G 2G 3G S1 FIKV 240 2G 3G 2G S1 EIKV 243 2G 2G 2G S1 EIKV

As a summary, Table 9.3 shows what combination of the components lead to the scenarios. For each case that is allowed or uncertain, if its components matches the one of the conditions then its AKA scenario is the one for that row. For example, if the BS and HN are 2G then the AKA scenario is S1. Conversely, for each scenario the condition characterizes the components for all the cases that use that scenario. In the table, a 4G capable MS means that either the identity module is a 4G USIM or it is a 4G ME, i.e., the MS supports 4G AKA. There are a variety of cases result in scenario S2. It is difficult to summarize the common characterization of the cases. However, since all other scenarios have determining combination of components, if one case does not contains any combination of components listed for other scenarios, the AKA scenario of the case is scenario S2.

9.2 Scenario S7: LTE I k UMTS II–III k [optionally, LTE IV] k LTE V, conv(CK IK → KASME , MME)

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings. 99

Table 9.3: Determining components of each scenario

Scenario Component condition S1 2GBS + 2GHN or SIM + 2GBS S2 all others S3 USIM/4G USIM + 4GME + 4GBS + MME + 4GHN S4 USIM/4G USIM + 2GBS + 2GVLR/SGSN + 3GHN/4GHN S5 3GBS+2GHN or SIM+3GBS USIM/4G USIM + 2GBS + 3GVLR/SGSN/4GMME + 3GHN/4GHN S6 but not 4G capable MS + MME + 4G HN S7/S8 4GBS + MME + 3GHN S9 4G capable MS + 2GBS + MME + 4GHN S10 4G capable MS + 3GBS + MME +4GHN

9.2.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM, UMTS, and LTE diagrams. This scenario is characterized by a 4G ME, a 4G SN (i.e., 4G BS and 4G MME) and a USIM or 4G USIM identity module subscribed to a 3G HN. A typical case is when a 4G ME equipped with a USIM whose home network is 3G HN roams into a 4G serving network. Two of the allowable/uncertain cases fall into this category. The AKA is triggered by the attach request. The identity request and response procedure is the same as in LTE I (Fig. 5.2). The 3G HN can generate 2G or 3G authentication vectors, but cannot generate 4G authentication vectors. Upon request by the MME, the 3G HN therefore generates and delivers a 3G authentication vector which thus is identical to UMTS II. Upon receiving the authentication vector, the MME communicates with the MS as in UMTS III. The 4G BS requires 4G AS keys, which are derived from the intermediate key KeNB . Because the intermediate key KeNB is derived from the local master key KASME , the MME applies a key derivation function to generate the local master key KASME from the UMTS encryption key CK and integrity key IK . Including LTE IV is optional in this scenario. Later, we analyze both variations and show that the AKA without LTE IV is prone to an attack in which a false base station can both eavesdrop and modify the messages between the MS and the SN. Executing both LTE IV and V prevents this attack. LTE V (Fig. 5.2) is executed which includes the deriving of KeNB . Fig. 9.1 shows this AKA scenario without LTE IV. Fig. 9.2 shows this AKA scenario with LTE IV.

9.2.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. 100

4G ME with USIM 4G BS MME 3G HN LTE I

UMTS II

UMTS III

KASME = KDF’(CK, IK) KASME = KDF’(CK, IK)

LTE V

Figure 9.1: AKA scenario S7 without LTE IV

4G ME with USIM 4G BS MME 3G HN LTE I

UMTS II

UMTS III

KASME = KDF’(CK, IK) KASME = KDF’(CK, IK)

LTE IV

LTE V

Figure 9.2: AKA scenario S7 with LTE IV

Scenario S7 without LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S7_LTE-I_UMTS_II-III_LTE_V.pv. Fig. 9.3 elaborates the scenario in Fig. 9.1 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. Most of the code in this model is inherited from the LTE model and the UMTS model. The SN authenticates the MS as in UMTS authenti- cation, the events begSN and endSN use UMTS keys in the authentication property specification. The MS authenticates the SN (through the eNB) as in LTE authenti- cation, and the events begMS ENB and endMS ENB use the intermediate key KeNB and the capabilities as input parameters. event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). Using the same technique (see Section 3.2.1) to check the secrecy of the keys as in other models, a private value is declared as f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. 101

4G ME with USIM 4G BS MME 3G HN LTE 1.CAP

I 2. IMSI

3. IMSI

UMTS II UMTS Generate RAND ,MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

4. IMSI, RAND, AUTN, XRES, CK, IK 5. RAND, AUTN XMAC = f1(Ki, RAND) UMTS IIIUMTS MAC = XMAC, RES = f2(Ki, RAND) CK = f3(Ki, RAND), IK = f4(Ki, RAND) event begSN(imsi_ms, ck_ms, ik_ms)

6. RES Verify RES = XRES event endSN(imsi_sn, ck_sn, ik_sn)

KASME = KDF’(CK, IK) KASME = KDF’(CK, IK)

KeNB = KDF(KASME) 7. CAP, KeNB

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) Decide enableENC, AS-MAC = EIA(enableEnc, KRRCint) LTE LTE event begMS_ENB(imsi_sn, kenb_sn, cap_sn)

V

8. enableEnc, AS-MAC

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) XAS-MAC = EIA(enableEnc, KRRCint) Verify XAS-MAC = AS-MAC

event endMS_ENB(imsi_ms, kenb_ms, cap_ms)

9. AS SMComplete Integrity protected Verify integrity of message 9

10. payload, if no encryption {payload}_KRRCenc, otherwise Decrypt message ifenableEnc_ms is true

Figure 9.3: AKA scenario S7, version without LTE IV, annotated in accord with our model

The secret is encrypted under the keys and is sent out over the public channel. The processes of the MS and the SN (MME + BS) are defined as follows. The comments refer to message numbers in Figure 9.3.

1 l e t processMS = 2 new imsi ms : i d e n t ; 102

3 new k i : key ; 4 insert keys(imsi ms , k i ) ; 5 l e t cap ms : bool = encCapability() in 6 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 7 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 8 in ( pubChannel , (=CHALLENGE, rand ms: nonce, mac ms : mac ) ) ; 9 (∗ [ Msg 5 ] ∗) 10 i f f 1 ( ki , rand ms ) = mac ms then 11 l e t res ms: resp = f2(ki, rand ms ) in 12 l e t ck ms: cipherKey = f3(ki, rand ms ) in 13 l e t ik ms: integKey = f4(ki, rand ms ) in 14 event begSN ( imsi ms , ck ms , ik ms ) ; 15 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 16 l e t kasme ms = kdf asme ( ck ms , ik ms ) in 17 l e t kenb ms: enbKey = kdf e n b ( kasme ms ) in 18 l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) in 19 l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) in 20 l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) in 21 in (pubChannel , (=ASSMC, enableEnc as ms : bool , =f i n t e g a s 22 (bool2bitstring(enableEnc as ms ) , k a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) 23 out (pubChannel , (ASSMComplete, as smcomplete msg , 24 f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 9 ] ∗) 25 event endMS ENB( imsi ms , kenb ms , cap ms ) ; 26 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , 27 =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 10] ∗) 28 out (pubChannel, sencrypt(secret , ck ms ) ) ; 29 out (pubChannel, sencryptInteg(secret , ik ms ) ) ; 30 out (pubChannel , sencryptEnb(secret , kenb ms ) ) ; 31 i f enableEnc as ms = t r u e then 32 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) 33 in 0 . 34 35 l e t processSN = 36 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 37 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 38 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) 39 in (secureChannel , (=AV, =imsi s n , r a n d sn: nonce, xres s n : resp , 40 c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 4 ] ∗) 41 out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) 42 in (pubChannel, (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) 43 i f r e s s n = x r e s s n then 44 event endSN ( i m s i s n , ck sn , i k s n ) ; 45 l e t kasme sn = kdf asme ( ck sn , i k s n ) in 46 l e t kenb sn: enbKey = kdf e n b ( kasme sn ) in 47 l e t k a s e n c sn: asEncKey = kdf a s e n c ( kenb sn ) in 48 l e t k a s i n t sn: asIntKey = kdf a s i n t ( kenb sn ) in 49 l e t kupenc sn: upEncKey = kdf u p e n c ( kenb sn ) in 50 event begMS ENB( i m s i s n , kenb sn , cap sn ) ; 51 out (pubChannel , (ASSMC, cap sn , f i n t e g as(bool2bitstring(cap sn ) , 52 k a s i n t s n ) ) ) ; (∗ [ Msg 8 ] ∗) 53 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 103

54 =f i n t e g a s ( as smcomplete msg , k a s i n t s n ) ) ) ; (∗ [ Msg 9 ] ∗) 55 i f cap sn = f a l s e then 56 event disableEnc; 57 out (pubChannel, (MSG, payload , finteg as(payload , kasint s n ) ) ) 58 (∗ [ Msg 10] ∗) 59 e l s e 60 out (pubChannel , (MSG, sencrypt as(payload , kasenc s n ) , 61 f i n t e g as(sencrypt as(payload , kasenc s n ) , k a s i n t s n ) ) ) . 62 (∗ [ Msg 10] ∗) In lines 39–40, the SN receives the UMTS authentication vector from the HN. In lines 16 and 45, the MS and the SN derive the master key KASME from the UMTS cipher and integrity keys. The MS and the SN derive the intermediate key KeNB and the AS keys in lines 17–20 and lines 46–49 respectively. The HN process is the same as the one in the UMTS model (Section 4.2.2).

Scenario S7 with LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S7_LTE-I_UMTS_II-III_LTE_IV-V.pv. Fig. 9.4 elaborates the scenario in Fig. 9.2 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. In addition to the authentication of the MS to the SN and the authentication of the BS to the MS, this scenario also provides for the authentication of the MME to the MS. The events specifying the authentication properties are defined as: event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , asmeKey, bool ). event endMS(ident , asmeKey, bool ). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). The processes representing the behavior of the components are defined as fol- lows. The comments refer to message numbers in Figure 9.4.

1 (∗ AS SMC procedure in process MS ∗) 2 l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = 3 l e t kenb ms: enbKey = kdf e n b ( kasme ms ) in 4 l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) in 5 l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) in 6 l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) in 7 in (pubChannel , (=ASSMC, enableEnc as ms : bool , =f i n t e g a s 8 (bool2bitstring(enableEnc as ms ) , k a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) 9 event endMS ENB( imsi ms , kenb ms , cap ms ) ; 10 out (pubChannel , (ASSMComplete, as smcomplete msg , 11 f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 9 ] ∗) 12 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , 13 =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 10] ∗) 104

MS BS MME-HN

LTE I LTE 1.CAP 2. IMSI

Generate RAND ,MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

3. RAND, AUTN

XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND)

UMTS CK = f3(Ki, RAND), IK = f4(Ki, RAND) event begSN(imsi_ms, ck_ms, ik_ms)

III 4. RES

Verify RES = XRES event endSN(imsi_sn, ck_sn, ik_sn)

KASME = KDF’(CK, IK) KASME = KDF’(CK, IK)

KNASenc = KDF (KASME)KNASint = KDF(KASME) Decide enableEnc? NAS-MAC = EIA((enableEnc, CAP), KNASint)

event begMS(imsi_sn, kasme_sn, cap_sn)

LTE IV LTE 5. enableEnc, CAP, NAS-MAC

Verify CAP KNASenc = KDF (KASME), KNASint = KDF(KASME) XNAS-MAC = EIA((CAP, enableEnc), KNASint) Verify XNAS-MAC = NAS-MAC event endMS(imsi_ms, kasme_ms, cap_ms)

6. NAS Security Mode Complete ifenableEnbciphered , integrity protected otherwise integrity protected

KeNB = KDF(KASME)

7. CAP, KeNB

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) Decide enableENC, AS-MAC = EIA(enableEnc, KRRCint)

LTE V LTE Start integrity protection

event begMS_ENB(imsi_sn, kenb_sn, cap_sn)

8. enableEnc, AS-MAC

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) XAS-MAC = EIA(enableEnc, KRRCint) Verify XAS-MAC = AS-MAC

event endMS_ENB(imsi_ms, kenb_ms, cap_ms)

9. AS SMC Complete Integrity protected Verify integrity of message 9

10. payload, if no encryption {payload}_KRRCenc, otherwise Decrypt message ifenableEnc_ms is true

Figure 9.4: AKA scenario S7, version with LTE IV, annotated in accord with our model

14 out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; 15 out (pubChannel, senc i n t as(secret , kasint m s ) ) ; 105

16 out (pubChannel , senc up(secret , kupenc ms ) ) ; 17 i f enableEnc as ms = t r u e then 18 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) 19 in 0 . 20 21 (∗ process respresenting MS ∗) 22 l e t processMS = 23 new imsi ms : i d e n t ; 24 new k i : key ; 25 insert keys(imsi ms , k i ) ; 26 l e t cap ms : bool = encCapability() in 27 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 28 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 29 in ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) ) ) ; 30 (∗ [ Msg 3 ] ∗) 31 l e t res ms: resp = f2(ki, rand ms ) in 32 l e t ck ms: cipherKey = f3(ki, rand ms ) in 33 l e t ik ms: integKey = f4(ki, rand ms ) in 34 event begSN ( imsi ms , ck ms , ik ms ) ; 35 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 4 ] ∗) 36 l e t kasme ms:asmeKey = kdf asme ( ck ms , ik ms ) in 37 l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) in 38 l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) in 39 in (pubChannel , (=NASSMC, enableEnc nas ms : bool , =cap ms , 40 =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; 41 (∗ [ Msg 5 ] ∗) 42 event endMS( imsi ms , kasme ms , cap ms ) ; 43 out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; 44 out (pubChannel, senc i n t nas(secret , knasint m s ) ) ; 45 i f enableEnc nas ms = f a l s e then 46 out (pubChannel , (NASSMComplete, nas smcomplete msg , 47 f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 6 ] ∗) 48 pMSAS( kasme ms , imsi ms , cap ms ) 49 e l s e 50 out (pubChannel , (NASSMComplete, sencrypt n a s ( nas smcomplete msg , 51 knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , 52 knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 6 ] ∗) 53 pMSAS( kasme ms , imsi ms , cap ms ) . 54 55 (∗ process representing e−nodeB ∗) 56 l e t pENB( kasme enb: asmeKey, imsi enb: ident, cap enb : bool ) = 57 l e t kenb enb: enbKey = kdf e n b ( kasme enb ) in 58 l e t kasenc enb: asEncKey = kdf a s e n c ( kenb enb ) in 59 l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) in 60 l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) in 61 event begMS ENB( i m s i e n b , kenb enb , cap enb ) ; 62 out (pubChannel , (ASSMC, cap enb , f i n t e g as(bool2bitstring(cap enb ) , 63 k a s i n t e n b ) ) ) ; (∗ [ Msg 8 ] ∗) 64 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 65 =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 9 ] ∗) 66 i f cap enb = f a l s e then 106

67 event disableEnc; 68 out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) 69 (∗ [ Msg 10] ∗) 70 e l s e 71 out (pubChannel , (MSG, sencrypt as(payload , kasenc enb ) , 72 f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . 73 (∗ [ Msg 10] ∗) 74 75 (∗ process representing MME and HN ∗) 76 l e t processMMEHN = 77 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 78 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 79 new r a n d s n : nonce ; 80 get keys (= i m s i s n , k i s n ) in 81 l e t mac sn: mac = f1(ki s n , r a n d s n ) in 82 l e t x r e s sn: resp = f2(ki s n , r a n d s n ) in 83 l e t c k sn: cipherKey = f3(ki s n , r a n d s n ) in 84 l e t i k sn: integKey = f4(ki s n , r a n d s n ) in 85 out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 3 ] ∗) 86 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 4 ] ∗) 87 event endSN ( i m s i s n , ck sn , i k s n ) ; 88 l e t kasme sn: asmeKey = kdf asme ( ck sn , i k s n ) in 89 l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) in 90 l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) in 91 event begMS( i m s i s n , kasme sn , cap sn ) ; 92 out (pubChannel , (NASSMC, cap sn , cap sn , 93 f i n t e g n a s ( ( cap sn , cap sn), knasint s n ) ) ) ; (∗ [ Msg 5 ] ∗) 94 in (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , 95 =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 6 ] ∗) 96 i f cap sn = t r u e then 97 i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then 98 pENB( kasme sn , i m s i s n , cap sn ) 99 e l s e 0 100 e l s e 101 i f msg nas = nas smcomplete msg then 102 pENB( kasme sn , i m s i s n , cap sn ) 103 e l s e 0 . When modeling the MME and the HN as separated processes as in other models, ProVerif finds a false attack which due to the approximation of the private channel (see Section 2.4.3) between the MME and the HN. Because our assumption is that the communication between the MME and the HN is secure, we omit the messages transmitted between them and model the MME and the HN in one process. By specifying the behavior of the MME and the HN in one process, the false attack is removed. In lines 79–84, the authentication vector is generated. As in the model of the S7 without LTE IV, the master keys KASME is derived from the UMTS cipher and integrity key in lines 36 and 88 by the MS and the MME respectively. The NAS SMC message is sent by the MME in lines 92–93, and is received by the MS in lines 39–40. Subsequently, the NAS SMComplete message is sent by the MS in lines 46–47 or 107

Table 9.4: Analysis result of S7 models Conditional Auth. of Auth. of Auth. of Key Payload Payload the MS to the MME the BS to Secrecy Secrecy Secrecy the MME to the MS the MS S7 w/o Proved Proved Proved N/A Failed Failed LTE IV S7 w/ Proved Proved Proved Proved Proved Failed LTE IV

lines 50–52 depending on whether the encryption is enabled. This message is received by the MME in line 94–95.

9.2.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. In both models, the secrecy and authentication properties are specified as:

• Key Secrecy (secrecy of Ki, CK, IK, NAS and AS keys) not attacker (new k i ) . query attacker ( s e c r e t ) . • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Mutual Authentication between the MS and the SN 1 query x1: ident, x2: cipherKey, x3: integKey; 2 event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 3 query x1: ident, x2: enbKey, x3: bool ; 4 event (endMS ENB(x1, x2, x3)) event (begMS ENB(x1, x2, x3)). • Payload Secrecy query attacker ( payload ) .

In the model of S7 with LTE IV, the authentication of the MME to the MS is specified as: query x1: ident, x2: asmeKey, x3: bool ; event (endMS(x1, x2, x3)) event (begMS(x1, x2, x3)). Table 9.4 shows the analysis result of the above properties. Plain secrecy of the message payload does not hold because the attacker can always learn the payload if the MS is not capable of encryption. For the version without LTE IV, ProVerif finds an attack that violates the property of the authentication of the SN to the MS which is specified in lines 3–4. In the attack, the attacker intercepts the capability message sent by the MS and replaces the capabilities with different ones. The event endMS is executed after the MS receives the SMC message. Because the SMC message does not contain the received MS’s capabilities, the MS has no way to confirm whether the 108

SN receives the correct capabilities. ProVerif detects the violation because, although there was a begMS event, it has a different value for capabilities. For the version with LTE IV, the property is proved.

9.3 Scenario S8: LTE I’ k UMTS II–III k LTE IV–V, conv(CK IK nonces → KASME , MME)

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings.

9.3.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM, UMTS, and LTE diagrams. This scenario is characterized by the same cases as in S7. The difference to S7 is that this scenario is triggered by the TAU request and the NONCEMS in the TAU request is used in LTE IV. The retrieving and generating of the authentica- tion vector and the challenge-response procedure are the same as in S7. In LTE IV, the MME generates a nonce NONCEMME and uses it with the CK , IK , and NONCEMS as input parameters to derive the KASME . The MME sends the integrity protected SMC message containing the nonce NONCEMS received from the MS and the nonce NONCEMME . Upon receiving the SMC message, the MS checks whether the NONCEMS and the capabilities match what it originally sent in LTE I’. If the check successes, the MS uses the same key derivation function as in the MME to derive the KASME and sends out the SMC complete message. Subsequently, LTE V is executed. Fig. 9.5 shows this AKA scenario.

9.3.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. The complete model is in Section 11 and in our repository as dissertation/models/S8_LTE_I’_UMTS_II-III_LTE_IV-V.pv. Fig. 9.6 elaborates the scenario in Fig. 9.5 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. Most of the code in this model is inherited from the LTE model and the UMTS model. The events used in the correspondence assertions to specify the authentication properties are declared as: event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). event begMS ENB(ident , enbKey, bool ). 109

4G ME with USIM 4G BS MME 3G HN

1. CAP

LTE LTE 2. GUTI

3. NONCEMS

I

’ 4. Identity Request 5. IMSI

UMTS II

UMTS III

KASME = KDF(CK, IK, NONCEMS, NONCEMME) KNASenc = KDF (KASME, NAS-enc-alg, Alg-ID) KNASint = KDF(KASME, NAS-int-alg, Alg-ID) Decide NAS-Algs, NAS-MAC = EIA(KNASint, (CAP, Algs))

LTE LTE 10. NAS-Algs, CAP, NONCEMS, NONCEMME, NAS-MAC

Verify CAP, NONCEMS

IV KASME = KDF(CK, IK, NONCEMS, NONCEMME)

KNASenc = KDF (KASME, NAS-enc-alg, Alg-ID) KNASint = KDF(KASME, NAS-int-alg, Alg-ID) XNAS-MAC = EIA(KNASint, (CAP, Algs)) Verify XNAS-MAC = NAS-MAC

11. NAS SMComplete ciphered , integrity protected Verify integrity of message 11

LTE V

Figure 9.5: AKA scenario S8 event endMS ENB(ident , enbKey, bool ). The process representing HN is the same as the one in the UMTS model (see Sec- tion 4.2.2). The processes representing the MS, the BS, and the MME are defined as follows. The comments refer to message numbers in Figure 9.6.

1 (∗ AS SMC procedure in process MS ∗) 2 l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = 3 l e t kenb ms: enbKey = kdf e n b ( kasme ms ) in 4 l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) in 5 l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) in 6 l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) in 7 in (pubChannel , (=ASSMC, enableEnc as ms : bool , =f i n t e g a s 8 (bool2bitstring(enableEnc as ms ) , k a s i n t m s ) ) ) ; (∗ [ Msg 11] ∗) 9 out (pubChannel , (ASSMComplete, as smcomplete msg , 10 f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 12] ∗) 11 event endMS ENB( imsi ms , kenb ms , cap ms ) ; 12 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , 13 =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 13] ∗) 14 out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; 15 out (pubChannel, senc i n t as(secret , kasint m s ) ) ; 16 out (pubChannel , senc up(secret , kupenc ms ) ) ; 17 i f enableEnc as ms = t r u e then 18 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) in 0 . 110

MS BS MME 4G HN

LTE I LTE 1.CAP 2. IMSI

’ 3. NONCEMS 4. IMSI

UMTS Generate RAND ,MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND)

II IK = f4(Ki, RAND), AUTN=MAC

5. IMSI, RAND, AUTN, XRES, CK, IK

6. RAND, AUTN

XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND)

UMTS CK = f3(Ki, RAND), IK = f4(Ki, RAND) event begSN(imsi_ms, ck_ms, ik_ms)

III 7. RES

Verify RES = XRES event endSN(imsi_sn, ck_sn, ik_sn)

KASME = KDF(CK, IK, NONCEMS, NONCEMME) KNASenc = KDF (KASME), KNASint = KDF(KASME) Decide enableEnc?, NAS-MAC = EIA((enableEnc, CAP, NONCEMS, NONCEMME), KNASint)

event begMS(imsi_sn, kasme_sn, cap_sn)

LTE IV LTE

8. enableEnc, CAP, NONCEMS, NONCEMME, NAS-MAC

Verify CAP, NONCEMS KASME = KDF(CK, IK, NONCEMS, NONCEMME) KNASenc = KDF (KASME), KNASint = KDF(KASME) XNAS-MAC = EIA((enableEnc, CAP, NONCEMS, NONCEMME), KNASint) Verify XNAS-MAC = NAS-MAC

event endMS(imsi_ms, kasme_ms, cap_ms)

9. NAS Security Mode Complete if enableEnc, ciphered , integrity protected otherwise integrity protected

verify integrity of the message 9

KeNB = KDF(KASME)

10. CAP, KeNB

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) Decide enableEnc?, AS-MAC = EIA(enableEnc, KRRCint)

LTE V LTE Start integrity protection

event begMS_ENB(imsi_sn, kenb_sn, cap_sn)

11. enableEnc, AS-MAC

KeNB = KDF (KASME), KRRCenc = KDF (KeNB) KRRCint = KDF(KeNB), KUPenc = KDF (KeNB) XAS-MAC = EIA(enableEnc, KRRCint) Verify XAS-MAC = AS-MAC

event endMS_ENB(imsi_ms, kenb_ms, cap_ms)

12. AS SMC Complete Integrity protected

13. payload, if no encryption {payload}_KRRCenc, otherwise Decrypt message ifenableEnc_ms is true

Figure 9.6: AKA scenario S8 annotated in accord with our model

19 111

20 (∗ process respresenting MS ∗) 21 l e t processMS = 22 new imsi ms : i d e n t ; 23 new k i : key ; 24 insert keys(imsi ms , k i ) ; 25 l e t cap ms : bool = encCapability() in 26 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 27 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 28 new nonce ms : nonce ; 29 out (pubChannel , (NONCE TAU, nonce ms ) ) ; (∗ [ Msg 3 ] ∗) 30 in ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) ) ) ; 31 (∗ [ Msg 6 ] ∗) 32 l e t res ms: resp = f2(ki, rand ms ) in 33 l e t ck ms: cipherKey = f3(ki, rand ms ) in 34 l e t ik ms: integKey = f4(ki, rand ms ) in 35 event begSN ( imsi ms , ck ms , ik ms ) ; 36 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 7 ] ∗) 37 in (pubChannel , (=NASSMC, enableEnc nas ms : bool , =cap ms , 38 =nonce ms , nonce mme ms: nonce, nas mac: msgMac)); (∗ [ Msg 8 ] ∗) 39 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , nonce ms , 40 nonce mme ms ) in 41 l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) in 42 l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) in 43 i f ( nas mac = f i n t e g nas ((enableEnc nas ms , cap ms , nonce ms , 44 nonce mme ms),knasint m s ) ) then 45 event endMS( imsi ms , ck ms , ik ms , cap ms ) ; 46 out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; 47 out (pubChannel, senc i n t nas(secret , knasint m s ) ) ; 48 i f enableEnc nas ms = f a l s e then 49 out (pubChannel , (NASSMComplete, nas smcomplete msg , 50 f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) 51 pMSAS( kasme ms , imsi ms , cap ms ) 52 e l s e 53 out (pubChannel , (NASSMComplete, sencrypt n a s 54 ( nas smcomplete msg, knasenc ms ) , f i n t e g nas(sencrypt n a s 55 ( nas smcomplete msg, knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) 56 pMSAS( kasme ms , imsi ms , cap ms ) . 57 58 (∗ process representing e−nodeB ∗) 59 l e t processENB = 60 in (sChannelSnBts , (kasme enb: asmeKey, imsi e n b : i d e n t , 61 cap enb : bool )); 62 l e t kenb enb: enbKey = kdf e n b ( kasme enb ) in 63 l e t kasenc enb: asEncKey = kdf a s e n c ( kenb enb ) in 64 l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) in 65 l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) in 66 event begMS ENB( i m s i e n b , kenb enb , cap enb ) ; 67 out (pubChannel , (ASSMC, cap enb , 68 f i n t e g as(bool2bitstring(cap enb), kasint e n b ) ) ) ; (∗ [ Msg 11] ∗) 69 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 70 =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 12] ∗) 112

71 i f cap enb = f a l s e then 72 event disableEnc; 73 out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) 74 (∗ [ Msg 13] ∗) 75 e l s e 76 out (pubChannel , (MSG, sencrypt as(payload , kasenc enb ) , 77 f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . 78 (∗ [ Msg 13] ∗) 79 80 (∗ process representing MME ∗) 81 l e t processMME = 82 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 83 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 84 in (pubChannel , (=NONCE TAU, nonce ms sn:nonce)); (∗ [ Msg 3 ] ∗) 85 out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 4 ] ∗) 86 in (secureChannel , (=AV, =imsi s n , r a n d sn: nonce, xres s n : resp , 87 c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 5 ] ∗) 88 out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 6 ] ∗) 89 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 7 ] ∗) 90 event endSN ( i m s i s n , ck sn , i k s n ) ; 91 new nonce mme : nonce ; 92 l e t kasme sn: asmeKey = kdf asme ( ck sn , i k s n , nonce ms sn , 93 nonce mme ) in 94 l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) in 95 l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) in 96 event begMS( i m s i s n , ck sn , i k s n , cap sn ) ; 97 out (pubChannel , (NASSMC, cap sn , cap sn , nonce ms sn , nonce mme , 98 f i n t e g n a s ( ( cap sn , cap sn , nonce ms sn , nonce mme ) , 99 k n a s i n t s n ) ) ) ; (∗ [ Msg 8 ] ∗) 100 in (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , 101 =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 9 ] ∗) 102 i f cap sn = t r u e then 103 i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then 104 out (sChannelSnBts , (kasme sn , i m s i s n , cap sn ) ) 105 e l s e 0 106 e l s e 107 i f cap sn = f a l s e then 108 i f msg nas = nas smcomplete msg then 109 out (sChannelSnBts , (kasme sn , i m s i s n , cap sn ) ) 110 e l s e 0 111 e l s e 0 . In lines 28–29, the MS generates the nonce in the TAU request and sends it to the MME. In lines 37–38, the MS receives the NAS SMC message which contains the capabilities and the nonce received by the MME, as well as the nonce generated by the MME. The MS verifies the capabilities and the nonce received from the MME are the same as it sent out earlier. In lines 39-40, the MS derives the master key from the UMTS cipher and integKey keys, and the nonces generated by the MS and MME respectively. Based on the master key, the MS derives the NAS and AS keys and finishes the NAS and AS SMC procedure as in LTE model (see Section 5.2.2). 113

Table 9.5: Analysis result of S8 model Conditional Auth. of Auth. of Auth. of Key Payload Payload the MS to the MME the BS to Secrecy Secrecy Secrecy the MME to the MS the MS Proved Proved Proved Proved Proved Failed

The MME receives the nonce in the TAU request in line 84 and generates a nonce in line 91. Using these two nonces together with the UMTS keys, the MME derives the master key in lines 92–93. In lines 97–98, the MME sends out the NAS SMC message, which contains the received capabilities and nonce from the MS and the nonce generated by itself. The subsequent NAS and AS SMC procedures are specified the same as in the LTE model (see Section 5.2.2).

9.3.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. The secrecy and authentication properties are specified as:

• Key Secrecy (secrecy of Ki, NAS and AS keys) not attacker (new k i ) . query attacker ( s e c r e t ) . • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). • Authentication of the MS to the MME query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). • Authentication of the MME to the MS query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). • Authentication of the BS to the MS query x1: ident, x2: enbKey, x3: bool ; event (endMS ENB(x1, x2, x3)) event (begMS ENB(x1, x2, x3)). • Payload Secrecy query attacker ( payload ) .

Table 9.5 shows the analysis result of the above properties. ProVerif proves all the properties except the payload secrecy, since the attacker can always learn the payload if the MS is not capable of encryption. 114

9.4 Scenario S9: GSM I k LTE II–III k [optionally, LTE IV] k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings.

9.4.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM, UMTS, and LTE diagrams. This scenario is characterized by a mixed SN including a 2G BS and a 4G MME as well as an MS that is subscribed to a 4G HN where either the identity module is a 4G USIM or it is a 4G ME, i.e., the MS supports 4G AKA. A typical case of this AKA scenario is that a 4G ME equipped with a 4G USIM whose HN is the 4G HN roams into a mixed network with 2G BS and MME. Four of the allowable/uncertain cases fall into this category. Because the 2G BS covers routing areas, the initial message can be the attach request or the RAU request. So the transmitting of the identity and the capabilities is as in GSM I (Fig. 3.2). When the MME requests the authentication vector from the HN by sending the IMSI and the network type, because the network type is GERAN (because of the 2G BS), the 4G HN generates and delivers the 4G authentication vector with the UMTS cipher key CK and integrity key IK . Because the NAS signaling is transparent to the BS, the LTE challenge response procedure LTE III (Fig. 5.2) is executed between the MS and the MME. In this interoperation scenario, we consider the two variations with and without LTE IV (Fig. 5.2). The first variation sticks to the LTE AKA as long as possible (i.e., until executing LTE IV before setting up the cipher between the MS and the BS). The other one goes to set the cipher between MS and the BS as soon as finishing the challenge-response procedure (without executing LTE IV). Later we show that the AKA without LTE IV is prone to a false base station attack and the AKA with LTE IV is prone to an attack against the CMC message between the 2G BS and the MS. Because the 2G BS requires the GSM session key Kc, the MME derives the encryption key Kc from the UMTS cipher key CK and integrity key IK . Since only the 2G cipher mode setting is supported by the 2G BS, the 2G cipher mode setting procedure GSM IV (Fig. 3.2) is executed between the 2G BS and the MS—which also includes the MME sending the GSM session key to the 2G BS. Fig. 9.7 shows this AKA scenario without LTE IV. Fig. 9.8 shows this AKA scenario with LTE IV.

9.4.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model. 115

4G ME with USIM 2G BS MME 4G HN GSM I

LTE II

LTE III

KC = KDF(CK, IK) KC = KDF(CK, IK)

GSM IV

Figure 9.7: AKA scenario S9 without LTE IV

4G ME with USIM 2G BS MME 4G HN GSM I

LTE II

LTE III

LTE IV

KC = KDF(CK, IK) KC = KDF(CK, IK)

GSM IV

Figure 9.8: AKA scenario S9 with LTE IV

Scenario S9 without LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S9_GSM_I_LTE_II-III_GSM_IV.pv. Fig. 9.9 elaborates the scenario in Fig. 9.7 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. The process representing the MS , the SN, and the HN are defined as follows. The comments refer to message numbers in Figure 9.9.

1 (∗ process respresenting MS ∗) 2 l e t processMS = 3 new imsi ms : i d e n t ; 4 new k i : key ; 5 insert keys(imsi ms , k i ) ; 6 l e t cap ms : bool = encCapability() in 7 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 8 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 9 in ( pubChannel , (=CHALLENGE, rand ms : nonce , 10 =f1(ki , rand ms ) , snid ms: ident)); (∗ [ Msg 5 ] ∗) 11 l e t res ms: resp = f2(ki, rand ms ) in 12 l e t ck ms: cipherKey = f3(ki, rand ms ) in 13 l e t ik ms: integKey = f4(ki, rand ms ) in 116

4G MS 2G BS MME 4G HN GSM 1.CAP

2. IMSI

I

3. IMSI, SNid, Network Type

LTE IILTE Generate RAND , MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

KASME= KDF(CK, IK, SNid) 4. IMSI, SNid, CK, IK RAND, AUTN, XRES, KASME 5. RAND, AUTN, SNid XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND) LTE IIILTE CK = f3(Ki, RAND), IK = f4(Ki, RAND) KASME = KDF(CK, IK, SNid,)

event begSN(imsi_ms, ck_ms, ik_ms) 6. RES Verify RES = XRES event endSN(imsi_sn, ck_sn, ik_sn)

KC = c3(CK, IK) KC = c3(CK, IK)

7. CAP, KC

Decide enableEnc?

GSM IV GSM event begMS_AS(imsi_sn, kc_sn, cap_sn)

8. enableEnc

event endMS_AS(imsi_ms, kc_ms, cap_ms)

9. CMComplete

10. payload, if no encryption {payload}_KC, otherwise Decrypt message if enableEnc_ms is true

Figure 9.9: AKA scenario S9, version without LTE IV, annotated in accord with our model

14 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , snid ms ) in 15 event begSN ( imsi ms , ck ms , ik ms ) ; 16 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 17 l e t kc ms:gsmKey = c3(ck ms , ik ms ) in 18 in (pubChannel , (=ASSMC, enableEnc as ms : bool )); (∗ [ Msg 8 ] ∗) 19 event endMS AS ( imsi ms , kc ms , cap ms ) ; 20 out (pubChannel , CMComplete); (∗ [ Msg 9 ] ∗) 21 in (pubChannel , (=MSG, datamsg: b i t s t r i n g )); (∗ [ Msg 10] ∗) 22 out (pubChannel , sencrypt as(secret , kc ms ) ) ; 23 i f enableEnc as ms = t r u e then 24 l e t msgcontent: b i t s t r i n g = 25 s d e c r y p t as(datamsg, kc ms ) in 0 . 117

26 27 (∗ process representing SN ∗) 28 l e t processSN = 29 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 30 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 31 new s n i d s n : i d e n t ; 32 out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) 33 in (secureChannel , (=AV, =imsi s n , s n i d h n s n : i d e n t , 34 r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, 35 c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) 36 out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; 37 (∗ [ Msg 5 ] ∗) 38 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) 39 event endSN ( i m s i s n , ck sn , i k s n ) ; 40 l e t k c sn: gsmKey = c3(ck sn , i k s n ) in 41 event begMS AS ( i m s i s n , kc sn , cap sn ) ; 42 out (pubChannel , (ASSMC, cap sn ) ) ; (∗ [ Msg 8 ] ∗) 43 in (pubChannel , =CMComplete); (∗ [ Msg 9 ] ∗) 44 i f cap sn = f a l s e then 45 event disableEnc; 46 out (pubChannel , (MSG, payload)) (∗ [ Msg 10] ∗) 47 e l s e 48 out (pubChannel , (MSG, sencrypt as(payload, kc s n ) ) ) . 49 (∗ [ Msg 10] ∗) 50 51 (∗ process representing HN ∗) 52 l e t processHN = 53 in (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); 54 (∗ [ Msg 3 ] ∗) 55 new rand hn : nonce ; 56 get keys (= imsi hn , k i h n ) in 57 l e t mac hn: mac = f1(ki hn , rand hn ) in 58 l e t x r e s hn: resp = f2(ki hn , rand hn ) in 59 l e t ck hn: cipherKey = f3(ki hn , rand hn ) in 60 l e t i k hn: integKey = f4(ki hn , rand hn ) in 61 l e t kasme hn: asmeKey = kdf asme ( ck hn , ik hn , s n i d h n ) in 62 out (secureChannel , (AV, imsi hn , snid hn , rand hn , x r e s h n , 63 mac hn , kasme hn , ck hn , i k h n ) ) . (∗ [ Msg 4 ] ∗) In lines 55–63, the HN generates the LTE authentication vector and sends it out with the UMTS cipher and integrity keys. Because the BS is GSM BS, the MS and the SN derive the GSM session key in lines 17 and 40 respectively. Same as in the GSM model (see Section 3.2.2), the CMC procedure is executed by the MS (lines 18 and 20) and the SN (lines 42–43).

Scenario S9 with LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S9_GSM_I_LTE_II-IV_GSM_IV.pv. 118

Fig. 9.10 elaborates the scenario in Fig. 9.8 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. The HN process is the same as the one in the version without LTE IV. The process representing the MS , the BS, and the MME are defined as follows. The comments refer to message numbers in Figure 9.10.

1 (∗ AS SMC procedure in process MS ∗) 2 l e t pMSAS( kc ms:gsmKey, imsi ms: ident, cap ms : bool ) = 3 in (pubChannel , (=ASSMC, enableEnc as ms : bool )); (∗ [ Msg 10] ∗) 4 event endMS AS ( imsi ms , kc ms , cap ms ) ; 5 out (pubChannel , CMComplete); (∗ [ Msg 11] ∗) 6 in (pubChannel , (=MSG, datamsg: b i t s t r i n g )); 7 out (pubChannel , sencrypt as(secret , kc ms ) ) ; 8 i f enableEnc as ms = t r u e then 9 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, kc ms ) in 0 . 10 11 (∗ process respresenting MS ∗) 12 l e t processMS = 13 new imsi ms : i d e n t ; 14 new k i : key ; 15 insert keys(imsi ms , k i ) ; 16 l e t cap ms : bool = encCapability() in 17 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 18 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 19 in ( pubChannel , (=CHALLENGE, rand ms : nonce , 20 =f1(ki , rand ms ) , snid ms: ident)); (∗ [ Msg 5 ] ∗) 21 l e t res ms: resp = f2(ki, rand ms ) in 22 l e t ck ms: cipherKey = f3(ki, rand ms ) in 23 l e t ik ms: integKey = f4(ki, rand ms ) in 24 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , snid ms ) in 25 event begSN ( imsi ms , snid ms , kasme ms ) ; 26 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 27 l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) in 28 l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) in 29 in (pubChannel , (=NASSMC, enableEnc nas ms : bool , =cap ms , 30 =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; 31 (∗ [ Msg 7 ] ∗) 32 event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; 33 out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; 34 out (pubChannel, senc i n t nas(secret , knasint m s ) ) ; 35 l e t kc ms:gsmKey = c3(ck ms , ik ms ) in 36 i f enableEnc nas ms = f a l s e then 37 out (pubChannel , (NASSMComplete, nas smcomplete msg , 38 f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) 39 pMSAS( kc ms , imsi ms , cap ms ) 40 e l s e 41 out (pubChannel , (NASSMComplete, 42 s e n c r y p t n a s ( nas smcomplete msg, knasenc ms ) , 43 f i n t e g nas(sencrypt n a s ( nas smcomplete msg, knasenc ms ) , 44 k n a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) 45 pMSAS( kc ms , imsi ms , cap ms ) . 119

4G MS 2G BS MME 4G HN GSM 1.CAP

2. IMSI

I

3. IMSI, SNid, Network Type

LTE IILTE Generate RAND , MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

KASME= KDF(CK, IK, SNid) 4. IMSI, SNid, CK, IK RAND, AUTN, XRES, KASME 5. RAND, AUTN, SNid

LTE IIILTE XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND) CK = f3(Ki, RAND), IK = f4(Ki, RAND)

KASME = KDF(CK, IK, SNid,) 6. RES

Verify RES = XRES

KNASenc = KDF (KASME,), KNASint = KDF(KASME,) KNASenc = KDF (KASME) Decide enableEnc?, KNASint = KDF(KASME) NAS-MAC = EIA((enableEnc, CAP), KNASint)

event begMS(imsi_sn, snid_sn, kasme_sn, cap_sn) 7. enableEnc, CAP, NAS-MAC

LTE IVLTE

XNAS-MAC = EIA((enableEnc, CAP), KNASint) Verify XNAS-MAC = NAS-MAC

event endMS(imsi_ms, snid_ms, kasme_ms, cap_ms) event begSN(imsi_ms, snid_ms, kasme_ms) 8. NAS Security Mode Complete if enableEnb ciphered , integrity protected otherwise integrity protected verify integrity of message 8 event endSN(imsi_sn, snid_sn, kasme_sn)

KC = c3(CK, IK) KC = c3(CK, IK)

9. CAP, KC

GSM IV GSM Decide enableEnc?

event begMS_AS(imsi_sn, kc_sn, cap_sn)

10. enableEnc

event endMS_AS(imsi_ms, kc_ms, cap_ms) 11. CMComplete

12. payload, if no encryption {payload}_KC, otherwise Decrypt message if enableEnc_ms is true

Figure 9.10: AKA scenario S9, version with LTE IV, annotated in accord with our model

46 47 (∗ process representing e−nodeB ∗) 48 l e t processBS = 120

49 in (sChannelSnBts , (kc bs: gsmKey, imsi bs: ident, cap bs : bool )); 50 event begMS AS ( i m s i b s , kc bs , cap bs ) ; 51 out (pubChannel , (ASSMC, cap bs ) ) ; (∗ [ Msg 10] ∗) 52 in (pubChannel , =CMComplete); (∗ [ Msg 11] ∗) 53 i f cap bs = f a l s e then 54 event disableEnc; 55 out (pubChannel , (MSG, payload)) (∗ [ Msg 12] ∗) 56 e l s e 57 out (pubChannel , (MSG, sencrypt as(payload, kc b s ) ) ) . 58 (∗ [ Msg 12] ∗) 59 60 (∗ process representing MME ∗) 61 l e t processMME = 62 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 63 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 64 new s n i d s n : i d e n t ; 65 out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) 66 in (secureChannel , (=AV, imsi h n sn: ident, snid h n s n : i d e n t , 67 r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, 68 c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) 69 out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; 70 (∗ [ Msg 5 ] ∗) 71 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) 72 event begMS( i m s i h n s n , s n i d h n s n , kasme sn , cap sn ) ; 73 l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) in 74 l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) in 75 out (pubChannel , (NASSMC, cap sn , cap sn , 76 f i n t e g n a s ( ( cap sn , cap sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) 77 in (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , 78 =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) 79 l e t k c sn: gsmKey = c3(ck sn , i k s n ) in 80 i f cap sn = t r u e then 81 i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then 82 event endSN ( i m s i h n s n , s n i d h n s n , kasme sn ) ; 83 out (sChannelSnBts , (kc sn , i m s i h n s n , cap sn ) ) 84 e l s e 0 85 e l s e 86 i f cap sn = f a l s e then 87 i f msg nas = nas smcomplete msg then 88 event endSN ( i m s i h n s n , s n i d h n s n , kasme sn ) ; 89 out (sChannelSnBts , (kc sn , i m s i h n s n , cap sn ) ) 90 e l s e 0 91 e l s e 0 . Compared with the version without LTE IV, the difference is that the NAS SMC procedure is included in this model. The MME sends out the NAS SMC message in lines 75–76, and receives the NAS SMComplete message in lines 77–78. While the MS receives the NAS SMC message and verifies the capabilities in lines 29–30. The MS sends out the NAS SMComplete message in lines 37–39 or lines 41–44, depending on whether the encryption is enabled or not. 121

Table 9.6: Analysis result of S9 models Conditional Auth. of Auth. of Auth. of Key Payload Payload the MS to the MME the BS to Secrecy Secrecy Secrecy the MME to the MS the MS S9 w/o Proved Proved Proved N/A Failed Failed LTE IV S9 w/ Proved Proved Proved Proved Failed Failed LTE IV

9.4.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. In both models, the properties of key secrecy, payload secrecy, and conditional payload secrecy are specified in the same way:

• Key Secrecy (secrecy of Ki, Kc and NAS keys) not attacker (new k i ) . query attacker ( s e c r e t ) . • Payload Secrecy query attacker ( payload ) . • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). In the version without LTE IV, the authentication properties are specified as:

1 query x1: ident, x2: cipherKey, x3: integKey; 2 event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 3 query x1: ident, x2: gsmKey, x3: bool ; 4 event ( endMS AS(x1, x2, x3)) event ( begMS AS(x1, x2, x3)). In the version with LTE IV, the authentication properties are specified as:

1 query x1: ident, x2: ident, x3: asmeKey; 2 event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 3 query x1: ident, x2: ident, x3: asmeKey, x4: bool ; 4 event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). 5 query x1: ident, x2: gsmKey, x3: bool ; 6 event ( endMS AS(x1, x2, x3)) event ( begMS AS(x1, x2, x3)). Table 9.6 shows the analysis result of the above properties. In the version without LTE IV, ProVerif finds the false base station attack (similar to the one found in GSM model, see Section 3.3) when checking the authentication of the BS to the MS (lines 3–4). The attack is possible because neither is the CMC message integrity protected nor is the capabilities sent back by the GSM BS. In the version with LTE IV, An attack is found when checking the authenti- cation of the BS to the MS (lines 5–6). In the attack, the attacker modifies the CMC message (which is not integrity protected) to tell the MS to use no encryption. This attack will be detected by the BS once the MS sends messages to the BS. 122

4G ME with USIM 3G BS MME 4G HN

UMTS I I LTE II

LTE III

UMTS IV

Figure 9.11: AKA scenario S10 without LTE IV

9.5 Scenario S10: UMTS I k LTE II–III k [optionally, LTE IV] k UMTS IV, AV = 4G AV + CK + IK

In this section, we provide an overview of the authentication scenario and its security goals and present our model of the scenario, the specifications of security properties, and our findings.

9.5.1 Overview of the AKA Scenario This section describes the authentication scenario and informally specifies the security goals by introducing the blocks which are from the GSM, UMTS, and LTE diagrams. This scenario is characterized by a 4G HN, a mixed SN consisting of a 3G BS and a 4G MME, as well as an MS that is subscribed to a 4G HN where either the identity module is a 4G USIM or it is a 4G ME with a 3G USIM, i.e., the MS supports 4G AKA. A typical case of this scenario is that a 4G ME equipped with a 4G USIM whose HN is 4G HN roams into a mixed network with 3G BS and MME. Three of the allowable/uncertain cases fall into this category. The 3G BS covers routing areas, so the initial message can be the attach request or a RAU request. Thus, the transmitting of identity and capabilities is as in UMTS I (Fig. 4.2). In order to obtain an authentication vector, the MME sends the authentication data request with the IMSI and the network type to the 4G HN. Because the access network is UTRAN, the 4G HN generates and delivers the 4G authentication vector as well as the UMTS encryption key CK and integrity key IK . Subsequently, the LTE challenge response procedure LTE III (Fig. 5.2) is executed between the MS and the MME. As in scenarios S7 and S9, the LTE IV is optional. Later we show that the authentication properties hold in both variations. The 3G BS obtains the UMTS encryption key CK , the UMTS integrity key IK , as well as the capabilities as part of UMTS IV (Fig. 4.2)—which also includes the UMTS security mode set-up procedure between the 3G BS and the MS. Fig. 9.11 shows this AKA scenario without LTE IV. Fig. 9.12 shows this AKA scenario with LTE IV. 123

4G ME with USIM 3G BS MME 4G HN

UMTS I

LTE II

LTE III

LTE IV

UMTS IV

Figure 9.12: AKA scenario S10 with LTE IV

9.5.2 Modeling the AKA Scenario In this section, we discuss the model of this scenario along with the diagram annotated accord with our model.

Scenario S10 without LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S10_UMTS_I_LTE_II-III_UMTS_IV.pv. Fig. 9.13 elaborates the scenario in Fig. 9.11 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. Most of the code in this model is inherited from the LTE model and the UMTS model. The process representing HN is the same as the one in the S9 model (see Section 9.4.2). The processes representing the MS an the SN are defined as follows. The comments refer to message numbers in Figure 9.13.

1 (∗ process respresenting MS ∗) 2 l e t processMS = 3 new imsi ms : i d e n t ; 4 new k i : key ; 5 insert keys(imsi ms , k i ) ; 6 l e t cap ms : bool = encCapability() in 7 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 8 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 9 in ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) , 10 snid ms: ident)); (∗ [ Msg 5 ] ∗) 11 l e t res ms: resp = f2(ki, rand ms ) in 12 l e t ck ms: cipherKey = f3(ki, rand ms ) in 13 l e t ik ms: integKey = f4(ki, rand ms ) in 14 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , snid ms ) in 15 event begSN ( imsi ms , ck ms , ik ms ) ; 16 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 17 in (pubChannel , (=ASSMC, =cap ms, enableEnc as ms : bool , 18 f r e s h ms:nonce, =f9((cap ms, enableEnc as ms , f r e s h m s ) , 19 ik ms ) ) ) ; (∗ [ Msg 8 ] ∗) 124

4G MS 3G BS MME 4G HN

UMTS 1.CAP 2. IMSI

I

3. IMSI, SNid, Network Type

LTE IILTE Generate RAND , MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

KASME=KDF(CK, IK, SNid) 4. IMSI, SNid, CK, IK RAND, AUTN, XRES, KASME 5. RAND, AUTN, SNid LTE IIILTE XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND) CK = f3(Ki, RAND), IK = f4(Ki, RAND)

KASME = KDF(CK, IK, SNid)

event begSN(imsi_ms, ck_ms, ik_ms) 6. RES Verify RES = XRES event endSN(imsi_sn, ck_sn, ik_sn) 7. CAP, CK, IK

Decide enableEnc?, AS-MAC = f9((enableEnc, CAP), IK)

event begMS_AS(imsi_sn, ck_sn, ik_sn, cap_sn)

UMTS IV UMTS 8. enableEnc, CAP, AS-MAC XAS-MAC = f9((enableEnc, CAP), IK) Verify XAS-MAC = AS-MAC

event endMS(imsi_ms, ck_ms, ik_ms, cap_ms) 9. AS SMC Complete Integrity protected

10. payload, if no encryption {payload}_CK, otherwise Decrypt message if enableEnc_ms is true

Figure 9.13: AKA scenario S10, version without LTE IV, annotated in accord with our model

20 out (pubChannel , (ASSMComplete, as smcomplete msg , 21 f 9 ( as smcomplete msg , ik ms ) ) ) ; (∗ [ Msg 9 ] ∗) 22 event endMS( imsi ms , ck ms , ik ms , cap ms ) ; 23 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f9(datamsg, ik ms ) ) ) ; 24 (∗ [ Msg 10] ∗) 25 out (pubChannel , sencrypt as(secret , ck ms ) ) ; 26 out (pubChannel, senc i n t as(secret , ik ms ) ) ; 27 i f enableEnc as ms = t r u e then 28 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, ck ms ) in 0 . 29 30 (∗ process representing SN ∗) 31 l e t processSN = 32 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 125

33 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 34 new s n i d s n : i d e n t ; 35 out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) 36 in (secureChannel , (=AV, =imsi s n , =s n i d s n , r a n d s n : nonce , 37 x r e s sn: resp, mac sn: mac, kasme sn: asmeKey, 38 c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) 39 out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; 40 (∗ [ Msg 5 ] ∗) 41 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) 42 event endSN ( i m s i s n , ck sn , i k s n ) ; 43 new f r e s h s n : nonce ; 44 event begMS( i m s i s n , ck sn , i k s n , cap sn ) ; 45 out (pubChannel , (ASSMC, cap sn , cap sn , f r e s h s n , 46 f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 8 ] ∗) 47 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 48 =f 9 ( as smcomplete msg , i k s n ) ) ) ; (∗ [ Msg 9 ] ∗) 49 i f cap sn = f a l s e then 50 event disableEnc; 51 out (pubChannel, (MSG, payload , f9(payload , ik s n ) ) ) (∗ [ Msg 10] ∗) 52 e l s e 53 out (pubChannel , (MSG, sencrypt as(payload, ck s n ) , 54 f9(sencrypt as(payload, ck s n ) , i k s n ) ) ) . (∗ [ Msg 10] ∗) The SN receives the 4G authentication vector and the UMTS cipher and integrity keys in lines 36-38. The challenge response procedure is specified in lines 39–41 in the SN process and in lines 9-10 and 16 in the MS process. The UMTS security mode setup procedure is the same as in the UMTS model (see Section 4.2.2), which is specified in lines 45–46 in the SN process and in lines 17–21 in the MS process.

Scenario S10 with LTE IV The complete model of this scenario is in Section 11 and in our repository as dissertation/models/S10_UMTS_I_LTE_II-IV_UMTS_IV.pv. Fig. 9.14 elaborates the scenario in Fig. 9.12 with details of the ProVerif model and shows the locations of the events which are used to specify authentication and conditional payload secrecy. Most of the code is the same as in the version without LTE IV. The MS, the BS, and the MME processes are defined as follows. The comments refer to message numbers in Figure 9.14.

1 (∗ AS SMC procedure in process MS ∗) 2 l e t pMSAS( ck ms: cipherKey, ik ms: integKey, imsi ms : i d e n t , 3 cap ms : bool ) = 4 in (pubChannel , (=ASSMC, =cap ms, enableEnc as ms : bool , 5 =f 9 ( ( cap ms, enableEnc as ms ) , ik ms ) ) ) ; (∗ [ Msg 10] ∗) 6 out (pubChannel , (ASSMComplete, as smcomplete msg , 7 f 9 ( as smcomplete msg , ik ms ) ) ) ; (∗ [ Msg 11] ∗) 8 event endMS AS ( imsi ms , ck ms , ik ms , cap ms ) ; 9 in (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f9(datamsg, ik ms ) ) ) ; 10 (∗ [ Msg 12] ∗) 126

4G MS 3G BS MME 4G HN UMTS 1.CAP 2. IMSI

I 3. IMSI, SNid, Network Type

LTE IILTE Generate RAND , MAC = f1(Ki, RAND) XRES = f2(Ki, RAND), CK = f3(Ki, RAND) IK = f4(Ki, RAND), AUTN=MAC

KASME=KDF(CK, IK, SNid) 4. IMSI, SNid, CK, IK RAND, AUTN, XRES, KASME 5. RAND, AUTN, SNid LTE IIILTE XMAC = f1(Ki, RAND) MAC = XMAC, RES = f2(Ki, RAND) CK = f3(Ki, RAND), IK = f4(Ki, RAND)

KASME = KDF(CK, IK, SNid) 6. RES Verify RES = XRES

KNASenc = KDF (KASME,), KNASint = KDF(KASME,) Decide enableEnc?, NAS-MAC = EIA((enableEnc, CAP), KNASint) event begMS(imsi_sn, snid_sn, kasme_sn, cap_sn) 7. enableEnc, CAP, NAS-MAC

LTE IVLTE KNASenc = KDF (KASME), KNASint = KDF(KASME) XNAS-MAC = EIA((enableEnc, CAP), KNASint)

Verify XNAS-MAC = NAS-MAC event endMS(imsi_ms, snid_ms, kasme_ms, cap_ms) event begSN(imsi_ms, snid_ms, kasme_ms) 8. NAS Security Mode Complete ifenableEnb ciphered , integrity protected otherwise integrity protected Verify integrity of message 8 event endSN(imsi_sn, snid_sn, kasme_sn)

9. CAP, CK, IK

Decide enableEnc?, AS-MAC = f9((enableEnc, CAP), IK)

UMTS IV UMTS event begMS_AS(imsi_sn, ck_sn, ik_sn, cap_sn)

10. enableEnc, CAP, AS-MAC

XAS-MAC = f9((enableEnc, CAP), IK) Verify XAS-MAC = AS-MAC event endMS_AS(imsi_ms, ck_ms, ik_ms, cap_ms)

11. AS SMC Complete Integrity protected

12. payload, if no encryption {payload}_CK, otherwise

Decrypt message if enableEnc_ms is true

Figure 9.14: AKA scenario S10, version with LTE IV, annotated in accord with our model

11 out (pubChannel , sencrypt as(secret , ck ms ) ) ; 127

12 out (pubChannel, senc i n t as(secret , ik ms ) ) ; 13 i f enableEnc as ms = t r u e then 14 l e t msgcontent: b i t s t r i n g = s d e c r y p t as(datamsg, ck ms ) in 0 . 15 16 (∗ process respresenting MS ∗) 17 l e t processMS = 18 new imsi ms : i d e n t ; 19 new k i : key ; 20 insert keys(imsi ms , k i ) ; 21 l e t cap ms : bool = encCapability() in 22 out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) 23 out (pubChannel, (ID, imsi ms ) ) ; (∗ [ Msg 2 ] ∗) 24 in ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) , 25 snid ms: ident)); (∗ [ Msg 5 ] ∗) 26 l e t res ms: resp = f2(ki, rand ms ) in 27 l e t ck ms: cipherKey = f3(ki, rand ms ) in 28 l e t ik ms: integKey = f4(ki, rand ms ) in 29 l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , snid ms ) in 30 event begSN ( imsi ms , snid ms , kasme ms ) ; 31 out ( pubChannel , (RES , res ms ) ) ; (∗ [ Msg 6 ] ∗) 32 l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) in 33 l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) in 34 in (pubChannel , (=NASSMC, enableEnc nas ms : bool , =cap ms , 35 =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; 36 (∗ [ Msg 7 ] ∗) 37 event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; 38 out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; 39 out (pubChannel, senc i n t nas(secret , knasint m s ) ) ; 40 i f enableEnc nas ms = f a l s e then 41 out (pubChannel , (NASSMComplete, nas smcomplete msg , 42 f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) 43 pMSAS( ck ms , ik ms , imsi ms , cap ms ) 44 e l s e 45 out (pubChannel , (NASSMComplete, sencrypt n a s ( nas smcomplete msg , 46 knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , 47 knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) 48 pMSAS( ck ms , ik ms , imsi ms , cap ms ) . 49 50 (∗ process representing e−nodeB ∗) 51 l e t processBS = 52 in (sChannelSnBts , (ck bs: cipherKey, ik bs: integKey, 53 i m s i bs: ident, cap bs : bool )); 54 event begMS AS ( i m s i b s , ck bs , i k b s , cap bs ) ; 55 out (pubChannel , (ASSMC, cap bs , cap bs , f 9 ( ( cap bs , cap bs ) , 56 i k b s ) ) ) ; (∗ [ Msg 10] ∗) 57 in (pubChannel , (=ASSMComplete, =as smcomplete msg , 58 =f 9 ( as smcomplete msg , i k b s ) ) ) ; (∗ [ Msg 11] ∗) 59 i f cap bs = f a l s e then 60 event disableEnc; 61 out (pubChannel, (MSG, payload , f9(payload , ik b s ) ) ) (∗ [ Msg 12] ∗) 62 e l s e 128

63 out (pubChannel , (MSG, sencrypt as(payload, ck b s ) , 64 f9(sencrypt as(payload, ck b s ) , i k b s ) ) ) . (∗ [ Msg 12] ∗) 65 66 (∗ process representing MME ∗) 67 l e t processMME = 68 in (pubChannel , (=CAP, cap sn : bool )); (∗ [ Msg 1 ] ∗) 69 in (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) 70 new s n i d s n : i d e n t ; 71 out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) 72 in (secureChannel , (=AV, =imsi s n , s n i d h n s n : i d e n t , 73 r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, 74 c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) 75 out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; 76 (∗ [ Msg 5 ] ∗) 77 in (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) 78 event begMS( i m s i s n , s n i d h n s n , kasme sn , cap sn ) ; 79 l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) in 80 l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) in 81 out (pubChannel , (NASSMC, cap sn , cap sn , 82 f i n t e g n a s ( ( cap sn , cap sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) 83 in (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , 84 =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) 85 i f cap sn = t r u e then 86 i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then 87 event endSN ( i m s i s n , s n i d h n s n , kasme sn ) ; 88 out (sChannelSnBts , (ck sn , i k s n , i m s i s n , cap sn ) ) 89 e l s e 0 90 e l s e 91 i f cap sn = f a l s e then 92 i f msg nas = nas smcomplete msg then 93 event endSN ( i m s i s n , s n i d h n s n , kasme sn ) ; 94 out (sChannelSnBts , (ck sn , i k s n , i m s i s n , cap sn ) ) 95 e l s e 0 96 e l s e 0 . Compared with the version without LTE IV, the additional NAS SMC procedure is specified in lines 81–84 in the MME process and in lines 34–35 and either lines 41–42 or lines 45–47 depending on the encryption is enabled or not.

9.5.3 Security Property Specifications and Findings This section presents the specifications and analysis result of the secrecy and authen- tication properties. In both models, the properties of key secrecy, payload secrecy, and conditional payload secrecy are specified in the same way:

• Key Secrecy (secrecy of Ki, CK, IK, and NAS keys) not attacker (new k i ) . query attacker ( s e c r e t ) . • Payload Secrecy 129

Table 9.7: Analysis result of S10 models Conditional Auth. of Auth. of Auth. of Key Payload Payload the MS to the MME the BS to Secrecy Secrecy Secrecy the MME to the MS the MS S10 w/o Proved Proved Proved N/A Proved Failed LTE IV S10 w/ Proved Proved Proved Proved Proved Failed LTE IV

query attacker ( payload ) . • Conditional Payload Secrecy query attacker ( payload ) event (disableEnc). In the version without LTE IV, the authentication properties are specified as: query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). In the version with LTE IV, the authentication properties are specified as: query x1: ident, x2: ident, x3: asmeKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: ident, x3: asmeKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event ( endMS AS(x1, x2, x3, x4)) event ( begMS AS(x1, x2, x3, x4)). Table 9.7 shows the analysis result of the above properties. ProVerif proves all the properties except the payload secrecy, because the BS could choose not to enable encryption when communicating with the MS. 130

Chapter 10 Summary of Findings

This chapter summarizes the analysis results for secrecy and authentication properties of the 10 authentication scenarios that cover all the possible interoperation cases. This chapter also highlights the different types of authenticity achieved by the scenarios. At the end, we summarize the attacks on these scenarios.

10.1 Secrecy and Integrity Properties

In this section, we summarize the analysis results of the secrecy properties of all the scenarios. The conditional secrecy and key secrecy properties are proved in all scenarios. The attacker cannot get the session or long-term keys, and if encryption is chosen by the BS, then the attacker cannot get the message payload. Payload integrity is not provided by any of the standards.

10.2 Authentication Properties

In this section, we discuss the analysis result of the authentication properties of all the scenarios. In Chapter 6, we established the following terminology for the types of the authenticity. challenge-response Authentication is based on a random challenge and the re- sponse is used to prove that the responding party has the correct key. For example, the authentication of the MS to the SN in all the pure AKAs is challenge-response authentication. use-based proved knowledge Authentication is based on one party proving that it possesses the correct integrity key and by using it to generate the MAC. For example, the authentication of the BS to the MS in UMTS is use-based proved knowledge authentication. indirect use-based proved knowledge Authentication is indirect and based on the use-based proved knowledge. The reasoning is that two participants con- nected by a secure channel trust each other to follow the protocol, and the only way one can get a derived key is by obtaining it from the other. For example, the authentication of the MSC to the MS in UMTS is indirect use-based proved knowledge authentication. use-based proved knowledge with SNid This is like use-based proved knowl- edge authentication, but with the addition that the SNid is provided to the MS and the integrity key is derived not only from the long-term key but also 131

from the SNid. For example, the authentication of the MME to the MS in the LTE is use-based proved knowledge with SNid authentication.

As described in Chapter 6, each type of the authentication is achieved in a specific block of the pure AKAs. Because the interoperation scenarios are built on the blocks, the blocks determine which type of the authentication is achieved.

10.2.1 Authentication of the MS to the SN For the authentication of the MS to the SN, all the scenarios have the same type of the authentication, that is the challenge-response authentication of the MS to the SN. The MS proves that it knows the long-term key that the HN associates with the IMSI of the MS.

10.2.2 Authentication of the SN to the MS For the authentication of the SN to the MS, there are some variations. We consider the scenarios and summarize them in Table 10.1.

Scenario S1 (GSM I–IV) is the pure GSM. The authentication types of GSM are discussed in Chapter 6. GSM does not provide authentication of the SN to the MS.

Scenario S2 (UMTS I–IV) is the pure UMTS, which is also discussed in Chapter 6. UMTS provides the use-based proved knowledge authentication of the BS to the MS and the indirect use-based proved knowledge authentication of the MSC to the MS.

Scenario S3 (LTE I–V) is the pure LTE and provides the use-based proved knowl- edge with SNid authentication of both the BS and the MME to the MS.

Scenario S4 (GSM I k UMTS II’ k GSM III’–IV, conv(3G AV → 2G AV)) (Section 8.2) does not provide the authentication of the SN to the MS.

Scenario S5 (GSM I–III k UMTS IV, conv(Kc → CK IK , VLR/SGSN)) (Section 8.3) uses the UMTS SMC procedure (UMTS IV), so S5 provides the same authentication of the SN components to the MS as in UMTS.

Scenario S6 (UMTS I–III k GSM IV, conv(CK IK → Kc, VLR/SGSN)) (Section 8.4) uses the GSM CMC procedure (GSM IV), so S6 does not provide authentication of the SN to the MS as in GSM.

Scenario S7– (LTE I k UMTS II–III k LTE V, conv(CK IK → KASME , MME)) (Section 9.2) uses the LTE AS SMC procedure (LTE V). Because the KASME is derived by the MME without binding the SNid, the authentication of 132

the BS to the MS is the use-based proved knowledge authentication. Because the NAS SMC procedure is not used in this scenario, it provides the indirect use-based proved knowledge authentication of the MME to the MS as in UMTS. Scenario S7 (S7– with LTE IV) (Section 9.2) is similar to S7–, but uses both NAS SMC and AS SMC procedures. S7 provides the use-based proved knowledge authentication of both the BS and the MME to the MS.

Scenario S8 (LTE I’ k UMTS II–III k LTE IV–V, conv(CK IK nonces → KASME , MME)) (Section 9.3) In this scenario, the MS sends a nonce NONCEMS to the MME and the MME generates a nonce NONCEMME . The master key KASME is derived by the MME using the two nonces, CK , and IK . The knowledge of the MME to be checked by the MS is the integrity key which is derived from the KASME . To authenticate itself to the MS, the MME generates the MAC of the SMC message which contains the two nonces, the capabilities of the MS, and the decided algorithm. In addition to proving the knowledge of the integrity, the MME also replies the challenge of the MS (NONCEMS ) using the MAC as a response. Similarly, the BS proves the knowledge of the integrity key, which is derived from the KASME , and replies the challenge by sending the AS SMC message with the MAC that is generated using the integrity key. The integrity keys used by the MME and the BS bind the two nonces but not the SNid. So S8 provides both the use-based proved knowledge and the challenge-response authentication of the SN components to the MS. Scenario S9– (GSM I k LTE II–III k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK) (Section 9.4) only uses GSM SMC procedure (GSM IV), so S9– does not provide authentication of the SN to the MS as in GSM. Scenario S9 (S9– with LTE IV) (Section 9.4) uses the NAS SMC procedure (LTE IV) and the GSM SMC procedure (GSM IV), so S9 provides the use- based proved knowledge with SNid authentication of the MME to the MS and does not provide the authentication of the BS to the MS. Scenario S10– (UMTS I k LTE II–III k UMTS IV, AV = 4G AV + CK + IK) (Section 9.5) only uses UMTS SMC procedure (UMTS IV), so the type of the authentication of the SN components to the MS is the same as in UMTS. Scenario S10 (S10– with LTE IV) (Section 9.5) use both the LTE NAS SMC procedure and the UMTS SMC procedure, so S10 provides the use-based proved knowledge with SNid authentication of the MME to the MS and the use-based proved knowledge authentication of the BS to the MS.

Table 10.1 shows the types of authentication of the SN components to the MS achieved by all the scenarios. The keys in the parentheses are the proved knowledge. In S8, the 133

Table 10.1: Types of SN components authenticity achieved by the scenarios

Auth. of SN to MS Auth. of MSC/MME to MS Auth. of BS to MS S1 S2 indirect use-based proved knowledge (IK ) use-based proved knowledge (IK ) S3 use-based proved knowledge with SNid (KNASINT ) use-based proved knowledge with SNid (KASINT ) S4 S5 indirect use-based proved knowledge (IK ) use-based proved knowledge (IK ) S6 S7- indirect use-based proved knowledge (KASINT ) use-based proved knowledge (KASINT ) S7 use-based proved knowledge (KNASINT ) use-based proved knowledge (KASINT ) S8 use-based proved knowledge (KNASINT ), challenge- use-based proved knowledge (KASINT ), challenge- response (NONCEMS ) response (NONCEMS ) S9- S9 use-based proved knowledge with SNid (KNASINT ) S10- indirect use-based proved knowledge (IK ) use-based proved knowledge (IK ) S10 use-based proved knowledge with SNid (KNASINT ) use-based proved knowledge (IK )

NONCEMS is the challenge. Empty cells mean that the corresponding authentication is not provided by the scenario. The authentication properties are specified by the correspondence assertions using the identity(ies) and the session key(s). The correspondence assertions used to specify the authentication of the SN to the MS also include the capabilities as one parameter. This parameter is used for checking if the SN receives the correct capabilities. If not, there might be a false base station attack. Most of the authen- tication properties specified as correspondence assertions are proved. For all proved authentication properties, we list the parameters used in the correspondence asser- tions in Table 10.2. Because all the correspondence assertions contain session key(s) as parameters, and all the session keys are derived from the long term key Ki and the random number RAND, the Ki and the RAND are implied in all proved corre- spondence assertions. In some scenarios, the session key(s) are derived from materials (such as nonces, SN’s identity) in addition to the Ki and the RAND. The additional materials are also implied in these cases. We list the additional implied materials inside parentheses in the table. For the correspondence assertions which are violated by an attack scenario found by ProVerif, we list the attacks.

10.3 Attacks

In this section, we discuss the attacks listed in Table 10.2. In the models of scenario S1, S4, S6, and S9 without LTE IV, we find the known false base station attack [77] which has the same attack scenario as in the native GSM authentication. In this attack, the attacker intercepts the CAP message and modifies the capabilities of the MS as no-encryption. When the BS decides which algorithm to use, the BS has to choose not to enable encryption. Because the subsequent traffic 134

Table 10.2: Analysis results of authentication properties

Parameters inside parentheses are the implied ones in addition to RAND and Ki Auth. of SN to MS Auth. of MS to SN Auth. of MSC/MME to MS Auth. of BS to MS S1 IMSI , Kc false base station attack S2 IMSI , CK , IK IMSI , CK , IK , CAP S3 IMSI , SNid, KASME IMSI , SNid, KASME , CAP IMSI , Kenb , CAP (SNid) S4 IMSI , Kc false base station attack S5 IMSI , Kc IMSI , CK , IK , CAP S6 IMSI , CK , IK false base station attack S7– IMSI , CK , IK false base station attack S7 IMSI , CK , IK IMSI , KASME , CAP IMSI , Kenb , CAP IMSI , K , CAP IMSI , K , CAP S8 IMSI , CK , IK ASME enb (NONCEMS , NONCEMME ) (NONCEMS , NONCEMME ) S9– IMSI , CK , IK false base station attack S9 IMSI , SNid, KASME IMSI , SNid, KASME , CAP CMC attack S10– IMSI , CK , IK IMSI , CK , IK , CAP S10 IMSI , SNid, KASME IMSI , SNid, KASME , CAP IMSI , CK , IK , CAP

between the MS and the 2G BS is not encrypted nor integrity protected, the attacker can both eavesdrop and modify the messages. The attack found in scenario S7 without LTE IV is similar. The attacker intercepts and modifies the capabilities of MS to no-encryption to force the 4G BS to choose not to use encryption. Although integrity protection is mandatory for the signaling traffic of 4G BS, there is no integrity protection on the user plane traffic, so the attack can both eavesdrop and modify the data traffic. In the model of scenario S9 with LTE IV, we find an attack in which the attacker simply modifies the CMC message to tell the MS to use no encryption. This attack would be detected once the MS sends unencrypted messages to the BS. 135

Chapter 11 Conclusion and Future Work

This chapter provides the conclusion of this work and recommends which blocks to use in the scenarios. This chapter also suggests directions for the future work. In this work we study the AKA scenarios for GSM, UMTS, LTE, as well as the interoperation cases among them. To determine the AKA scenarios in each inter- operation case, we consider all combinations of the five relevant system components (the identity module, the ME, the BS, the MSC/MME, and the HN). We classify some cases as allowed or disallowed, based on information about component compat- ibility gleaned from the standards documents. Some cases are classified as uncertain, for lack of definite information in the standards. For each possible (allowed or un- certain) interoperation case, we identify and justify a particular AKA scenario built from elements (“blocks”) of the pure GSM, UMTS, and LTE AKAs. It turns out that 10 scenarios are needed to cover all the possible interoperation cases. Of these scenarios, 3 are the pure GSM, UMTS, and LTE; 3 involve just GSM and UMTS blocks; the remaining 4 involve LTE as well as GSM and UMTS blocks. In most cases, the AKA scenario is completely determined by the type and capabilities of the components involved. However, a few cases have multiple feasible versions of the scenarios which differ by whether block LTE IV is included or whether the nonce in TAU request is used. We model and analyze all the scenarios, using ProVerif, focusing on authenti- cation and secrecy properties. We find attacks in some scenarios and confirm the ab- sence of other attacks at the Dolev-Yao level of abstraction. The attacks are possible because either the MS cannot verify whether the SN receives the correct capabilities or the decision of the encryption setting is sent to the MS unprotected. For GSM authentication, we find the known false base station attack. For the scenarios of the interoperation cases, we find three kind of attacks. One is the false base station attack which is inherited from the GSM system on S4, S6, and the version of S9 without LTE IV. Another attack, on one version of scenario S7, is a similar false base station attack but with a 4G BS. The attack is prevented by including block LTE IV. In the third attack on the AKA of scenario S9 with LTE IV, the CMC message is modified. This attack will be detected by the BS once the MS sends a message to the BS. Aside from these attacks, the desired authentication and secrecy properties are proved for all other cases. In Chapter 10 we compare the authenticity achieved by the different scenarios. There are four types of authenticity: challenge-response, use-based proved knowledge, indirect use-based proved knowledge, and use-based proved knowledge with SNid. We summarize the types of authenticity achieved by all the authentication scenarios. Based on our analysis, we propose the following recommendations. 136

First, since we classified some cases as uncertain cases, we suggest the standard organization or operators clarify whether the uncertain cases are allowed or not. Second, this work shows that model checking provides an effective way to find attacks in, and show the security of, the mobile telephony AKAs. We recommend the protocol designers to provide analyzable formal models for future protocol speci- fications, in order to use use formal methods to check the security of AKAs, as well as other protocols, during design process. Third, in our analysis, we provide the message sequence diagrams of the AKAs and separate them into blocks. These blocks are used to build the authentication scenarios for the interoperation cases. Future generations of mobile technology might introduce much more interoperation cases, which might also be able to built from the blocks of the protocols of pure technologies. We suggest to include the message sequence diagrams with blocks in the specifications. Fourth, Ideally, the blocks could be written a procedure in ProVerif, so the model of a scenario could be composed automatically from the block procedures. We had to resort to cut-and-paste to combine blocks, because in some cases key conversion function need to be applied. We suggest that ProVerif’s language could be extended so that the models of blocks could be parameterized on the key conversions. Fifth, each of the blocks GSM III, UMTS III, and LTE III provides the challenge-response authentication of the MS to the SN. The blocks UMTS IV and LTE IV–V provide the authentication of the SN to the MS. However, because there is no protection for the messages in the block GSM IV, false base station attack can be performed against the authentication scenarios ending with GSM IV (but without LTE IV executed before GSM IV). The false base station attack is possible because the MS has no way to verify that whether the SN has received the correct capabilities of the MS or not. In LTE IV, the capabilities of the MS is sent back to the MS in the integrity protected message, so that the MS can confirm that the SN receives the correct capabilities. Therefore, executing LTE IV before GSM IV prevents the false base station attack. The interoperation cases involving future technologies might also need GSM IV (if a 2G BS is included in the interoperation cases), we suggest to include LTE IV before GSM IV to prevent the false base station attack. Sixth, because the use-based proved knowledge with SNid authentication achieves higher level of authenticity than use-based proved knowledge authentication or indi- rect use-based proved knowledge authentication, and the use-based proved knowledge with SNid authentication is achieved by the scenarios with LTE II–IV, we recommend the AKAs should support and use the blocks LTE II–IV. Specifically, the session key should be generated in the HN with the identity of the SN and be used in latter protocol steps. Seventh, when modeling the LTE AKA, we choose to transmit the identity of the SN to the MS in the authentication challenge message (see Section 5.2), because the specification [8] does not specify how the MS obtains the identity of the SN. In fact, the SN broadcasts his identity in earlier stage when the MS selects the serving 137

network. We recommend to add the transmission of the SN’s identity to the MS in the protocol specification. For future work, we would like to analyze the handover in GSM, UMTS, and LTE, as well as across the technologies. Handover is the mechanisms supporting mo- bility in the context of ongoing phone call or data exchange. We also are interested in exploring the interworking between 4G and non-3GPP networks. In the current work, we assume the communication in the network side is secure. For future work, we can investigate what can happen if the communication between the BS and the MSC/MME can be controlled by the Dolev-Yao attacker. Furthermore, the commu- nication between the SN and the HN might also be treated that way. As stated in the recommendations, we suggest to use automated composed models from the models of the blocks to analyze interoperation cases involving future generations of protocols. We would like to experiment with this idea on the models of interoperation scenarios introduced in this work. 138

Appendix A

Complete code listings for all scenarios. All models are checked by ProVerif version 1.86pl4. S1. GSM I – IV

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . (∗ Permanent key ∗) type i d e n t . (∗ Identity of MS ∗) type nonce . (∗ Random number ∗) type msgHdr . (∗ Constant message header ∗) type r e s p . (∗ Response ∗) type s e s s K e y . (∗ S e s s i o n key ∗)

(∗ Constant message headers ∗) const CAP: msgHdr. (∗ Header of Msg 1 ∗) const ID : msgHdr . (∗ Header of Msg 2 ∗) const AV REQ: msgHdr. (∗ Header of Msg 3 ∗) const AV: msgHdr . (∗ Header of Msg 4 ∗) const CHALLENGE : msgHdr . (∗ Header of Msg 5 ∗) const RES : msgHdr . (∗ Header of Msg 6 ∗) const CMC: msgHdr. (∗ Header of Msg 7 ∗) const CMComplete: msgHdr. (∗ Header of Msg 8 ∗) const MSG: msgHdr. (∗ Header of Msg 9 ∗)

(∗ F u n c t i o n s ∗) fun a3(nonce, key) : resp. fun a8(nonce, key): sessKey. fun s e n c r y p t ( b i t s t r i n g , s e s s K e y ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k: sessKey; sdecrypt(sencrypt(m, k), k) = m. reduc encCapability() = true; encCapability() = false.

(∗ The key table consists of pairs (ident, key) shared between the MS and the HN. Table is not accessible by the attacker ∗) t a b l e keys(ident , key).

(∗ Fresh value not initially known to attacker ∗) f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif only ∗) (∗ deal with the secrecy of private free names ∗) (∗ secretKc is secret if and only if all kcs are secret ∗) f r e e s e c r e t K c : b i t s t r i n g [ p r i v a t e ]. query attacker (secretKc). not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , sessKey). event endSN(ident , sessKey). event begMS(ident , sessKey). event endMS(ident , sessKey). event disableEnc. query x1: ident, x2: sessKey; 139

event (endSN(x1, x2)) event (begSN(x1, x2)). query x1: ident, x2: sessKey; event (endMS(x1, x2)) event (begMS(x1, x2)).

(∗ When the attacker knows payload , the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). l e t processMS = (∗ Registration and setup ∗) new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; (∗ pre−shared identity and key ∗) l e t cap ms : bool = encCapability() i n (∗ choose capability ∗) (∗ The protocol ∗) out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) (∗ Compute response ∗) l e t r e s ms: resp = a3(rand ms , k i ) i n (∗ Compute encryption key ∗) l e t kc ms: sessKey = a8(rand ms , k i ) i n (∗ MS is authenticating itself to SN ∗) event begSN ( imsi ms , kc ms ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) i n (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) event endMS( imsi ms , kc ms ) ; out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) i n (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) out (pubChannel, sencrypt(secretKc , kc ms ) ) ; i f enableEnc ms = t r u e then l e t msgcontent : b i t s t r i n g = sdecrypt(msg, kc ms ) i n 0 . l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then (∗ Check response ∗) event endSN ( i m s i h n s n , k c s n ) ; event begMS ( i m s i h n s n , k c s n ) ; out (pubChannel , (CMC, cap s n ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) e l s e out (pubChannel , (MSG, sencrypt(payload , kc s n ) ) ) . (∗ [ Msg 9 ] ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; (∗ Generate a fresh random number ∗) get k e y s (= i m s i h n , k i h n ) i n (∗ attempt to look up key ∗) l e t x r e s hn: resp = a3(rand hn , k i h n ) i n l e t kc hn: sessKey = a8(rand hn , k i h n ) i n (∗ Send out authentication vector [Msg 4] ∗) out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , kc hn ) ) . p r o c e s s ((!processMS) | (!processSN) | (!processHN)) 140

S2. UMTS I – IV

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const SMC: msgHdr. const SMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): msgMac. fun s e n c r y p t ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; sdecrypt(sencrypt(m, k), k) = m. reduc encCapability() = true; encCapability() = false.

(∗ To test secrecy of the integrity key, ∗) (∗ use them as session keys to encrypt a free private name ∗) fun sencryptInteg( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; sdecryptInteg(sencryptInteg(m, k), k) = m.

(∗ the table ident/keys, the key table consists of pairs (ident, key) shared between MS and HN Table is not accessible by the attacker ∗) t a b l e keys(ident , key). f r e e smcompleteMsg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif only ∗) (∗ deal with the secrecy of private free names ∗) (∗ secretCk is secret if and only if all cks are secret ∗) f r e e s e c r e t C k : b i t s t r i n g [ p r i v a t e ]. query attacker (secretCk).

(∗ secretIk is secret if and only if all iks are secret ∗) f r e e s e c r e t I k : b i t s t r i n g [ p r i v a t e ]. 141

query attacker (secretIk). not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). event disableEnc. query attacker ( p a y l o a d ) event (disableEnc ). l e t processMS = (∗ registration and setup ∗) new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n (∗ choose capability ∗) out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms : nonce , mac ms : mac ) ) ; (∗ [ Msg 5 ] ∗) i f f 1 ( ki , rand ms ) = mac ms then l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) i n (pubChannel , (=SMC, enableEnc ms : bool , =cap ms , f r e s h ms: nonce, =f9((enableEnc ms , cap ms , f r e s h m s ) , i k m s ) ) ) ; (∗ [ Msg 7 ] ∗) event endMS( imsi ms , ck ms , ik ms , cap ms ) ; out (pubChannel , (SMComplete, f9(smcompleteMsg , ik m s ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=MSG, msg: b i t s t r i n g , f r e s h m s g m s : nonce , =f9((msg, fresh m s g m s ) , i k m s ) ) ) ; (∗ [ Msg 9 ] ∗) out (pubChannel, sencrypt(secretCk , ck ms ) ) ; out (pubChannel, sencryptInteg(secretIk , ik m s ) ) ; i f enableEnc ms = t r u e then l e t msgcontent : b i t s t r i n g = sdecrypt(msg, ck ms ) i n 0 . l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , x r e s s n : resp , c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then event endSN ( i m s i h n s n , ck sn , i k s n ) ; new f r e s h s n : nonce ; event begMS ( i m s i h n s n , ck sn , i k s n , c a p s n ) ; out (pubChannel , (SMC, cap sn , cap sn , f r e s h s n , f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=SMComplete, =f9(smcompleteMsg , ik s n ) ) ) ; 142

(∗ [ Msg 8 ] ∗) new f r e s h m s g s n : nonce ; i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload , fresh m s g s n , f9((payload , fresh m s g s n ) , i k s n ) ) ) (∗ [ Msg 9 ] ∗) e l s e out (pubChannel , (MSG, sencrypt(payload , ck s n ) , f r e s h m s g s n , f9((sencrypt(payload , ck s n ) , f r e s h m s g s n ) , i k s n ) ) ) . (∗ [ Msg 9 ] ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , ck hn , i k h n , mac hn ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processSN) | (!processHN) )

S3. LTE I – V

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between MME and HN ∗) f r e e secureChannel : channel [ p r i v a t e ]. (∗ Secure channel between MME and BS ∗) f r e e sChannelSnBts : channel [ p r i v a t e ]. type key . (∗ pre−s h a r e d Ki ∗) type i d e n t . (∗ identity of the MS and the SN ∗) type nonce . (∗ random number ∗) type msgHdr . (∗ message header ∗) type r e s p . (∗ r e s p o n s e ∗) type c i p h e r K e y . (∗ cipher key in UMTS authentication vectors ∗) type i n t e g K e y . (∗ integrity key in UMTS authentication vectors ∗) type mac . (∗ mac in authentication vectors ∗) type msgMac . (∗ integrity protection of messages ∗) type asmeKey . (∗ K ASME ∗) type nasEncKey . (∗ NAS encryption key ∗) type n a s I n t K e y . (∗ NAS inegerity key ∗) type enbKey . (∗ t y p e o f K enb ∗) type asEncKey . (∗ AS encryption key ∗) type a s I n t K e y . (∗ AS integrity key ∗) type upEncKey . (∗ UP encryption key ∗)

(∗ Constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr. 143

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun kdf asme(cipherKey , integKey , ident): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun k d f enb(asmeKey): enbKey. fun k d f a s enc(enbKey): asEncKey. fun k d f a s int(enbKey): asIntKey. fun k d f u p enc(enbKey): upEncKey. fun f i n t e g a s ( b i t s t r i n g , asIntKey): msgMac. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , asEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asEncKey; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , asIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asIntKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m. fun s e n c u p ( b i t s t r i n g , upEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: upEncKey; s d e c u p ( s e n c up(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ The table ident/keys The key table consists of pairs (ident, key) shared between MS and HN Table is not accessible by the attacker ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , ident , asmeKey). event endSN(ident , ident , asmeKey). event begMS(ident , ident , asmeKey, bool ). event endMS(ident , ident , asmeKey, bool ). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. event disableEnc. query attacker ( p a y l o a d ) . query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( s e c r e t ) . query x1: ident, x2: ident, x3: asmeKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 144

query x1: ident, x2: ident, x3: asmeKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). query x1: ident, x2: enbKey, x3: bool ; event (endMS ENB(x1, x2, x3)) event ( begMS ENB(x1, x2, x3)).

(∗ AS SMC procedure in process MS ∗) l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = l e t kenb ms: enbKey = kdf e n b ( kasme ms ) i n l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) i n l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) i n l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) i n i n (pubChannel , (=ASSMC, enableEnc a s m s : bool , =f i n t e g a s (bool2bitstring(enableEnc a s m s ) , k a s i n t m s ) ) ) ; (∗ [ Msg 1 0 ] ∗) out (pubChannel , (ASSMComplete, as smcomplete msg , f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 1 1 ] ∗) event endMS ENB( imsi ms , kenb ms , cap ms ) ; i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 1 2 ] ∗) out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; out (pubChannel , senc i n t as(secret , kasint m s ) ) ; out (pubChannel , senc up(secret , kupenc ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) i n 0 .

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; out (pubChannel, (ID, imsi m s ) ) ; i n ( pubChannel , (=CHALLENGE, rand ms : nonce , =f1(ki , rand ms ) , s n i d ms: ident)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , s n i d m s ) i n out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) i n l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) i n i n (pubChannel , (=NASSMC, enableEnc n a s m s : bool , =cap ms , =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; (∗ [ Msg 7 ] ∗) event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; out (pubChannel , senc i n t nas(secret , knasint m s ) ) ; event begSN ( imsi ms , snid ms , kasme ms ) ; i f e n a b l e E n c n a s m s = f a l s e then out (pubChannel , (NASSMComplete, nas smcomplete msg , f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) e l s e out (pubChannel , (NASSMComplete, s e n c r y p t n a s ( nas smcomplete msg , knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) .

(∗ process representing e−nodeB ∗) l e t processENB = 145

i n (sChannelSnBts , (kasme enb: asmeKey, imsi e n b : i d e n t , cap enb : bool )); l e t kenb enb: enbKey = kdf e n b ( kasme enb ) i n l e t k a s e n c enb: asEncKey = kdf a s e n c ( kenb enb ) i n l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) i n l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) i n event begMS ENB ( i m s i e n b , kenb enb , cap enb ) ; out (pubChannel , (ASSMC, cap enb , f i n t e g as(bool2bitstring(cap enb), kasint e n b ) ) ) ; (∗ [ Msg 1 0 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 1 1 ] ∗) i f cap enb = f a l s e then event disableEnc; out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) (∗ [ Msg 1 2 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kasenc e n b ) , f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . (∗ [ Msg 1 2 ] ∗)

(∗ process representing MME ∗) l e t processMME = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new s n i d s n : i d e n t ; out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, =imsi s n , =s n i d s n , r a n d s n : nonce , x r e s sn: resp, mac sn: mac, kasme sn: asmeKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) event begMS ( i m s i s n , s n i d s n , kasme sn , c a p s n ) ; l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) i n l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) i n out (pubChannel , (NASSMC, cap sn , cap sn , f i n t e g n a s ( ( cap sn , c a p sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) i f c a p s n = t r u e then i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then event endSN ( i m s i s n , s n i d s n , kasme sn ) ; out (sChannelSnBts , (kasme sn , i m s i s n , c a p s n ) ) e l s e 0 e l s e i f c a p s n = f a l s e then i f msg nas = nas smcomplete msg then event endSN ( i m s i s n , s n i d s n , kasme sn ) ; out (sChannelSnBts , (kasme sn , i m s i s n , c a p s n ) ) e l s e 0 e l s e 0 .

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t kasme hn: asmeKey = kdf asme ( ck hn , i k h n , s n i d h n ) i n out (secureChannel , (AV, imsi h n , s n i d h n , rand hn , x r e s h n , mac hn , kasme hn ) ) . (∗ [ Msg 4 ] ∗) 146

p r o c e s s ((!processMS) | (!processMME) | (!processENB) | (!processHN))

S4. GSM I k UMTS II’ k GSM III’–IV, convert(3G AV → 2G AV)

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac . type s e s s K e y .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const CMC: msgHdr. const CMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): msgMac. fun c2(resp):resp. fun c3(cipherKey , integKey): sessKey. fun s e n c r y p t ( b i t s t r i n g , s e s s K e y ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k: sessKey; sdecrypt(sencrypt(m, k), k) = m. reduc encCapability() = true; encCapability() = false.

(∗ The table ident/keys. The key table consists of pairs (ident, key) shared between MS and HN. Table is not accessible by the attacker ∗) t a b l e keys(ident , key). f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif ∗) f r e e s e c r e t K c : b i t s t r i n g [ p r i v a t e ]. query attacker (secretKc). not attacker ( new k i ) . 147

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , sessKey). event endSN(ident , sessKey). event begMS(ident , sessKey). event endMS(ident , sessKey). event disableEnc. query x1: ident, x2: sessKey; event (endSN(x1, x2)) event (begSN(x1, x2)). query x1: ident, x2: sessKey; event (endMS(x1, x2)) event (begMS(x1, x2)).

(∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ).

(∗ Process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) l e t r e s m s u: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t r e s m s g: resp = c2(res m s u ) i n l e t kc ms: sessKey = c3(ck ms , i k m s ) i n event begSN ( imsi ms , kc ms ) ; out ( pubChannel , (RES , r e s m s g ) ) ; (∗ [ Msg 6 ] ∗) i n (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) event endMS( imsi ms , kc ms ) ; out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) i n (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) out (pubChannel, sencrypt(secretKc , kc ms ) ) ; i f enableEnc ms = t r u e then l e t msgcontent : b i t s t r i n g = sdecrypt(msg, kc ms ) i n 0 . l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then event endSN ( i m s i h n s n , k c s n ) ; event begMS ( i m s i h n s n , k c s n ) ; out (pubChannel , (CMC, cap s n ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) e l s e out (pubChannel , (MSG, sencrypt(payload , kc s n ) ) ) . (∗ [ Msg 9 ] ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; 148

get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s h n u: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t x r e s h n g: resp = c2(xres h n u ) i n l e t kc hn: sessKey = c3(ck hn , i k h n ) i n out (secureChannel , (AV, imsi h n , rand hn , x r e s h n g , kc hn ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processSN) | (!processHN))

S5. GSM I–III k UMTS IV, conv(Kc → CK IK , VLR/SGSN)

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type s e s s K e y . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const SMC: msgHdr. const SMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun a3(nonce, key) : resp. fun a8(nonce, key): sessKey. fun c4(sessKey): cipherKey. fun c5(sessKey): integKey. fun f 9 ( b i t s t r i n g , integKey): msgMac. fun s e n c r y p t ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; sdecrypt(sencrypt(m, k), k) = m. fun sencryptSess( b i t s t r i n g , s e s s K e y ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k: sessKey; sdecryptSess(sencryptSess(m, k), k) = m. reduc encCapability() = true; encCapability() = false.

(∗ To test secrecy of the integrity key, ∗) (∗ use them as session keys to encrypt a free private name ∗) fun sencryptInteg( b i t s t r i n g , integKey): b i t s t r i n g . 149

reduc forall m: b i t s t r i n g , k: integKey; sdecryptInteg(sencryptInteg(m, k), k) = m.

(∗ the table ident/keys ∗) t a b l e keys(ident , key). f r e e smcompleteMsg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif only ∗) (∗ deal with the secrecy of private free names ∗) (∗ secretCk is secret if and only if all cks are secret ∗) f r e e s e c r e t C k : b i t s t r i n g [ p r i v a t e ]. query attacker (secretCk).

(∗ secretIk is secret if and only if all iks are secret ∗) f r e e s e c r e t I k : b i t s t r i n g [ p r i v a t e ]. query attacker (secretIk). f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , sessKey). event endSN(ident , sessKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). query x1: ident, x2: sessKey; event (endSN(x1, x2)) event (begSN(x1, x2)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ).

(∗ Process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = a3(rand ms , k i ) i n l e t kc ms: sessKey = a8(rand ms , k i ) i n event begSN ( imsi ms , kc ms ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t ck ms:cipherKey = c4(kc ms ) i n l e t i k ms:integKey = c5(kc ms ) i n i n (pubChannel , (=SMC, enableEnc ms : bool , =cap ms , f r e s h m s : nonce , =f9 ((enableEnc ms , cap ms , f r e s h m s ) , i k m s ) ) ) ; (∗ [ Msg 7 ] ∗) event endMS( imsi ms , ck ms , ik ms , cap ms ) ; out (pubChannel , (SMComplete, f9(smcompleteMsg , ik m s ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=MSG, msg: b i t s t r i n g , f r e s h m s g m s : nonce , =f9((msg, fresh m s g m s ) , i k m s ) ) ) ; (∗ [ Msg 9 ] ∗) 150

out (pubChannel, sencryptSess(secret , kc ms ) ) ; out (pubChannel, sencrypt(secretCk , ck ms ) ) ; out (pubChannel, sencryptInteg(secretIk , ik m s ) ) ; i f enableEnc ms = t r u e then l e t msgcontent : b i t s t r i n g = sdecrypt(msg, ck ms ) i n 0 . l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , x r e s s n : resp , k c sn: sessKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then event endSN ( i m s i h n s n , k c s n ) ; l e t c k sn:cipherKey = c4(kc s n ) i n l e t i k sn:integKey = c5(kc s n ) i n new f r e s h s n : nonce ; event begMS ( i m s i h n s n , ck sn , i k s n , c a p s n ) ; out (pubChannel , (SMC, cap sn , cap sn , f r e s h s n , f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=SMComplete, =f9(smcompleteMsg , ik s n ) ) ) ; (∗ [ Msg 8 ] ∗) new f r e s h m s g s n : nonce ; i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload , fresh m s g s n , f9((payload , fresh m s g s n ) , i k s n ) ) ) (∗ [ Msg 9 ] ∗) e l s e out (pubChannel , (MSG, sencrypt(payload , ck s n ) , f r e s h m s g s n , f9((sencrypt(payload , ck s n ) , f r e s h m s g s n ) , i k s n ) ) ) . (∗ [ Msg 9 ] ∗)

(∗ Process representing HN ∗) l e t processHN = (∗ Receive authentication vector request [Msg 3] ∗) i n (secureChannel , (=AV REQ , i m s i hn: ident)); new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t x r e s hn: resp = a3(rand hn , k i h n ) i n l e t kc hn: sessKey = a8(rand hn , k i h n ) i n (∗ Send out authentication vector [Msg 4] ∗) out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , kc hn ) ) . p r o c e s s ((!processMS) | (!processSN) | (!processHN) )

S6. UMTS I–III k GSM IV, conv(CK IK → Kc, VLR/SGSN)

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the MS and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . 151

type i n t e g K e y . type s e s s K e y . type mac . type msgMac .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const CMC: msgHdr. const CMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): msgMac. fun c3(cipherKey , integKey): sessKey. fun s e n c r y p t ( b i t s t r i n g , s e s s K e y ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k: sessKey; sdecrypt(sencrypt(m, k), k) = m.

(∗ To test secrecy of the cipher key, ∗) fun sencryptCipher( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; sdecryptCipher(sencryptCipher(m, k), k) = m. fun sencryptInteg( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; sdecryptInteg(sencryptInteg(m, k), k) = m. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key). f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif only ∗) (∗ deal with the secrecy of private free names ∗) (∗ secretKc is secret if and only if all kcs is secret ∗) f r e e s e c r e t K c : b i t s t r i n g [ p r i v a t e ]. query attacker (secretKc).

(∗ secretCk is secret if and only if all cks are secret ∗) f r e e s e c r e t C k : b i t s t r i n g [ p r i v a t e ]. query attacker (secretCk). f r e e s e c r e t I k : b i t s t r i n g [ p r i v a t e ]. query attacker (secretIk). not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , sessKey). event endMS(ident , sessKey). 152

query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: sessKey; event (endMS(x1, x2)) event (begMS(x1, x2)). event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ).

(∗ Process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, mac ms : mac ) ) ; (∗ [ Msg 5 ] ∗) i f f 1 ( ki , rand ms ) = mac ms then l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t kc ms: sessKey = c3(ck ms , i k m s ) i n i n (pubChannel , (=CMC, enableEnc ms : bool )); (∗ [ Msg 7 ] ∗) event endMS( imsi ms , kc ms ) ; out (pubChannel , CMComplete); (∗ [ Msg 8 ] ∗) i n (pubChannel , (=MSG, msg: b i t s t r i n g )); (∗ [ Msg 9 ] ∗) out (pubChannel, sencrypt(secretKc , kc ms ) ) ; out (pubChannel, sencryptInteg(secretIk , ik m s ) ) ; out (pubChannel , sencryptCipher(secretCk , ck ms ) ) ; i f enableEnc ms = t r u e then l e t msgcontent : b i t s t r i n g = sdecrypt(msg, kc ms ) i n 0 .

(∗ Process respresenting SN ∗) l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, rand s n : nonce , x r e s s n : resp , c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then event endSN ( i m s i h n s n , ck sn , i k s n ) ; l e t k c sn: sessKey = c3(ck sn , i k s n ) i n event begMS ( i m s i h n s n , k c s n ) ; out (pubChannel , (CMC, cap s n ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , =CMComplete); (∗ [ Msg 8 ] ∗) i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload)) (∗ [ Msg 9 ] ∗) e l s e out (pubChannel , (MSG, sencrypt(payload , kc s n ) ) ) . (∗ [ Msg 9 ] ∗)

(∗ Process representing HN ∗) l e t processHN = (∗ Receive authentication vector request [Msg 3] ∗) 153

i n (secureChannel , (=AV REQ , i m s i hn: ident)); new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n (∗ Send out authentication vector [Msg 4] ∗) out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , ck hn , i k h n , mac hn ) ) . p r o c e s s ((!processMS) | (!processSN) | (!processHN))

S7–. LTE I k UMTS II–III k LTE V, conv(CK IK → KASME , MME)

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type asmeKey . type enbKey . type asEncKey . type a s I n t K e y . type upEncKey . type mac . type msgMac .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun kdf asme(cipherKey , integKey): asmeKey. fun k d f enb(asmeKey): enbKey. fun k d f a s enc(enbKey): asEncKey. fun k d f a s int(enbKey): asIntKey. fun k d f u p enc(enbKey): upEncKey. fun f i n t e g a s ( b i t s t r i n g , asIntKey): msgMac. fun s e n c r y p t ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; 154

sdecrypt(sencrypt(m, k), k) = m. fun sencryptInteg( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; sdecryptInteg(sencryptInteg(m, k), k) = m. fun sencryptEnb( b i t s t r i n g , enbKey ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k : enbKey ; sdecryptEnb(sencryptEnb(m, k), k) = m. fun s e n c r y p t a s ( b i t s t r i n g , asEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asEncKey; s d e c r y p t as(sencrypt as(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key). f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) .

(∗ The standard secrecy queries of ProVerif only ∗) (∗ deal with the secrecy of private free names ∗) f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: enbKey, x3: bool ; event (endMS ENB(x1, x2, x3)) event ( begMS ENB(x1, x2, x3)). l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, mac ms : mac ) ) ; (∗ [ Msg 5 ] ∗) i f f 1 ( ki , rand ms ) = mac ms then l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t kasme ms = kdf asme ( ck ms , i k m s ) i n l e t kenb ms: enbKey = kdf e n b ( kasme ms ) i n 155

l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) i n l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) i n l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) i n i n (pubChannel , (=ASSMC, enableEnc a s m s : bool , =f i n t e g a s (bool2bitstring(enableEnc a s m s ) , k a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) out (pubChannel , (ASSMComplete, as smcomplete msg , f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 9 ] ∗) event endMS ENB ( imsi ms , kenb ms , cap ms ) ; i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 1 0 ] ∗) out (pubChannel, sencrypt(secret , ck ms ) ) ; out (pubChannel, sencryptInteg(secret , ik m s ) ) ; out (pubChannel , sencryptEnb(secret , kenb ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) i n 0 . l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, =imsi s n , r a n d sn: nonce, xres s n : resp , c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, res s n : r e s p ) ) ; (∗ [ Msg 6 ] ∗) i f r e s s n = x r e s s n then event endSN ( i m s i s n , ck sn , i k s n ) ; l e t kasme sn = kdf asme ( ck sn , i k s n ) i n l e t ke nb sn: enbKey = kdf e n b ( kasme sn ) i n l e t k a s e n c sn: asEncKey = kdf a s e n c ( ke nb sn ) i n l e t k a s i n t sn: asIntKey = kdf a s i n t ( k en b sn ) i n l e t kupenc sn: upEncKey = kdf u p e n c ( ke nb sn ) i n event begMS ENB ( i m s i s n , kenb sn , c a p s n ) ; out (pubChannel , (ASSMC, cap sn , f i n t e g as(bool2bitstring(cap s n ) , k a s i n t s n ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f i n t e g a s ( as smcomplete msg , k a s i n t s n ) ) ) ; (∗ [ Msg 9 ] ∗) i f c a p s n = f a l s e then event disableEnc; out (pubChannel, (MSG, payload , finteg as(payload , kasint s n ) ) ) (∗ [ Msg 1 0 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kasenc s n ) , f i n t e g as(sencrypt as(payload , kasenc s n ) , k a s i n t s n ) ) ) . (∗ [ Msg 1 0 ] ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , ck hn , i k h n , mac hn ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processSN) | (!processHN))

S7. LTE I k UMTS II–III k LTE IV–V, conv(CK IK → KASME , MME) 156

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel .

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac . type asmeKey . type nasEncKey . type n a s I n t K e y . type enbKey . type asEncKey . type a s I n t K e y . type upEncKey .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun kdf asme(cipherKey , integKey): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun k d f enb(asmeKey): enbKey. fun k d f a s enc(enbKey): asEncKey. fun k d f a s int(enbKey): asIntKey. fun k d f u p enc(enbKey): upEncKey. fun f i n t e g a s ( b i t s t r i n g , asIntKey): msgMac. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , asEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asEncKey; s d e c r y p t as(sencrypt as(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key). 157

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , asIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asIntKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m. fun s e n c u p ( b i t s t r i n g , upEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: upEncKey; s d e c u p ( s e n c up(m, k), k) =m. not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , asmeKey, bool ). event endMS(ident , asmeKey, bool ). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). query x1: ident , x2:cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: asmeKey, x3: bool ; event (endMS(x1, x2, x3)) event (begMS(x1, x2, x3)). query x1: ident, x2: enbKey, x3: bool ; event (endMS ENB(x1, x2, x3)) event ( begMS ENB(x1, x2, x3)).

(∗ AS SMC procedure in process MS ∗) l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = l e t kenb ms: enbKey = kdf e n b ( kasme ms ) i n l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) i n l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) i n l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) i n i n (pubChannel , (=ASSMC, enableEnc a s m s : bool , =f i n t e g a s (bool2bitstring(enableEnc a s m s ) , k a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) event endMS ENB( imsi ms , kenb ms , cap ms ) ; out (pubChannel , (ASSMComplete, as smcomplete msg , f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 9 ] ∗) i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 1 0 ] ∗) out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; out (pubChannel , senc i n t as(secret , kasint m s ) ) ; out (pubChannel , senc up(secret , kupenc ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) i n 0 .

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; 158

insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) ) ) ; (∗ [ Msg 3 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 4 ] ∗) l e t kasme ms:asmeKey = kdf asme ( ck ms , i k m s ) i n l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) i n l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) i n i n (pubChannel , (=NASSMC, enableEnc n a s m s : bool , =cap ms , =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; (∗ [ Msg 5 ] ∗) event endMS( imsi ms , kasme ms , cap ms ) ; out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; out (pubChannel , senc i n t nas(secret , knasint m s ) ) ; i f e n a b l e E n c n a s m s = f a l s e then out (pubChannel , (NASSMComplete, nas smcomplete msg , f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 6 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) e l s e out (pubChannel , (NASSMComplete, sencrypt n a s ( nas smcomplete msg , knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 6 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) .

(∗ process representing e−nodeB ∗) l e t pENB( kasme enb: asmeKey, imsi enb: ident, cap enb : bool ) = l e t kenb enb: enbKey = kdf e n b ( kasme enb ) i n l e t k a s e n c enb: asEncKey = kdf a s e n c ( kenb enb ) i n l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) i n l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) i n event begMS ENB ( i m s i e n b , kenb enb , cap enb ) ; out (pubChannel , (ASSMC, cap enb , f i n t e g as(bool2bitstring(cap enb ) , k a s i n t e n b ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 9 ] ∗) i f cap enb = f a l s e then event disableEnc; out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) (∗ [ Msg 1 0 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kasenc e n b ) , f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . (∗ [ Msg 1 0 ] ∗)

(∗ process representing MME and HN ∗) l e t processMMEHN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new r a n d s n : nonce ; get k e y s (= i m s i s n , k i s n ) i n l e t mac sn: mac = f1(ki s n , r a n d s n ) i n l e t x r e s sn: resp = f2(ki s n , r a n d s n ) i n l e t c k sn: cipherKey = f3(ki s n , r a n d s n ) i n l e t i k sn: integKey = f4(ki s n , r a n d s n ) i n out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 3 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 4 ] ∗) event endSN ( i m s i s n , ck sn , i k s n ) ; l e t kasme sn: asmeKey = kdf asme ( ck sn , i k s n ) i n 159

l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) i n l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) i n event begMS ( i m s i s n , kasme sn , c a p s n ) ; out (pubChannel , (NASSMC, cap sn , cap sn , f i n t e g n a s ( ( cap sn , c a p sn), knasint s n ) ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 6 ] ∗) i f c a p s n = t r u e then i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then pENB( kasme sn , i m s i s n , c a p s n ) e l s e 0 e l s e i f msg nas = nas smcomplete msg then pENB( kasme sn , i m s i s n , c a p s n ) e l s e 0 . p r o c e s s ((!processMS) | (!processMMEHN))

S8. LTE I’ k UMTS II–III k LTE IV–V, conv(CK IK nonces → KASME , MME)

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the MME and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ]. (∗ Secure channel between the MME and the BS ∗) f r e e sChannelSnBts : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac . type asmeKey . type nasEncKey . type n a s I n t K e y . type enbKey . type asEncKey . type a s I n t K e y . type upEncKey .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr. const NONCE TAU: msgHdr.

(∗ F u n c t i o n s ∗) 160

fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun kdf asme(cipherKey , integKey , nonce, nonce): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun k d f enb(asmeKey): enbKey. fun k d f a s enc(enbKey): asEncKey. fun k d f a s int(enbKey): asIntKey. fun k d f u p enc(enbKey): upEncKey. fun f i n t e g a s ( b i t s t r i n g , asIntKey): msgMac. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , asEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asEncKey; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , asIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: asIntKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m. fun s e n c u p ( b i t s t r i n g , upEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: upEncKey; s d e c u p ( s e n c up(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). event begMS ENB(ident , enbKey, bool ). event endMS ENB(ident , enbKey, bool ). query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). 161

query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). query x1: ident, x2: enbKey, x3: bool ; event (endMS ENB(x1, x2, x3)) event ( begMS ENB(x1, x2, x3)).

(∗ AS SMC procedure in process MS ∗) l e t pMSAS( kasme ms: asmeKey, imsi ms: ident, cap ms : bool ) = l e t kenb ms: enbKey = kdf e n b ( kasme ms ) i n l e t kasenc ms: asEncKey = kdf a s e n c ( kenb ms ) i n l e t k a s i n t ms: asIntKey = kdf a s i n t ( kenb ms ) i n l e t kupenc ms: upEncKey = kdf u p e n c ( kenb ms ) i n i n (pubChannel , (=ASSMC, enableEnc a s m s : bool , =f i n t e g a s (bool2bitstring(enableEnc a s m s ) , k a s i n t m s ) ) ) ; (∗ [ Msg 1 1 ] ∗) out (pubChannel , (ASSMComplete, as smcomplete msg , f i n t e g a s ( as smcomplete msg , k a s i n t m s ) ) ) ; (∗ [ Msg 1 2 ] ∗) event endMS ENB( imsi ms , kenb ms , cap ms ) ; i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f i n t e g as(datamsg, kasint m s ) ) ) ; (∗ [ Msg 1 3 ] ∗) out (pubChannel , sencrypt as(secret , kasenc ms ) ) ; out (pubChannel , senc i n t as(secret , kasint m s ) ) ; out (pubChannel , senc up(secret , kupenc ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kasenc ms ) i n 0 .

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) new nonce ms : nonce ; out (pubChannel , (NONCE TAU, nonce ms ) ) ; (∗ [ Msg 3 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) ) ) ; (∗ [ Msg 6 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=NASSMC, enableEnc n a s m s : bool , =cap ms , =nonce ms , nonce mme ms: nonce, nas mac: msgMac)); (∗ [ Msg 8 ] ∗) l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , nonce ms , nonce mme ms ) i n l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) i n l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) i n i f ( nas mac = f i n t e g nas ((enableEnc nas ms , cap ms , nonce ms , nonce mme ms),knasint m s ) ) then event endMS( imsi ms , ck ms , ik ms , cap ms ) ; out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; out (pubChannel , senc i n t nas(secret , knasint m s ) ) ; i f e n a b l e E n c n a s m s = f a l s e then out (pubChannel , (NASSMComplete, nas smcomplete msg , f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) e l s e out (pubChannel , (NASSMComplete, sencrypt n a s ( nas smcomplete msg , knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 9 ] ∗) pMSAS( kasme ms , imsi ms , cap ms ) .

(∗ process representing e−nodeB ∗) l e t processENB = 162

i n (sChannelSnBts , (kasme enb: asmeKey, imsi e n b : i d e n t , cap enb : bool )); l e t kenb enb: enbKey = kdf e n b ( kasme enb ) i n l e t k a s e n c enb: asEncKey = kdf a s e n c ( kenb enb ) i n l e t k a s i n t enb: asIntKey = kdf a s i n t ( kenb enb ) i n l e t kupenc enb: upEncKey = kdf u p e n c ( kenb enb ) i n event begMS ENB ( i m s i e n b , kenb enb , cap enb ) ; out (pubChannel , (ASSMC, cap enb , f i n t e g as(bool2bitstring(cap enb), kasint e n b ) ) ) ; (∗ [ Msg 1 1 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f i n t e g a s ( as smcomplete msg , k a s i n t e n b ) ) ) ; (∗ [ Msg 1 2 ] ∗) i f cap enb = f a l s e then event disableEnc; out (pubChannel, (MSG, payload , finteg as(payload , kasint e n b ) ) ) (∗ [ Msg 1 3 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kasenc e n b ) , f i n t e g as(sencrypt as(payload , kasenc enb), kasint e n b ) ) ) . (∗ [ Msg 1 3 ] ∗)

(∗ process representing MME ∗) l e t processMME = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) i n (pubChannel , (=NONCE TAU, nonce ms sn:nonce)); (∗ [ Msg 3 ] ∗) out (secureChannel , (AV REQ , i m s i s n ) ) ; (∗ [ Msg 4 ] ∗) i n (secureChannel , (=AV, =imsi s n , r a n d sn: nonce, xres s n : resp , c k sn: cipherKey, ik sn: integKey, mac sn : mac ) ) ; (∗ [ Msg 5 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn ) ) ; (∗ [ Msg 6 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 7 ] ∗) event endSN ( i m s i s n , ck sn , i k s n ) ; new nonce mme : nonce ; l e t kasme sn: asmeKey = kdf asme ( ck sn , i k s n , nonce ms sn , nonce mme ) i n l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) i n l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) i n event begMS ( i m s i s n , ck sn , i k s n , c a p s n ) ; out (pubChannel , (NASSMC, cap sn , cap sn , nonce ms sn , nonce mme , f i n t e g n a s ( ( cap sn , cap sn , nonce ms sn , nonce mme ) , k n a s i n t s n ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 9 ] ∗) i f c a p s n = t r u e then i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then out (sChannelSnBts , (kasme sn , i m s i s n , c a p s n ) ) e l s e 0 e l s e i f c a p s n = f a l s e then i f msg nas = nas smcomplete msg then out (sChannelSnBts , (kasme sn , i m s i s n , c a p s n ) ) e l s e 0 e l s e 0 .

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident)); (∗ [ Msg 4 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n out (secureChannel , (AV, imsi h n , rand hn , x r e s h n , ck hn , i k h n , mac hn ) ) . (∗ [ Msg 5 ] ∗) 163

p r o c e s s ((!processMS) | (!processMME) | (!processENB) | (!processHN))

S9–. GSM I k LTE II–III k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type gsmKey . type mac . type msgMac . type asmeKey . type nasEncKey . type n a s I n t K e y .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr. const CMComplete: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): b i t s t r i n g . fun kdf asme(cipherKey , integKey , ident): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun c3(cipherKey , integKey): gsmKey. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , gsmKey ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k : gsmKey ; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , integKey): b i t s t r i n g . 164

reduc forall m: b i t s t r i n g , k: integKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m. (∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS AS(ident , gsmKey, bool ). event endMS AS(ident , gsmKey, bool ). query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: gsmKey, x3: bool ; event ( endMS AS(x1, x2, x3)) event ( begMS AS(x1, x2, x3)).

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms : nonce , =f1(ki , rand ms ) , s n i d ms: ident)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , s n i d m s ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t kc ms:gsmKey = c3(ck ms , i k m s ) i n i n (pubChannel , (=ASSMC, enableEnc a s m s : bool )); (∗ [ Msg 8 ] ∗) event endMS AS ( imsi ms , kc ms , cap ms ) ; out (pubChannel , CMComplete); (∗ [ Msg 9 ] ∗) i n (pubChannel , (=MSG, datamsg: b i t s t r i n g )); (∗ [ Msg 1 0 ] ∗) out (pubChannel , sencrypt as(secret , kc ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kc ms ) i n 0 . 165

(∗ process representing SN ∗) l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new s n i d s n : i d e n t ; out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, =imsi s n , s n i d h n s n : i d e n t , r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) event endSN ( i m s i s n , ck sn , i k s n ) ; l e t k c sn: gsmKey = c3(ck sn , i k s n ) i n event begMS AS ( i m s i s n , kc sn , c a p s n ) ; out (pubChannel , (ASSMC, cap s n ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , =CMComplete); (∗ [ Msg 9 ] ∗) i f c a p s n = f a l s e then event disableEnc; out (pubChannel , (MSG, payload)) (∗ [ Msg 1 0 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kc s n ) ) ) . (∗ [ Msg 1 0 ] ∗)

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t kasme hn: asmeKey = kdf asme ( ck hn , i k h n , s n i d h n ) i n out (secureChannel , (AV, imsi h n , s n i d h n , rand hn , x r e s h n , mac hn , kasme hn , ck hn , i k h n ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processSN) | (!processHN))

S9. GSM I k LTE II–IV k GSM IV, conv(CK IK → Kc, MME), AV = 4G AV + CK + IK

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the MME and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ]. (∗ Secure channel between the MME and the BS ∗) f r e e sChannelSnBts : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type gsmKey . type mac . type msgMac . 166

type asmeKey . type nasEncKey . type n a s I n t K e y .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr. const CMComplete: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): b i t s t r i n g . fun kdf asme(cipherKey , integKey , ident): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun c3(cipherKey , integKey): gsmKey. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , gsmKey ) : b i t s t r i n g . reduc forall m: b i t s t r i n g , k : gsmKey ; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload, the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . 167

not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , ident , asmeKey). event endSN(ident , ident , asmeKey). event begMS(ident , ident , asmeKey, bool ). event endMS(ident , ident , asmeKey, bool ). event begMS AS(ident , gsmKey, bool ). event endMS AS(ident , gsmKey, bool ). query x1: ident, x2: ident, x3: asmeKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: ident, x3: asmeKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). query x1: ident, x2: gsmKey, x3: bool ; event ( endMS AS(x1, x2, x3)) event ( begMS AS(x1, x2, x3)).

(∗ AS SMC procedure in process MS ∗) l e t pMSAS( kc ms:gsmKey, imsi ms: ident, cap ms : bool ) = i n (pubChannel , (=ASSMC, enableEnc a s m s : bool )); (∗ [ Msg 1 0 ] ∗) event endMS AS ( imsi ms , kc ms , cap ms ) ; out (pubChannel , CMComplete); (∗ [ Msg 1 1 ] ∗) i n (pubChannel , (=MSG, datamsg: b i t s t r i n g )); out (pubChannel , sencrypt as(secret , kc ms ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, kc ms ) i n 0 .

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms : nonce , =f1(ki , rand ms ) , s n i d ms: ident)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , s n i d m s ) i n event begSN ( imsi ms , snid ms , kasme ms ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) i n l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) i n i n (pubChannel , (=NASSMC, enableEnc n a s m s : bool , =cap ms , =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; (∗ [ Msg 7 ] ∗) event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; out (pubChannel , senc i n t nas(secret , knasint m s ) ) ; l e t kc ms:gsmKey = c3(ck ms , i k m s ) i n i f e n a b l e E n c n a s m s = f a l s e then out (pubChannel , (NASSMComplete, nas smcomplete msg , f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) pMSAS( kc ms , imsi ms , cap ms ) e l s e out (pubChannel , (NASSMComplete, s e n c r y p t n a s ( nas smcomplete msg , knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , knasenc ms ) , k n a s i n t m s ) ) ) ; (∗ [ Msg 8 ] ∗) pMSAS( kc ms , imsi ms , cap ms ) . 168

(∗ process representing e−nodeB ∗) l e t processBS = i n (sChannelSnBts , (kc bs: gsmKey, imsi bs: ident, cap b s : bool )); event begMS AS ( i m s i b s , kc bs , c a p b s ) ; out (pubChannel , (ASSMC, cap b s ) ) ; (∗ [ Msg 1 0 ] ∗) i n (pubChannel , =CMComplete); (∗ [ Msg 1 1 ] ∗) i f c a p b s = f a l s e then event disableEnc; out (pubChannel , (MSG, payload)) (∗ [ Msg 1 2 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , kc b s ) ) ) . (∗ [ Msg 1 2 ] ∗)

(∗ process representing MME ∗) l e t processMME = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new s n i d s n : i d e n t ; out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, imsi h n sn: ident, snid h n s n : i d e n t , r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) event begMS ( i m s i h n s n , s n i d h n s n , kasme sn , c a p s n ) ; l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) i n l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) i n out (pubChannel , (NASSMC, cap sn , cap sn , f i n t e g n a s ( ( cap sn , c a p sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) l e t k c sn: gsmKey = c3(ck sn , i k s n ) i n i f c a p s n = t r u e then i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then event endSN ( i m s i h n s n , s n i d h n s n , kasme sn ) ; out (sChannelSnBts , (kc sn , i m s i h n s n , c a p s n ) ) e l s e 0 e l s e i f c a p s n = f a l s e then i f msg nas = nas smcomplete msg then event endSN ( i m s i h n s n , s n i d h n s n , kasme sn ) ; out (sChannelSnBts , (kc sn , i m s i h n s n , c a p s n ) ) e l s e 0 e l s e 0 .

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t kasme hn: asmeKey = kdf asme ( ck hn , i k h n , s n i d h n ) i n out (secureChannel , (AV, imsi h n , s n i d h n , rand hn , x r e s h n , mac hn , kasme hn , ck hn , i k h n ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processMME) | (!processBS) | (!processHN)) 169

S10–. UMTS I k LTE II–III k UMTS IV, AV = 4G AV + CK + IK

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the SN and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac . type asmeKey .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): b i t s t r i n g . fun kdf asme(cipherKey , integKey , ident): asmeKey. fun s e n c r y p t a s ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload , ∗) (∗ the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. 170

query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , cipherKey , integKey). event endSN(ident , cipherKey , integKey). event begMS(ident , cipherKey , integKey , bool ). event endMS(ident , cipherKey , integKey , bool ). query x1: ident, x2: cipherKey, x3: integKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)).

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) , s n i d ms: ident)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , s n i d m s ) i n event begSN ( imsi ms , ck ms , i k m s ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) i n (pubChannel , (=ASSMC, =cap ms, enableEnc a s m s : bool , f r e s h ms:nonce, =f9((cap ms, enableEnc as ms , f r e s h m s ) , i k m s ) ) ) ; (∗ [ Msg 8 ] ∗) out (pubChannel , (ASSMComplete, as smcomplete msg , f 9 ( as smcomplete msg , i k m s ) ) ) ; (∗ [ Msg 9 ] ∗) event endMS( imsi ms , ck ms , ik ms , cap ms ) ; i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f9(datamsg, ik m s ) ) ) ; (∗ [ Msg 1 0 ] ∗) out (pubChannel , sencrypt as(secret , ck ms ) ) ; out (pubChannel , senc i n t as(secret , ik m s ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, ck ms ) i n 0 .

(∗ process representing SN ∗) l e t processSN = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new s n i d s n : i d e n t ; out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, =imsi s n , =s n i d s n , r a n d s n : nonce , x r e s sn: resp, mac sn: mac, kasme sn: asmeKey, c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) event endSN ( i m s i s n , ck sn , i k s n ) ; new f r e s h s n : nonce ; event begMS ( i m s i s n , ck sn , i k s n , c a p s n ) ; out (pubChannel , (ASSMC, cap sn , cap sn , f r e s h s n , f 9 ( ( cap sn , cap sn , f r e s h s n ) , i k s n ) ) ) ; (∗ [ Msg 8 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f 9 ( as smcomplete msg , i k s n ) ) ) ; (∗ [ Msg 9 ] ∗) i f c a p s n = f a l s e then 171

event disableEnc; out (pubChannel, (MSG, payload , f9(payload , ik s n ) ) ) (∗ [ Msg 1 0 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , ck s n ) , f9(sencrypt as(payload , ck s n ) , i k s n ) ) ) . (∗ [ Msg 1 0 ] ∗)

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t kasme hn: asmeKey = kdf asme ( ck hn , i k h n , s n i d h n ) i n out (secureChannel , (AV, imsi h n , s n i d h n , rand hn , x r e s h n , mac hn , kasme hn , ck hn , i k h n ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processSN) | (!processHN))

S10. UMTS I k LTE II–IV k UMTS IV, AV = 4G AV + CK + IK

(∗ Public channel between the MS and the SN ∗) f r e e pubChannel : channel . (∗ Secure channel between the MME and the HN ∗) f r e e secureChannel : channel [ p r i v a t e ]. (∗ Secure channel between the MME and the BS ∗) f r e e sChannelSnBts : channel [ p r i v a t e ].

(∗ t y p e s ∗) type key . type i d e n t . type nonce . type msgHdr . type r e s p . type c i p h e r K e y . type i n t e g K e y . type mac . type msgMac . type asmeKey . type nasEncKey . type n a s I n t K e y .

(∗ constant message headers ∗) const CAP: msgHdr. const ID : msgHdr . const AV REQ: msgHdr. const AV: msgHdr . const CHALLENGE : msgHdr . const RES : msgHdr . const NASSMC: msgHdr . const NASSMComplete: msgHdr. const ASSMC: msgHdr . const ASSMComplete: msgHdr. const MSG: msgHdr.

(∗ F u n c t i o n s ∗) fun f1(key, nonce): mac. fun f2(key, nonce): resp. 172

fun f3(key, nonce): cipherKey. fun f4(key, nonce): integKey. fun f 9 ( b i t s t r i n g , integKey): b i t s t r i n g . fun kdf asme(cipherKey , integKey , ident): asmeKey. fun k d f n a s enc(asmeKey) : nasEncKey. fun k d f n a s int(asmeKey): nasIntKey. fun f i n t e g n a s ( b i t s t r i n g , nasIntKey): msgMac. fun s e n c r y p t n a s ( b i t s t r i n g , nasEncKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasEncKey; s d e c r y p t nas(sencrypt nas(m, k), k) =m. fun s e n c r y p t a s ( b i t s t r i n g , cipherKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: cipherKey; s d e c r y p t as(sencrypt as(m, k), k) =m. fun s e n c i n t n a s ( b i t s t r i n g , nasIntKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: nasIntKey; s d e c i n n a s ( s e n c i n t nas(m, k), k) =m. fun s e n c i n t a s ( b i t s t r i n g , integKey): b i t s t r i n g . reduc forall m: b i t s t r i n g , k: integKey; s d e c i n a s ( s e n c i n t as(m, k), k) =m.

(∗ Type Converter ∗) fun bool2bitstring( bool ): b i t s t r i n g [data, typeConverter]. reduc encCapability() = true; encCapability() = false.

(∗ the table ident/keys ∗) t a b l e keys(ident , key).

(∗ SMC command msg ∗) f r e e nas smcomplete msg : b i t s t r i n g . f r e e as smcomplete msg : b i t s t r i n g . f r e e p a y l o a d : b i t s t r i n g [ p r i v a t e ]. event disableEnc. (∗ When the attacker knows payload , ∗) (∗ the event disableEnc has been executed. ∗) query attacker ( p a y l o a d ) event (disableEnc ). query attacker ( p a y l o a d ) . f r e e s e c r e t : b i t s t r i n g [ p r i v a t e ]. query attacker ( s e c r e t ) . not attacker ( new k i ) .

(∗ Events used to specify correspondence assertions ∗) event begSN(ident , ident , asmeKey). event endSN(ident , ident , asmeKey). event begMS(ident , ident , asmeKey, bool ). event endMS(ident , ident , asmeKey, bool ). event begMS AS(ident , cipherKey , integKey , bool ). event endMS AS(ident , cipherKey , integKey , bool ). query x1: ident, x2: ident, x3: asmeKey; event (endSN(x1, x2, x3)) event (begSN(x1, x2, x3)). query x1: ident, x2: ident, x3: asmeKey, x4: bool ; event (endMS(x1, x2, x3, x4)) event (begMS(x1, x2, x3, x4)). query x1: ident, x2: cipherKey, x3: integKey, x4: bool ; event ( endMS AS(x1, x2, x3, x4)) event ( begMS AS(x1, x2, x3, x4)).

(∗ AS SMC procedure in process MS ∗) l e t pMSAS( ck ms: cipherKey, ik ms: integKey, imsi m s : i d e n t , cap ms : bool ) = i n (pubChannel , (=ASSMC, =cap ms, enableEnc a s m s : bool , 173

=f 9 ( ( cap ms, enableEnc a s m s ) , i k m s ) ) ) ; (∗ [ Msg 1 0 ] ∗) out (pubChannel , (ASSMComplete, as smcomplete msg , f 9 ( as smcomplete msg , i k m s ) ) ) ; (∗ [ Msg 1 1 ] ∗) event endMS AS ( imsi ms , ck ms , ik ms , cap ms ) ; i n (pubChannel , (=MSG, datamsg: b i t s t r i n g , =f9(datamsg, ik m s ) ) ) ; (∗ [ Msg 1 2 ] ∗) out (pubChannel , sencrypt as(secret , ck ms ) ) ; out (pubChannel , senc i n t as(secret , ik m s ) ) ; i f e n a b l e E n c a s m s = t r u e then l e t msgcontent : b i t s t r i n g = s d e c r y p t as(datamsg, ck ms ) i n 0 .

(∗ process respresenting MS ∗) l e t processMS = new i m s i m s : i d e n t ; new k i : key ; insert keys(imsi ms , k i ) ; l e t cap ms : bool = encCapability() i n out (pubChannel , (CAP, cap ms ) ) ; (∗ [ Msg 1 ] ∗) out (pubChannel, (ID, imsi m s ) ) ; (∗ [ Msg 2 ] ∗) i n ( pubChannel , (=CHALLENGE, rand ms: nonce, =f1(ki, rand ms ) , s n i d ms: ident)); (∗ [ Msg 5 ] ∗) l e t r e s ms: resp = f2(ki, rand ms ) i n l e t ck ms: cipherKey = f3(ki, rand ms ) i n l e t i k ms: integKey = f4(ki, rand ms ) i n l e t kasme ms: asmeKey = kdf asme ( ck ms , ik ms , s n i d m s ) i n event begSN ( imsi ms , snid ms , kasme ms ) ; out ( pubChannel , (RES , r e s m s ) ) ; (∗ [ Msg 6 ] ∗) l e t knasenc ms: nasEncKey = kdf n a s e n c ( kasme ms ) i n l e t k n a s i n t ms: nasIntKey = kdf n a s i n t ( kasme ms ) i n i n (pubChannel , (=NASSMC, enableEnc n a s m s : bool , =cap ms , =f i n t e g nas ((enableEnc nas ms , cap ms), knasint m s ) ) ) ; (∗ [ Msg 7 ] ∗) event endMS( imsi ms , snid ms , kasme ms , cap ms ) ; out (pubChannel , sencrypt nas(secret , knasenc ms ) ) ; out (pubChannel , senc i n t nas(secret , knasint m s ) ) ; i f e n a b l e E n c n a s m s = f a l s e then out (pubChannel , (NASSMComplete, nas smcomplete msg , f i n t e g n a s ( nas smcomplete msg, knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) pMSAS( ck ms , ik ms , imsi ms , cap ms ) e l s e out (pubChannel , (NASSMComplete, sencrypt n a s ( nas smcomplete msg , knasenc ms ) , f i n t e g nas(sencrypt n a s ( nas smcomplete msg , knasenc ms), knasint m s ) ) ) ; (∗ [ Msg 8 ] ∗) pMSAS( ck ms , ik ms , imsi ms , cap ms ) .

(∗ process representing e−nodeB ∗) l e t processBS = i n (sChannelSnBts , (ck bs: cipherKey, ik bs: integKey, i m s i bs: ident, cap b s : bool )); event begMS AS ( i m s i b s , ck bs , i k b s , c a p b s ) ; out (pubChannel , (ASSMC, cap bs , cap bs , f 9 ( ( cap bs , c a p b s ) , i k b s ) ) ) ; (∗ [ Msg 1 0 ] ∗) i n (pubChannel , (=ASSMComplete, =as smcomplete msg , =f 9 ( as smcomplete msg , i k b s ) ) ) ; (∗ [ Msg 1 1 ] ∗) i f c a p b s = f a l s e then event disableEnc; out (pubChannel, (MSG, payload , f9(payload , ik b s ) ) ) (∗ [ Msg 1 2 ] ∗) e l s e out (pubChannel , (MSG, sencrypt as(payload , ck b s ) , f9(sencrypt as(payload , ck b s ) , i k b s ) ) ) . (∗ [ Msg 1 2 ] ∗)

(∗ process representing MME ∗) l e t processMME = i n (pubChannel , (=CAP, cap s n : bool )); (∗ [ Msg 1 ] ∗) 174

i n (pubChannel, (=ID, imsi sn: ident)); (∗ [ Msg 2 ] ∗) new s n i d s n : i d e n t ; out (secureChannel , (AV REQ , i m s i s n , s n i d s n ) ) ; (∗ [ Msg 3 ] ∗) i n (secureChannel , (=AV, =imsi s n , s n i d h n s n : i d e n t , r a n d sn: nonce, xres sn: resp, mac sn: mac, kasme sn: asmeKey, c k sn: cipherKey, ik sn: integKey)); (∗ [ Msg 4 ] ∗) out (pubChannel , (CHALLENGE, rand sn , mac sn , s n i d s n ) ) ; (∗ [ Msg 5 ] ∗) i n (pubChannel , (=RES, =xres s n ) ) ; (∗ [ Msg 6 ] ∗) event begMS ( i m s i s n , s n i d h n s n , kasme sn , c a p s n ) ; l e t k n a s e n c sn: nasEncKey = kdf n a s e n c ( kasme sn ) i n l e t k n a s i n t sn: nasIntKey = kdf n a s i n t ( kasme sn ) i n out (pubChannel , (NASSMC, cap sn , cap sn , f i n t e g n a s ( ( cap sn , c a p sn), knasint s n ) ) ) ; (∗ [ Msg 7 ] ∗) i n (pubChannel , (=NASSMComplete, msg nas : b i t s t r i n g , =f i n t e g n a s ( msg nas, knasint s n ) ) ) ; (∗ [ Msg 8 ] ∗) i f c a p s n = t r u e then i f s d e c r y p t n a s ( msg nas, knasenc s n ) = nas smcomplete msg then event endSN ( i m s i s n , s n i d h n s n , kasme sn ) ; out (sChannelSnBts , (ck sn , i k s n , i m s i s n , c a p s n ) ) e l s e 0 e l s e i f c a p s n = f a l s e then i f msg nas = nas smcomplete msg then event endSN ( i m s i s n , s n i d h n s n , kasme sn ) ; out (sChannelSnBts , (ck sn , i k s n , i m s i s n , c a p s n ) ) e l s e 0 e l s e 0 .

(∗ process representing HN ∗) l e t processHN = i n (secureChannel , (=AV REQ , i m s i hn: ident, snid hn: ident)); (∗ [ Msg 3 ] ∗) new rand hn : nonce ; get k e y s (= i m s i h n , k i h n ) i n l e t mac hn: mac = f1(ki h n , rand hn ) i n l e t x r e s hn: resp = f2(ki h n , rand hn ) i n l e t ck hn: cipherKey = f3(ki h n , rand hn ) i n l e t i k hn: integKey = f4(ki h n , rand hn ) i n l e t kasme hn: asmeKey = kdf asme ( ck hn , i k h n , s n i d h n ) i n out (secureChannel , (AV, imsi h n , s n i d h n , rand hn , x r e s h n , mac hn , kasme hn , ck hn , i k h n ) ) . (∗ [ Msg 4 ] ∗) p r o c e s s ((!processMS) | (!processMME) | (!processBS) | (!processHN)) 175

Bibliography

[1] 3GPP TR 31.900 version 11.0.0 Release 11; Universal Mobile Telecommunica- tions System (UMTS); LTE; SIM/USIM internal and external interworking as- pects. http://www.3gpp.org/ftp/Specs/html-info/31900.htm.

[2] 3GPP TR 33.902 version 4.0.0 Release 4; Universal Mobile Telecommunications System (UMTS); Formal Analysis of the 3G Authentication Protocol . http: //www.3gpp.org/DynaReport/33902.htm.

[3] 3GPP TS 23.003 version 10.3.0 Release 10; Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); Numbering, addressing and identification. http://www.3gpp.org/ftp/Specs/ html-info/23003.htm.

[4] 3GPP TS 23.060 version 11.5.0 Release 11; Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); General Packet Radio Service (GPRS); Service description; Stage 2. http: //www.3gpp.org/ftp/Specs/html-info/23060.htm.

[5] 3GPP TS 23.401 version 11.4.0 Release 11; LTE; General Packet Radio Ser- vice (GPRS) enhancements for Evolved Universal Terrestrial Radio Access Network (E-UTRAN) access. http://www.3gpp.org/ftp/Specs/html-info/ 23401.htm.

[6] 3GPP TS 24.301 version 11.4.0 Release 11; Universal Mobile Telecommunica- tions System (UMTS); LTE; Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS); Stage 3. http://www.3gpp.org/ftp/Specs/html-info/ 24301.htm.

[7] 3GPP TS 33.102 version 11.4.0 Release 11; Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); LTE; 3G security; Security architecture . http://www.3gpp.org/ftp/Specs/ html-info/33102.htm.

[8] 3GPP TS 33.401 version 10.0.0 Release 10; Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); LTE; 3gpp System Architecture Evolution (SAE); Security architecture. http: //www.3gpp.org/ftp/Specs/html-info/33401.htm.

[9] The international telecommunication union. http://www.itu.int/en/ITU-D/ Statistics/Pages/facts/default.aspx.

[10] Wikipedia. http://www.wikipedia.org/. 176

[11] GSM 04.08 version 7.8.0 Release 1998; Digital cellular telecommunications sys- tem (Phase 2+); Mobile radio interface layer 3 specification, 1998.

[12] Mart´ınAbadi and Bruno Blanchet. Computer-assisted verification of a protocol for certified email. In Static Analysis, pages 316–335. Springer, 2003.

[13] Mart´ınAbadi, Bruno Blanchet, and Hubert Comon-Lundh. Models and proofs of protocol security: A progress report. In Computer Aided Verification, pages 35–49. Springer, 2009.

[14] Mart´ın Abadi, Bruno Blanchet, and C´edricFournet. Just fast keying in the pi calculus. In Programming Languages and Systems, pages 340–354. Springer, 2004.

[15] Mart´ınAbadi and Andrew D Gordon. A calculus for cryptographic protocols: The spi calculus. In Proceedings of the 4th ACM conference on Computer and communications security, pages 36–47. ACM, 1997.

[16] Zahra Ahmadian, Somayeh Salimi, and Ahmad Salahi. New attacks on UMTS network access. In Wireless Telecommunications Symposium, 2009. WTS 2009, pages 1–6. IEEE, 2009.

[17] Myrto Arapinis, Loretta Mancini, Eike Ritter, Mark Ryan, Nico Golde, Kevin Redon, and Ravishankar Borgaonkar. New privacy issues in mobile telephony: fix and verification. In Proceedings of the 2012 ACM conference on Computer and communications security, pages 205–216. ACM, 2012.

[18] Alessandro Armando. The high level protocol specification language, 2003.

[19] Alessandro Armando, David Basin, Yohan Boichut, Yannick Chevalier, Luca Compagna, Jorge Cu´ellar, P Hankes Drielsma, Pierre-Cyrille H´eam, Olga Kouchnarenko, Jacopo Mantovani, et al. The avispa tool for the automated validation of internet security protocols and applications. In Computer Aided Verification, pages 281–285. Springer, 2005.

[20] Alessandro Armando and Luca Compagna. Sat-based model-checking for security protocols analysis. volume 7, pages 3–32. Springer, 2008.

[21] Elad Barkan, Eli Biham, and Nathan Keller. Instant ciphertext-only cryptanaly- sis of gsm encrypted communication. In Advances in Cryptology-CRYPTO 2003, pages 600–616. Springer, 2003.

[22] Gilles Barthe, Benjamin Gr´egoire, Sylvain Heraud, and Santiago Zanella B´eguelin. Computer-aided security proofs for the working cryptographer. In Advances in Cryptology–CRYPTO 2011, pages 71–90. Springer, 2011. 177

[23] David Basin. Lazy infinite-state analysis of security protocols. In Secure Net- workingCQRE [Secure]99, pages 30–42. Springer, 1999. [24] David Basin, Sebastian M¨odersheim,and Luca Vigano. Ofmc: A symbolic model checker for security protocols. volume 4, pages 181–208. Springer, 2005. [25] Bruno Blanchet. An efficient cryptographic protocol verifier based on prolog rules. In IN 14TH IEEE COMPUTER SECURITY FOUNDATIONS WORK- SHOP (CSFW-14), pages 82–96. IEEE Computer Society Press, 2001. [26] Bruno Blanchet. A computationally sound mechanized prover for security pro- tocols. Dependable and Secure Computing, IEEE Transactions on, 5(4):193–207, 2008. [27] Bruno Blanchet. Automatic verification of correspondences for security protocols. Journal of Computer Security, 17(4):363–434, July 2009. [28] Bruno Blanchet and Avik Chaudhuri. Automated formal analysis of a protocol for secure file sharing on untrusted storage. In Security and Privacy, 2008. SP 2008. IEEE Symposium on, pages 417–431. IEEE, 2008. [29] Bruno Blanchet and Andreas Podelski. Verification of cryptographic protocols: Tagging enforces termination. In Foundations of Software Science and Compu- tation Structures, pages 136–152. Springer, 2003. [30] Bruno Blanchet and Ben Smyth. Proverif 2.0: Automatic cryptographic protocol verifier, user manual and tutorial, 2010. [31] Chiara Bodei, Mikael Buchholtz, Pierpaolo Degano, Flemming Nielson, and H Riis Nielson. Automatic validation of protocol narration. In Computer Se- curity Foundations Workshop, 2003. Proceedings. 16th IEEE, pages 126–140. IEEE, 2003. [32] Eduardo Bonelli, Adriana Compagnoni, and Elsa Gunter. Correspondence as- sertions for process synchronization in concurrent communications. Journal of Functional Programming, 15(2):219–247, 2005. [33] Mohamed Salah Bouassida, Najah Chridi, Isabelle Chrisment, Olivier Festor, and Laurent Vigneron. Automated verification of a key management architecture for hierarchical group protocols. 62(11-12):1365–1387, 2007. [34] Aaron R Bradley and Zohar Manna. The calculus of computation: decision procedures with applications to verification. Springer, 2007. [35] Mayla Brus´o,Konstantinos Chatzikokolakis, and Jerry Den Hartog. Formal verification of privacy for RFID systems. In Computer Security Foundations Symposium (CSF), 2010 23rd IEEE, pages 75–88. IEEE, 2010. 178

[36] Richard Chang and Vitaly Shmatikov. Formal analysis of authentication in bluetooth device pairing. page 45. Citeseer, 2007. [37] Liqun Chen and Mark Ryan. Attack, solution and verification for shared au- thorisation data in TCG TPM. In Formal Aspects in Security and Trust, pages 201–216. Springer, 2010. [38] John Andrew Clark and Jeremy Lawrence Jacob. A survey of authentication protocol literature: Version 1.0. 1997. [39] Edmund M Clarke, Orna Grumberg, and David E Long. Model checking and abstraction. ACM Transactions on Programming Languages and Systems (TOPLAS), 16(5):1512–1542, 1994. [40] Edmund M Clarke, Orna Grumberg, and Doron A Peled. Model checking. MIT Press, 1999. [41] Cas J.F. Cremers. The Scyther Tool: Verification, falsification, and analysis of security protocols. In CAV, volume 5123 of LNCS, pages 414–418, 2008. [42] Cas J.F. Cremers. Unbounded verification, falsification, and characterization of security protocols by pattern refinement. In CCS ’08: Proceedings of the 15th ACM conference on Computer and communications security, pages 119–128, New York, NY, USA, 2008. ACM. [43] Cas J.F. Cremers, Pascal Lafourcade, and Philippe Nadeau. Comparing state spaces in automatic protocol analysis. In Formal to Practical Security, volume 5458/2009 of Lecture Notes in Computer Science, pages 70–94. Springer, 2009. [44] Cas J.F. Cremers and Sjouke Mauw. Operational semantics of security proto- cols. In Scenarios: Models, Transformations and Tools, International Workshop, Dagstuhl, pages 66–89. Springer, 2005. [45] Cas J.F. Cremers and Sjouke MauW. Generalizing Needham-Schroeder-Lowe for multi-party authentication. Technical report, Eindhoven University of Technol- ogy, 2006. [46] Cas J.F. Cremers, Sjouke Mauw, and EP De Vink. Defining authentication in a trace model. In Fast, pages 131–145. Citeseer, 2003. [47] Cas J.F. Cremers, Sjouke Mauw, and Erik P de Vink. Injective synchronisation: an extension of the authentication hierarchy. Theoretical Computer Science, 367(1):139–161, 2006. [48] Scott Dawson, Farnam Jahanian, and Todd Mitton. ORCHESTRA: A fault injection environment for distributed systems. Ann Arbor, 1001:48109–2122, 1996. 179

[49] Leonardo de Moura, Sam Owre, and N. Shankar. The SAL Language Manual. SRI International, 2003.

[50] and Andrew Yao. On the security of public key protocols. Infor- mation Theory, IEEE Transactions on, 29(2):198–208, 1983.

[51] Orr Dunkelman, Nathan Keller, and . A practical-time related-key attack on the KASUMI cryptosystem used in GSM and 3G telephony. In Ad- vances in Cryptology–CRYPTO 2010, pages 393–410. Springer, 2010.

[52] Dan Forsberg, G¨unther Horn, Wolf-Dietrich Moeller, and Valtteri Niemi. LTE Security. John Wiley and Sons, Ltd, 2010.

[53] Dirk Fox. Der IMSI catcher. In DuD Datenschutz und Datensicherheit, 2002.

[54] Nico Golde, K´evinRedon, and Jean-Pierre Seifert. Let me answer that for you: Exploiting broadcast information in cellular networks. In Proceedings of the 22nd USENIX Security Symposium, pages 33–48, 2013.

[55] Shafi Goldwasser and . Probabilistic encryption. Journal of Com- puter and System Sciences, 28(2):270–299, 1984.

[56] Jovan Dj. Golic. Cryptanalysis of alleged a5 stream cipher. In EUROCRYPT, 1997.

[57] Jovan Dj Goli´c. Cryptanalysis of alleged a5 stream cipher. In Advances in CryptologyEUROCRYPT97, pages 239–255. Springer, 1997.

[58] Andrew D Gordon and Alan Jeffrey. Authenticity by typing for security proto- cols. Journal of computer security, 11(4):451–519, 2003.

[59] C Han and H Choi. Security analysis of handover key management in 4G LTE/SAE network. 2012.

[60] Seungjae Han, Kang G Shin, and Harold A Rosenberg. DOCTOR: An integrated software fault injection environment for distributed real-time systems. pages 204– 213, 1995.

[61] James Heather, Gavin Lowe, and Steve Schneider. How to prevent type flaw attacks on security protocols. Journal of Computer Security, 11(2):217–244, 2003.

[62] Gunnar Heine and Matt Horrer. GSM Networks: Protocols, Terminology, and Implementation. Artech House, January 1999.

[63] Michael Huth and Mark Ryan. Logic in Computer Science: Modelling and Rea- soning about Systems. Cambridge University Press, 2004. 180

[64] Markus Jakobsson and Susanne Wetzel. Security weaknesses in bluetooth. In Topics in CryptologyCT-RSA 2001, pages 176–191. Springer, 2001.

[65] Georgios Kambourakis, Constantinos Kolias, Stefanos Gritzalis, and Jong Hyuk- Park. Signaling-oriented dos attacks in umts networks. In Advances in Informa- tion Security and Assurance, pages 280–289. Springer, 2009.

[66] Muzammil Khan, Attiq Ahmed, and Ahmad Raza Cheema. Vulnerabilities of umts access domain security architecture. In Software Engineering, Artificial Intelligence, Networking, and Parallel/Distributed Computing, 2008. SNPD’08. Ninth ACIS International Conference on, pages 350–355. IEEE, 2008.

[67] Steve Kremer and Mark Ryan. Analysis of an electronic voting protocol in the applied pi calculus. In Programming Languages and Systems, pages 186–200. Springer, 2005.

[68] Ming-Feng Lee, Nigel P Smart, Bogdan Warinschi, and Gaven J Watson. Anonymity guarantees of the UMTS/LTE authentication and connection pro- tocol. IACR Cryptology ePrint Archive, 2013:27, 2013.

[69] Patrick PC Lee, Tian Bu, and Thomas Woo. On the detection of signaling dos attacks on 3g wireless networks. In INFOCOM 2007. 26th IEEE International Conference on Computer Communications. IEEE, pages 1289–1297. IEEE, 2007.

[70] Sun-Hee Lim, Ki-Seok Bang, Okyeon Yi, and Jongin Lim. A secure handover protocol design in wireless networks with formal verification. In Wired/Wireless Internet Communications, pages 67–78. Springer, 2007.

[71] Gavin Lowe. Breaking and fixing the Needham-Schroeder public-key protocol us- ing FDR. In Tools and Algorithms for the Construction and Analysis of Systems, pages 147–166. Springer, 1996.

[72] Gavin Lowe. Casper: A compiler for the analysis of security protocols. Journal of computer security, 6(1):53–84, 1998.

[73] Catherine Meadows. Formal verification of cryptographic protocols: A survey. In Josef Pieprzyk and Reihaneh Safavi-Naini, editors, ASIACRYPT, volume 917 of Lecture Notes in Computer Science, pages 135–150. Springer, 1994.

[74] Catherine Meadows. Language generation and verification in the NRL protocol analyzer. In Computer Security Foundations Workshop, 1996. Proceedings., 9th IEEE, pages 48–61. IEEE, 1996.

[75] Catherine Meadows. The NRL protocol analyzer: An overview. The Journal of Logic Programming, 26(2):113–131, 1996. 181

[76] Ulrike Meyer. Secure Roaming and Handover Procedures in Wireless Access Networks. PhD thesis, Darmstadt University of Technology, Germany, 2005.

[77] Ulrike Meyer and Susanne Wetzel. A man-in-the-middle attack on UMTS. In Proceedings of the 3rd ACM workshop on Wireless security, pages 90–97. ACM, 2004.

[78] Ulrike Meyer and Susanne Wetzel. On the impact of GSM encryption and man- in-the-middle attacks on the security of interoperating GSM/UMTS networks. In Personal, Indoor and Mobile Radio Communications, 2004. PIMRC 2004. 15th IEEE International Symposium on, volume 4, pages 2876–2883. IEEE, 2004.

[79] Mojtaba Ayoubi Mobarhan, Mostafa Ayoubi Mobarhan, and Asadollah Shah- bahrami. Evaluation of security attacks on UMTS authentication mechanism. International Journal of Network Security & Its Applications, 4(4), 2012.

[80] Anderson Morais, Eliane Martins, and Ana Cavalli. Generating attack scenarios for the validation of security protocol implementations. In The 2nd Brazilian Workshop on Systematic and Automated Software Testing, 2008.

[81] Anderson Morais, Eliane Martins, Ana Cavalli, and Willy Jimenez. Security protocol testing using attack trees. In Computational Science and Engineering, 2009. CSE’09. International Conference on, volume 2, pages 690–697. IEEE, 2009.

[82] Flemming Nielson, Hanne Riis Nielson, and Helmut Seidl. A succinct solver for ALFP. Nordic Journal of Computing, 9(4):335–372, 2002.

[83] M Peters and P Rogaar. A review of proverif as an automatic security protocol verifier, 2011.

[84] Slobodan Petrovic and Amparo Fuster-Sabater. Cryptanalysis of the A5/2 algo- rithm. IACR Cryptology ePrint Archive, 2000:52, 2000.

[85] Ahmed M Taha, Amr T Abdel-Hamid, and Sofiene Tahar. Formal analysis of the handover schemes in mobile WiMAX networks. In Wireless and Optical Communications Networks, 2009. WOCN’09. IFIP International Conference on, pages 1–5. IEEE, 2009.

[86] Ahmed M Taha, Amr T Abdel-Hamid, and Sofi`eneTahar. Formal verification of IEEE 802.16 security sublayer using Scyther tool. In Network and Service Security, 2009. N2S’09. International Conference on, pages 1–5. IEEE, 2009.

[87] Chunyu Tang, David A Naumann, and Susanne Wetzel. Symbolic analysis for security of roaming protocols in mobile networks. In Security and Privacy in Communication Networks, pages 480–490. Springer, 2012. 182

[88] The AVISPA Team. AVISPA v1.1 user manual, 2006.

[89] Joe-Kai Tsay and Stig F Mjølsnes. A vulnerability in the UMTS and LTE authentication and key agreement protocols. In Computer Network Security, pages 65–76. Springer, 2012.

[90] Mathieu Turuani. The CL-Atse protocol analyser. In Term Rewriting and Ap- plications, pages 277–286. Springer, 2006.

[91] David von Oheimb and Jorge Cuellar. Designing and verifying core protocols for location privacy. In Information Security, pages 502–516. Springer, 2006.

[92] Thomas YC Woo and Simon S Lam. A semantic model for authentication pro- tocols. In Research in Security and Privacy, 1993. Proceedings., 1993 IEEE Computer Society Symposium on, pages 178–194. IEEE, 1993.

[93] Muxiang Zhang and Yuguang Fang. Security analysis and enhancements of 3gpp authentication and key agreement protocol. Wireless Communications, IEEE Transactions on, 4(2):734–742, 2005.

[94] 3GPP The mobile broadband standard. http://www.3gpp.org/ specifications. 183

Vita

Chunyu Tang Address 404 Madison St Apt 3, Hoboken, NJ 07030 Education Stevens Institute of Technology, Hoboken, NJ Doctoral Candidate in Computer Science expected date of graduation, Dec 2013 Peking University, , Master in Software Engineering, 2005 Northeastern University, Shenyang, China Bachelor in Mechanical Engineering, 2001 Industrial Techfaith Wireless, Beijing, China Experience Lead Senior Developer (2005-2007) Designed the touch screen module for cellphones from scratch Led a team of 5 in implementing and maintaining the touch screen module Designed memory card detection mechanism IBM, Beijing, China (Intern 2004-2005) Investigated the security of the Workplace Client Technology Classified the Universal Network Objects APIs into three levels according to the severity of possible attacks Implemented the security mechanism by auditing the called APIs Publications Chunyu Tang, David A. Naumann, and Susanne Wetzel Symbolic Analysis for Security of Roaming Protocols in Mobile Networks 7th International ICST Conference on Security and Privacy in Communication Networks Chunyu Tang, David A. Naumann, and Susanne Wetzel Analysis of authentication and key establishment in inter-generational mobile telephony The Fourth IEEE International Symposium on Trust, Security and Privacy for Emerging Applications (TSP-13) Honors Member of Upsilon Pi Epsilon (Computer Science Honor Society) IEEE student member, ACM student member