ticular integrity algorithm, as well as KNASenc which is a key that is used for the protection of NAS signaling with a particular encryption algorithm. Keys for user-plane traffic include KUPenc, which is a key that is used for the protection of user-plane traffic with a particular encryption algorithm, as well as KUPint which is a key that is used for the protection of user-plane traffic between mobile equipment and gNB with a particular integrity algorithm. Keys for RRC signaling include KRRCint which is a key that is used for the protection of RRC signaling with a particular integrity algorithm, as well as KRRCenc which is a key that is used for the protection of RRC signaling with a particular encryption algorithm. Intermediate keys include next hop (NH), which is a key that is derived by mobile equipment and AMF to provide forward security as well as KgNB* which is a key that is derived by mobile equipment and gNB when performing a horizontal or vertical key derivation. When a UE obtains services in RRC idle mode, it does not validate the eNB, which may result in camping on a wrong base station, ultimately leading to denial of service attack. In current LTE systems, the RAN security has been focused on RRC_CONNECTED state, which has been improved in 5G security framework. The purpose of the primary authentication and key agreement procedures is to enable mutual authentication between the UE and the network and to provide key derivation mate- rial that can be used between the UE and network in subsequent security procedures. The keying material generated by the primary authentication and key agreement procedure results in an anchor key called the KSEAF provided by the AUSF to SEAF. Keys for more than one security context can be derived from the KSEAF with no need for a new authentication. In 5G systems, the storage of credentials and identities for both human and machine type devices is required in the UE. The credentials and identities can be stolen through hard- ware/software attacks. Such security threats 