# 5G-IPAKA: An Improved Primary Authentication and Key Agreement Protocol for 5G Networks
## 3 Shortcomings of the 5G AKA Protocol  
According to the analysis of the above 5G AKA protocol, there are still some shortcomings in the latest version of the 5G AKA protocol, as follows:  
* \(\mathit{SUC1}\) **can be replayed without being found. ** The \(\mathit{HN}\) cannot find out whether \(\mathit{SUC1}\) is a replayed message because \(\mathit{SUC1}\) does not contain the challenge of the \(\mathit{HN}\). Similarly, the \(\mathit{UE}\) cannot find out whether \(\mathit{SUC1}\) is a replayed message because \(\mathit{AUTN}\) does not contain the challenge of the \(\mathit{UE}\) (i.e., \(x\)), which is included in \(\mathit{SUC1}\) generated by the \(\mathit{UE}\);
* **Mutual authentication between the \(\mathit{UE}\) and the \(\mathit{SN}\) cannot be established. ** The \(\mathit{UE}\) cannot authenticate the \(\mathit{SN}\) because \(\mathit{AUTN}\) does not contain \(\mathit{SNN}\). Similarly, the \(\mathit{SN}\) cannot authenticate the \(\mathit{UE}\) for the following three reasons. Firstly, the \(\mathit{SN}\) does not verify \(\mathit{SUC1}\), \(\mathit{AUTN}\), \(\mathit{HXRES}*\), \(\mathit{RES}*\), and \(\mathit{AUTS}\). Secondly, the second received message of the \(\mathit{SN}\) does not contain \(\mathit{SUPI}\) to match with \(\mathit{SUC1}\) in the first received message of the \(\mathit{SN}\). Finally, the last received message of the \(\mathit{SN}\) does not contain \(\mathit{RAND}\), meaning that \(\mathit{SUPI}\) in the last received message of the \(\mathit{SN}\) cannot match with the \(\mathit{UE}\) identity in \(\mathit{AUTN}\) and \(\mathit{HXRES}*\), which are included in the second received message of the \(\mathit{SN}\);
* \(K_{\mathit{SEAF}}\) **cannot reach an agreement. ** The last received message of the \(\mathit{SN}\) does not contain \(\mathit{RAND}\), so this message can be a replayed message, meaning that \(K_{\mathit{SEAF}}\) on the \(\mathit{SN}\) is not equal to \(K_{\mathit{SEAF}}\) on the \(\mathit{HN}\). As a result, \(K_{\mathit{SEAF}}\) on the \(\mathit{SN}\) is not equal to \(K_{\mathit{SEAF}}\) on the \(\mathit{UE}\);
* **The location privacy of the \(\mathit{UE}\) can be compromised. ** Because \(\mathit{AUTN}\) does not contain the challenge of the \(\mathit{UE}\) (i.e., \(x\)), the first received message of the \(\mathit{UE}\) can be a replayed message. If \(\mathit{SQN}\subset\mathit{AUTN}\) is in the correct range, then the location of the \(\mathit{UE}\) can be compromised by reidentifying \(\mathit{RES}*\). If \(\mathit{SQN}\subset\mathit{AUTN}\) is not in the correct range, then the location privacy of the \(\mathit{UE}\) can be compromised by identifying the \"synchronization failure\" indication; that is to say, when the first received message of the \(\mathit{UE}\) is replayed, the legitimate \(\mathit{UE}\) response is \(\mathit{RES}*\) or a \"synchronization failure\" indication, but any other \(\mathit{UE}\) response is a \"\(\mathit{MAC}\) failure\" indication. As a result, the location privacy of the legitimate \(\mathit{UE}\) can be compromised;
* **DoS attacks against the \(\mathit{SN}\) can be formed. ** Because the received messages of the \(\mathit{SN}\) does not contain the challenge of the \(\mathit{SN}\), these messages can be replayed messages. As a result, the penetrator can imperonate the \(\mathit{UE}\) and the \(\mathit{HN}\) to complete the entire 5G AKA protocol with the \(\mathit{SN}\), forming DoS attacks against the \(\mathit{SN}\);* **Attacks based on _MAC_ failure can be performed. ** Firstly, the penetrator can forge or tamper with the first received message of the _UE_ to make the _UE_ respond to a \"_MAC_ failure\" indication, resulting in authentication failure. Secondly, the penetrator can directly send a \"_MAC_ failure\" indication to the _SN_ to cause authentication failure. Finally, the penetrator can also replay a \"_MAC_ failure\" indication between the _SN_ and the _HN_ to cause authentication failure;
* **Perfect forward secrecy cannot be provided.