## 2 Overviews of Both the 5G AKA Protocol and the 5G-IPAKA Protocol
### The 5G AKA Protocol
The AUSF generates a 5G AV from the 5G HE AV received from the UDM/ARPF by computing \(HXRES^{*}\) from \(XRES^{*}\), computing \(K_{SEAF}\) from \(K_{AUSF}\), replacing \(XRES^{*}\) with \(HXRES^{*}\), and replacing \(K_{AUSF}\) with \(K_{SEAF}\) in the 5G HE AV, where \(HXRES^{*}=SHA256(RAND||XRES^{*})\), \(K_{SEAF}=KDF(K_{AUSF},SNN)\), and \(SHA256()\) is a hash function. 9. The ASUF creates a 5G serving environment authentication vector (5G SE AV) by removing \(K_{SEAF}\) from the 5G AV, then sends the 5G SE AV (i.e., \(RAND\), \(AUTN\), and \(HXRES^{*}\)) to the SEAF. 10. The SEAF stores \(HXRES^{*}\), and then sends \(RAND\), \(AUTN\), \(ngKSI\), and \(ABBA\) to the UE. Here, \(ngKSI\) is used by the UE and the access and mobility management function (AMF) to identify the \(K_{AMF}\) and the partial native security context that is created if the authentication is successful. \(ABBA\) denotes the anti-bidding down between architecture (ABBA) parameter. 11. In the UE, the ME forwards \(RAND\) and \(AUTN\) to the USIM. Upon receipt of \(RAND\) and \(AUTN\), the USIM first computes the anonymous key \(AK\) and retrieves the sequence number \(SQN=(SQN\oplus AK)\oplus AK\). Next, the USIM computes \(XMAC=f_{1}(K,SQN||RAND||AMF)\) and compares this with \(MAC\), which is included in \(AUTN\). Then, the USIM verifies that the received \(SQN\) is in the correct range. If \(XMAC\) is the same as \(MAC\) and \(SQN\) is in the correct range, then the USIM computes a response \(RES=f_{2}(K,RAND)\), \(CK\) and \(IK\), and then returns \(RES\), \(CK\), and \(IK\) to the ME. The ME then computes \(RES^{*}=KDF(CK||IK,SNN||RAND||RES)\), \(K_{AUSF}\) and \(K_{SEAF}\). * The UE sends \(RES^{*}\) to the SEAF. * The SEAF computes \(HRES^{*}=SHA256(RAND||RES^{*})\) and compares this with \(HXRES^{*}\). If they coincide, then the SEAF considers that the authentication is successful from the serving network point of view; if not, then the SEAF considers that the authentication is unsuccessful. * The SEAF sends the received \(RES^{*}\) to the AUSF. * The AUSF compares the received \(RES^{*}\) with the stored \(XRES^{*}\). If \(RES^{*}\) and \(XRES^{*}\) are equal, then the AUSF considers that the authentication is successful from the home network point of view. Then, the AUSF informs the UDM of the authentication result. * The AUSF indicates to the SEAF whether the authentication was successful or not from the home network point of view (i.e., \(Result\)). If the authentication was successful, then the ASUF also sends \(K_{SEAF}\) and \(SUPI\) to the SEAF. In step 11, if \(XMAC\) and \(MAC\) are different, then the USIM indicates to the ME a MAC failure of \(AUTN\). Then, the UE sends a \"MAC failure\" indication to the SEAF. Further, the SEAF sends the \"MAC failure\" indication to the AUSF. Finally, the ASUF sends the \"MAC failure\" indication to the UDM/ARPF. In step 11, if \(SQN\) is not in the correct range, then the USIM computes \(AUTS=SQN_{UE}\oplus AK^{*}||MAC-S\), and sends \(AUTS\) with a \"Synchronization failure\" indication to the ME, where \(SQN_{UE}\) denotes the highest sequence number the USIM has accepted, \(AK^{*}=f_{5}^{*}(K,RAND)\), \(MAC-S=f_{1}^{*}(K,SQN_{UE}||RAND||AMF_{0})\), \(AMF_{0}\) is a dummy value of all zeros, \(f_{1}^{*}()\) is a message authentication function, and \(f_{5}^{*}()\) is a key-generating function. Then, the UE sends \(AUTS\) with a \"Synchronization failure\" indication to the SEAF. Further, the SEAF sends \(RAND\) and \(AUTS\) with a \"Synchronization failure\" indication to the AUSF. Finally, the ASUF sends \(RAND\) and \(AUTS\) with a \"Synchronization failure\" indication to the UDM/ARPF. According to the analysis of the above 5G AKA protocol, there are still some shortcomings in the latest version of the 5G AKA protocol [28], as follows:  
* \(SUCI\) can be replayed without being found. The HN cannot find whether \(SUCI\) is a replayed message because \(SUCI\) does not contain the challenge of the HN.