With the popularization of internet devices and 5G technology, the Internet of Things has become one of the most popular technologies today. However, the massive amount of data generated by various intelligent devices is one of the biggest problems in IoT scenarios. In order to solve the problems of data theft and network congestion in large-scale IoT, scholars have quickly studied authentication technologies in IoT and 5G environments. However, there is currently no achievement that combines data security and low transmission latency. In this study, we propose an authentication scheme based on a combination of IoT architecture and 5G servers. To solve the problem of excessive authentication overhead caused by massive terminal access to the network, we adopt lightweight encryption modules such as one-way hash functions and XOR operations. This reduces the computational burden and makes the proposed authentication scheme suitable for objects with limited resources, such as sensors or IoT devices.