5G provides a unified authentication architecture and access management for IoT(Internet of Things)devices.But existing authentication services cannot cover massive IoT devices with various computing capabilities.In addition,with the devel-opment of quantum computing,authentication schemes based on traditional digital signature technology may not be as secure as we expected.This paper studies the authentication mechanism from the user equipment to the external data network in 5G and pro-posed an authentication protocol prototype that conforms to the Third Generation Partnership Program(3GPP)standard.This pro-totype can accommodate various Hash-based signature technolo-gies,applying their advantages in resource consumption to meet the authentication requirements of multiple types of IoT devices.The operation of the proposed authentication scheme is mainly based on the Hash function,which is more efficient than the tradi-tional authentication scheme.It provides flexible and high-quality authentication services for IoT devices cluster in the 5G environ-ment combining the advantages of Hash-based signature technol-ogy and 5G architecture.