Authentication method and storage medium for IoT devices
Through registration and key sharing between IoT devices and servers, the problem of high authentication costs for IoT devices is solved, secure communication and simple authentication between devices are achieved, and the use of digital certificates is avoided.
Patent Information
- Application Number
- CN202310974134.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-08-03
AI Technical Summary
Existing IoT devices require digital certificates for identity authentication during the communication process, resulting in high cost and complexity of authentication, especially as the number of devices increases, requiring a large amount of expenditure.
Through registration between IoT devices and servers, device verification number information is obtained, and keys are shared through mutual verification to achieve identity authentication and secure communication, avoiding the need to set up digital certificates on each device.
It reduces the certification cost of IoT devices, simplifies certification operations, enables secure communication between devices, reduces reliance on digital certificates, and improves communication security.
Smart Images

Figure CN117040825B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to an authentication method and storage medium for an Internet of Things device. Background Art
[0002] As people's lives become more and more intelligent, various IoT devices have emerged. Before IoT devices communicate, they need to be authenticated to improve the security of IoT devices during the communication process. In related technologies, the secure communication channel method for IoT devices often requires IoT devices to have digital certificates to complete identity authentication through digital certificates. Digital certificates are issued by CA organizations and require payment every year, which increases the authentication cost of IoT devices. Moreover, with the increase in the number of IoT devices, if each IoT device needs to install a digital certificate, it will bring a lot of expenses. Therefore, how to reduce the cost of IoT device identity authentication and make IoT device authentication simple has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an authentication method and storage medium for an IoT device, aiming to reduce the cost of IoT device authentication and make IoT device authentication easier.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes an authentication method for an Internet of Things device, which is applied to the Internet of Things device, and the method includes:
[0005] Register with the server to obtain device verification number information;
[0006] Sending the device verification number information and the preset first encrypted data to the server, so that the server authenticates the IoT device according to the first encrypted data and the device verification number information to obtain first device identity authentication information;
[0007] If the first device identity authentication information is successfully verified, receiving first verification data fed back by the server;
[0008] Performing identity authentication on the server according to the first authentication data to obtain server identity authentication information;
[0009] If the server identity authentication information is successfully authenticated, generate and send second authentication data to the server so that the server authenticates the IoT device according to the second authentication data to obtain second device identity authentication information;
[0010] If the second device identity authentication information is successfully verified, the key is shared with the server.
[0011] In some embodiments, the first encrypted data is a first random number; the first verification data includes: a second random number and a first hash data; and the authentication of the server according to the first verification data to obtain the server authentication information includes:
[0012] Perform hash value calculation according to the first random number and the second random number to obtain second hash data;
[0013] The first hash data and the second hash data are compared to obtain the server identity authentication information.
[0014] In some embodiments, registering with the server to obtain device verification number information includes:
[0015] Sending a registration request to the server, so that the server generates candidate verification number information according to the registration request;
[0016] receiving the candidate verification number information sent by the server, and generating a third random number, a fifth random number and a sixth random number, and generating a fourth random number according to the third random number and the fifth random number;
[0017] Encrypting the fifth random number, the sixth random number and the candidate verification number information according to a preset public key to obtain third encrypted data;
[0018] Sending the third encrypted data to the server, so that the server authenticates the IoT device according to the third encrypted data to obtain first registration verification information;
[0019] If the first registration verification information is successfully verified, receiving an eighth random number and fifth hash data sent by the server;
[0020] Verifying the server according to the eighth random number and the fifth hash data to obtain second registration verification information;
[0021] If the second registration verification information is successfully verified, the candidate verification number information is used as the device verification number information.
[0022] In some embodiments, the verifying the server according to the eighth random number and the fifth hash data to obtain the second registration verification information includes:
[0023] Performing hash value calculation based on the eighth random number and the sixth random number to obtain sixth hash data;
[0024] The fifth hash data and the sixth hash data are compared to obtain the second registration verification information.
[0025] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes an authentication method for an IoT device, which is applied to a server. The method includes:
[0026] Registering an IoT device to generate device verification number information, and sending the device verification number information to the IoT device;
[0027] Receive the device verification number information and the first encrypted data sent by the IoT device, and authenticate the IoT device according to the device verification number information and the first encrypted data to obtain the first device identity authentication information, and generate the first verification data;
[0028] If the first device identity authentication information is successfully authenticated, the first authentication data is sent to the IoT device, so that the IoT device authenticates the server according to the first authentication data to obtain server identity authentication information;
[0029] If the server identity authentication information is successfully verified, receiving second verification data sent by the IoT device;
[0030] Performing identity authentication on the IoT device according to the second authentication data to obtain second device identity authentication information;
[0031] If the second device identity authentication information is successfully verified, the key is shared with the IoT device.
[0032] In some embodiments, the first verification data includes: a second random number and a first hash data; the receiving device verification number information and the first encrypted data sent by the IoT device, and authenticating the IoT device according to the device verification number information and the first encrypted data to obtain the first device authentication information, and generating the first verification data includes:
[0033] The first encrypted data is decrypted according to the preset private key to obtain the first random number and the device verification number information.
[0034] Compare the device to-be-verified number information with the device verification number information to obtain the first device identity verification information;
[0035] A second random number is randomly generated, and a hash value is calculated according to the first random number and the second random number to obtain the first hash data.
[0036] In some embodiments, the second verification data is third hash data; wherein the third hash data is obtained by randomly generating a third random number by the IoT device, generating a fifth random number based on the third random number and a pre-generated fourth random number, and performing a hash value calculation based on the fifth random number and the second random number; the second device identity authentication information is obtained by authenticating the IoT device according to the second verification data, including:
[0037] Perform hash value calculation based on the fifth random number received in advance and the second random number to obtain fourth hash data;
[0038] The third hash data and the fourth hash data are compared to obtain the second device identity authentication information.
[0039] In some embodiments, registering the IoT device to generate device verification number information, and sending the device verification number information to the IoT device, includes:
[0040] Receive a registration request sent by the IoT device, and generate candidate verification number information according to the registration request;
[0041] sending the candidate verification number information to the IoT device, and receiving third encrypted data;
[0042] Decrypting the third encrypted data according to a preset private key to obtain a fifth random number, a sixth random number and candidate verification number information;
[0043] Compare the candidate to-be-verified number information with the candidate verification number information to obtain third verification information;
[0044] If the third verification information is successfully verified, generate a seventh random number, and perform a hash value calculation based on the seventh random number and the sixth random number to obtain fifth hash data;
[0045] Sending the fifth hash data and the seventh random number to the IoT device, so that the IoT device performs hash value calculation according to the seventh random number and the sixth random number to obtain sixth hash data, and compares the fifth hash data with the sixth hash data to obtain registration verification information;
[0046] If the registration verification information is successfully verified, the candidate verification number information is used as the device verification number information, and the device verification number information is sent to the Internet of Things device.
[0047] To achieve the above purpose, a third aspect of an embodiment of the present application proposes an authentication method for an IoT device, the method comprising:
[0048] The IoT device registers with the server to obtain device verification number information;
[0049] The IoT device sends the device verification number information and the preset first encrypted data to the server, and the server authenticates the IoT device according to the first encrypted data to obtain first device identity authentication information;
[0050] If the first device identity authentication information is successfully verified, the server generates and sends first verification data to the IoT device;
[0051] The IoT device authenticates the server according to the first authentication data to obtain server authentication information;
[0052] If the server identity authentication information is successfully authenticated, generating and sending second authentication data to the server;
[0053] The server performs identity authentication on the IoT device according to the second verification data to obtain second device identity authentication information;
[0054] If the second device identity authentication information is successfully verified, the IoT device shares a key with the server.
[0055] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect, the second aspect, or the third aspect.
[0056] The authentication method and storage medium of the IoT device proposed in this application obtains the device verification number information through the registration of the IoT device and the server, and the IoT device and the server perform mutual verification, so as to share the key with each other after the verification is successful. Therefore, by enabling the IoT device and the server to automatically authenticate their identities and then share the key, the IoT devices of the server can communicate securely, and the authentication operation between the IoT devices is simple, and there is no need to set up digital certificates to save costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flow chart of the authentication method of the Internet of Things device provided by the embodiment of the present application;
[0058] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0059] Figure 3 yes Figure 2 Flow chart of step S206 in FIG.
[0060] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.
[0061] Figure 5 It is a flow chart of the authentication method of the Internet of Things device provided by the embodiment of the present application;
[0062] Figure 6 yes Figure 5 Flow chart of step S501 in FIG.
[0063] Figure 7 yes Figure 5 Flow chart of step S502 in FIG.
[0064] Figure 8 yes Figure 5 Flow chart of step S505 in FIG.
[0065] Fig. 9 It is a flow chart of the authentication method of the Internet of Things device provided by the embodiment of the present application;
[0066] Fig.10 It is a detailed flow chart of IoT device registration in the IoT device authentication method provided in the embodiment of the present application;
[0067] Fig.11 It is a detailed flow chart of authentication and key sharing between an IoT device and a server in an authentication method for an IoT device provided in an embodiment of the present application;
[0068] Fig.12 It is a module block diagram of the Internet of Things device provided in the embodiment of the present application;
[0069] Fig.13 This is a module block diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0073] First, some nouns involved in this application are analyzed:
[0074] Public key encryption: Public key encryption is another type of encryption algorithm. The encryption key used in the encryption process is different from the key used in the decryption process. The encryption key is generally public, so the key is called a public key. The encryption algorithm and decryption algorithm are usually denoted as (Enc, Dec), respectively; the key pair is denoted as (pk, sk), where pk is the public key used for encryption and sk is the private key used for decryption; the process of encrypting a message m with pk to obtain a ciphertext c is denoted as c←Enc(pk, m); the process of decrypting a ciphertext c with sk to obtain a message m is denoted as m←Dec(sk, c).
[0075] Cryptographic hash function: used to calculate the hash value in the scheme, we denote it as h, and assume that the output of h is l bits.
[0076] Physical Unclonable Function (PUF): is a hardware security technology that uses inherent device variations to produce a unique device response to a given input that cannot be cloned. Simply put, each device's PUF generates the same random value every time.
[0077] True random number generator (TRNG): A random number generator generates a random number of fixed length each time. A true random number generator (TRNG) refers to a random number generator that is implemented using physical methods.
[0078] Establishing a secure communication channel between authenticated IoT devices is crucial in IoT applications. If two IoT devices can authenticate each other and share a random session key, it is easy to establish a secure communication channel between the two IoT devices.
[0079] In related technologies, the communication method of IoT devices often requires the IoT devices to have digital certificates. However, digital certificates need to be issued by CA organizations after annual payment, and the price of each digital certificate is relatively high. As the number of IoT devices increases, the need for digital certificates also increases accordingly, resulting in a large amount of expenditure for IoT systems.
[0080] Based on this, the embodiment of the present application provides an authentication method and storage medium for an IoT device, which aims to obtain device verification number information through registration of the IoT device and the server, so that the IoT device and the server can perform mutual verification based on the device verification number information, and then share the key with each other after the verification is successful. Therefore, by enabling the IoT device and the server to automatically authenticate their identities and then share the key, the IoT devices connected through a server can communicate securely, making the authentication operation between IoT devices simple, without the need to set up digital certificates, and saving costs.
[0081] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0082] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0083] The authentication method for an Internet of Things device provided in the embodiment of the present application relates to the technical field of the Internet of Things. The authentication method for an Internet of Things device provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the authentication method for an Internet of Things device, etc., but is not limited to the above forms.
[0084] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0085] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0086] Figure 1 is an optional flowchart of the authentication method for an Internet of Things device provided in an embodiment of the present application, and Figure 1 The authentication method of the IoT device in is applied to the IoT device. Figure 1 The method may include but is not limited to steps S101 to S106.
[0087] Step S101, register with the server to obtain device verification number information;
[0088] Step S102, sending the device verification number information and the preset first encrypted data to the server, so that the server performs identity authentication on the IoT device according to the first encrypted data and the device verification number information to obtain first device identity authentication information;
[0089] Step S103, if the first device identity authentication information is successfully authenticated, receiving first authentication data fed back by the server;
[0090] Step S104, performing identity authentication on the server according to the first authentication data to obtain server identity authentication information;
[0091] Step S105, if the server identity verification information is successfully verified, generate and send second verification data to the server so that the server can authenticate the IoT device according to the second verification data to obtain second device identity verification information;
[0092] Step S106: If the second device identity authentication information is successfully authenticated, the key is shared with the server.
[0093] In steps S101 to S106 shown in the embodiment of the present application, the IoT device registers with the server to obtain the device verification number information, and the IoT device then sends the first encrypted data and the device verification number to the server, so that the server authenticates the IoT device according to the first encrypted data and the device verification number information to obtain the first device identity authentication information. If the first device identity authentication information is successfully verified, the IoT device receives the first verification data fed back by the server, and the first verification data is used as reference data for the IoT device to verify the server. The IoT device authenticates the server according to the first verification data to obtain the server identity authentication information. If the server identity authentication information is successfully verified, the IoT device generates the second verification data and sends the second verification data to the server, so that the server authenticates the IoT device according to the second verification data to obtain the second device identity authentication information. If the second device identity authentication information is successfully verified, the IoT device and the server share a key. Therefore, by automatically performing identity authentication between the IoT device and the server and then sharing the key, there is no need to set up a digital certificate on each IoT device for identity authentication, which reduces the cost of IoT device authentication and makes IoT device authentication operation easier.
[0094] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S206:
[0095] Step S201, sending a registration request to a server, so that the server generates candidate verification number information according to the registration request;
[0096] Step S202, receiving candidate verification number information sent by the server, and generating a third random number, a fifth random number and a sixth random number, and generating a fourth random number according to the third random number and the fifth random number;
[0097] Step S203, encrypting the fifth random number, the sixth random number and the candidate verification number information according to a preset public key to obtain third encrypted data;
[0098] Step S204, sending the third encrypted data to the server, so that the server authenticates the IoT device according to the third encrypted data to obtain first registration verification information;
[0099] Step S205, if the first registration verification information is successfully verified, receiving the eighth random number and the fifth hash data sent by the server;
[0100] Step S206, verifying the server according to the eighth random number and the fifth hash data to obtain second registration verification information;
[0101] Step S207: If the second registration verification information is successfully verified, the candidate verification number information is used as the device verification number information.
[0102] In step S201 of some embodiments, the registration request is a request generated when the IoT device needs to register with the server, and the registration request contains at least a unique identifier, which is used to indicate the network card address, and the network card address is the address of the server. When the IoT device needs to be connected to the Internet, the IoT device generates a registration request based on user manipulation, and sends the registration request to the server, so that the server assigns a candidate verification number information to the IoT device based on the registration request, and each candidate verification number information assigned to the IoT device is independent and unique number information, so the IoT device and the server can make accurate authentication based on the candidate verification number information. For example, the candidate verification number information is NODEV, and the candidate verification number information can be a number, a string, etc. In this embodiment, there is no specific restriction on the content of the candidate verification number information.
[0103] It should be noted that the IoT device is equipped with a physical unclonable function, a true random number generator, a computing unit, and a storage unit. The server is a server deployed in the background, and the server and the IoT device are connected in communication. The IoT device stores the public key of the server, and the server stores a key pair for encryption and decryption, and the key pair includes a public key and a private key.
[0104] In step S202 of some embodiments, after the IoT device receives the candidate verification number information, the IoT device generates a third random number using a physical non-cloning function, and generates a fifth random number and a sixth random number using a true random number generator. After the third random number, the fifth random number, and the sixth random number are generated, a bit-by-bit XOR operation is performed on the third random number and the sixth random number to obtain a fourth random number.
[0105] It should be noted that the IoT device generates the same random number each time according to the physical unclonable function, so no matter when the random number generated by the IoT device using the IoT unclonable function is equal to the third random number.
[0106] For example, see Fig.10 , the physical non-cloning function is PUF, and the true random number generator is TRNG; the third random number generated by PUF is p0, and the fifth and sixth random numbers are generated by TRNG as k0 and r0, and the fourth random number is obtained by cross-calculating the third and sixth random numbers as q0=p0⊕k0. The bit lengths of the third random number p0 and the fifth random number k0 are equal. If they are not equal, an interception action is required to make the third random number p0 and the fifth random number k0 equal.
[0107] In step S203 of some embodiments, the IoT device encrypts the fifth random number, the sixth random number and the candidate verification number information according to the public key to obtain the third encrypted data. After completing the third encrypted data, the fourth random number is stored in the storage unit, and then the IoT device sends the third encrypted data and the sixth random number to the server, so that the server completes the registration after verifying the IoT device according to the third encrypted data and the sixth random number.
[0108] For example, the process of encrypting the fifth random number, the sixth random number and the candidate verification number information according to the public key to obtain the third encrypted data is recorded as c=Enc(pk, (k0, r0, NODEV)).
[0109] In step S204 of some embodiments, the third encrypted data is sent to the server, the server receives the third encrypted data from the IoT device, and authenticates the IoT device based on the third encrypted data to obtain first registration verification information, so as to determine whether the IoT device can communicate correctly and stably based on the first registration verification information.
[0110] It should be noted that the server obtains the fifth random number, the sixth random number and the device verification number information after decrypting the third encrypted data according to the private key. The process of decrypting the third encrypted data is recorded as Dec(sk, c) = (k0', r0', NO DEV '), NO DEV ' is the device verification number information. The server compares the device verification number information with the device verification number information to determine the first registration verification information. If the device verification number information and the device verification number information are the same, it is NO DEV '=NO DEV , the first registration verification information is verification success; if the device verification number information and the device verification number information are different, then the first registration verification information is verification failure; if the first registration verification information is verification failure, it means that the data transmission between the IoT device and the server is wrong, or the IoT device deliberately deceives the server.
[0111] In step S205 of some embodiments, if the first registration verification information is successfully verified, it is determined that the IoT device and the server can communicate normally and securely, and the server will send the eighth random number and the fifth hash data, and the eighth random number is randomly generated by the server, and the fifth hash data is obtained by the server based on the hash value calculated between the eighth random number and the sixth hash data. For example, the eighth random number is denoted as r0", and the sixth random number at the server is denoted as r0', and the process of calculating the hash value of the sixth random number and the eighth random number is denoted as h=hash(r0', r0").
[0112] In step S206 of some embodiments, the server is authenticated according to the eighth random number and the fifth hash data to obtain second registration verification information, so as to determine whether the server can communicate normally with the IoT device through the second registration verification information.
[0113] In step S207 of some embodiments, if the second registration verification information is successfully verified, it means that the server and the IoT device can communicate normally, so the candidate verification number information is used as the device verification number information of the IoT device.
[0114] In steps S201 to S207 shown in this embodiment, before the IoT device and the server perform authentication and key exchange, the IoT device needs to register with the server first. The IoT device generates various random numbers and encrypts the random numbers and device verification number information to give the random numbers and encrypted data to the server, and the server performs registration verification on the IoT device based on the random numbers and encrypted data. Therefore, registration verification is performed between the server and the IoT device to determine whether data can be transmitted normally and accurately between the IoT device and the server before completing registration, so that the server can register IoT devices with normal and accurate communication.
[0115] Please refer to Figure 3 In some embodiments, step S206 may include but is not limited to steps S301 to S302:
[0116] Step S301, performing hash value calculation according to the eighth random number and the sixth random number to obtain sixth hash data;
[0117] Step S302: compare the fifth hash data and the sixth hash data to obtain second registration verification information.
[0118] In step S301 of some embodiments, the sixth random number in the IoT device is r0, the eighth random number is r0”, and the process of calculating the hash values of the sixth random number and the eighth random number is recorded as h’=hash(r0, r0”), so the sixth hash data is h’.
[0119] In some embodiments, after the IoT device determines the sixth hash data, the sixth hash data is directly compared with the fifth hash data to obtain the second registration verification information. If the sixth hash data and the fifth hash data are the same, then the second registration verification information is successfully verified; if the sixth hash data and the fifth hash data are different, then the second registration verification information is a verification failure. After the IoT device determines the second registration verification information, it will feed back to the server so that the server uses the candidate verification number information as the device verification number information when the second registration verification information is successfully verified.
[0120] Please refer to Figure 4 In some embodiments, the first encrypted data is a first random number; the first verification data includes: a second random number and a first hash data. Step S104 may include but is not limited to steps S401 to S402:
[0121] Step S401, performing hash value calculation based on the first random number and the second random number to obtain second hash data;
[0122] Step S402: compare the first hash data and the second hash data to obtain server identity authentication information.
[0123] In steps S401 to S402 of some embodiments, when the IoT device needs to authenticate with the server, the IoT device calculates the hash value of the first random number and the second random number to obtain the second hash data, and the process of generating the second hash data is recorded as h1'=hash(r1, r2), and verifies whether the first hash data and the second hash data are h1=h1'. If the first hash data is equal to the second hash data, then the server identity authentication information is successfully verified; if the second hash data is not equal to the first hash data, then the server identity authentication information is failed to be verified. If the server identity authentication information is failed to be verified, the process is terminated and the subsequent operations are not continued.
[0124] In steps S401 to S402 shown in this embodiment, when the IoT device authenticates the server, the first hash data is compared with the second hash data generated by itself to determine whether the server can decrypt the correct first random number through the private key it carries, so that the IoT device does not need to set up a digital certificate for identity authentication of the server, and the authentication process is simple and cost-effective.
[0125] Also, please refer to Figure 5 The embodiment of the present invention further discloses an authentication method for an Internet of Things device, which is applied to a server. The authentication method for an Internet of Things device applied to the server may include but is not limited to steps S501 to S506:
[0126] Step S501, registering the IoT device to generate device verification number information, and sending the device verification number information to the IoT device;
[0127] Step S502, receiving device verification number information and first encrypted data sent by the IoT device, and performing identity authentication on the IoT device according to the device verification number information and the first encrypted data to obtain first device identity authentication information, and generating first verification data;
[0128] Step S503: If the first device identity authentication information is successfully authenticated, the first authentication data is sent to the IoT device, so that the IoT device authenticates the server according to the first authentication data to obtain the server identity authentication information;
[0129] Step S504, if the server identity authentication information is successfully authenticated, receiving second authentication data sent by the IoT device;
[0130] Step S505, performing identity authentication on the IoT device according to the second authentication data to obtain second device identity authentication information;
[0131] Step S506: If the second device identity authentication information is successfully verified, the key is shared with the IoT device.
[0132] In steps S501 to S506 shown in this embodiment, the server allocates device verification number information when the IoT device is registered, and provides it to the IoT device as a unique identity authentication credential. When performing authentication, the server receives the device verification number information and the first encrypted data sent from the IoT device, and authenticates the IoT device based on the device verification number information and the first encrypted data to obtain the first device identity authentication information. If the first device identity authentication information is successfully authenticated, the second verification data sent by the IoT device is received, and the IoT device is authenticated based on the second verification data to obtain the second device verification information. When the second device verification information is successfully authenticated, the key is shared with the IoT device. Therefore, the server authenticates the IoT device twice based on the verification data and then shares the key with the IoT device. Identity authentication can be completed without setting up a digital certificate in each IoT device, making identity authentication easier.
[0133] Please refer to Figure 6 In some embodiments, step S501 may include but is not limited to steps S601 to S607:
[0134] Step S601, receiving a registration request sent by an IoT device, and generating candidate verification number information according to the registration request;
[0135] Step S602, sending the candidate verification number information to the IoT device, and receiving the third encrypted data;
[0136] Step S603, decrypting the third encrypted data according to a preset private key to obtain a fifth random number, a sixth random number and candidate verification number information;
[0137] Step S604, comparing the candidate to-be-verified number information with the candidate verification number information to obtain third verification information;
[0138] Step S605: if the third verification information is successfully verified, generate a seventh random number, and perform a hash value calculation based on the seventh random number and the sixth random number to obtain fifth hash data;
[0139] Step S606, sending the fifth hash data and the seventh random number to the IoT device, so that the IoT device performs hash value calculation according to the seventh random number and the sixth random number to obtain sixth hash data, and compares the fifth hash data with the sixth hash data to obtain registration verification information;
[0140] Step S607: If the registration verification information is successfully verified, the candidate verification number information is used as the device verification number information, and the device verification number information is sent to the IoT device.
[0141] In step S601 of some embodiments, before the IoT device exchanges authentication keys with the server, it needs to register with the server. Therefore, the server receives a registration request, and the registration request includes at least a unique identifier, which is used to indicate the network card address, and the network card address is the address of the server. After receiving the registration request, the server generates a candidate verification number information for the IoT device, and the candidate verification number information generated each time is inconsistent to keep the candidate verification number information of the IoT device unique.
[0142] In step S602 of some embodiments, the candidate verification number information is sent to the IoT device, so that when the IoT device needs to be registered and authenticated, the third random number p0 is generated using PUF, the fifth random number k0 and the sixth random number r0 are generated using TRNG, and the third random number and the sixth random number are cross-calculated to obtain a fourth random number denoted as q0=p0⊕k0. The IoT device encrypts the fifth random number, the sixth random number and the device verification number information according to the public key to obtain the third encrypted data, and the process of encrypting the fifth random number, the sixth random number and the device verification number information according to the public key to obtain the third encrypted data is denoted as c=Enc(pk, (k0, r0, NO DEV )). Therefore, the server receives the third encrypted data from the IoT device.
[0143] In step S603 of some embodiments, the server decrypts the third encrypted data according to the private key to obtain the fifth random number, the sixth random number and the device verification number information. The process of decrypting the third encrypted data is recorded as Dec(sk, c) = (k0', r0', NO DEV '), NO DEV 'It is the candidate number information to be verified.
[0144] In step S604 of some embodiments, the server compares the candidate verification number information with the candidate verification number information to determine the third verification information. DEV '=NO DEV , then the third verification information is verification success; if the candidate to-be-verified number information and the candidate verification number information are different, then the third verification information is verification failure; if the third verification information is verification failure, it means that the data transmission between the IoT device and the server is wrong, or the IoT device deliberately deceives the server.
[0145] In step S605 of some embodiments, if the third verification information is successfully verified, a seventh random number is generated, and the seventh random number is recorded as r0". Then, the seventh random number and the decrypted sixth random number are hashed to obtain fifth hash data, so that the server and the IoT device can perform registration verification based on the fifth hash data. For example, please refer to Fig.10 , the process of calculating the hash value of the sixth random number and the seventh random number is recorded as h=hash(r0', r0").
[0146] It should be noted that if the third verification information fails to verify, the server will terminate the registration process and will no longer register the IoT device on the server.
[0147] In steps S606 to S607 of some embodiments, the fifth hash data and the seventh random number are sent to the IoT device, the IoT device receives the fifth hash data and the seventh random number sent by the server, and the IoT device calculates the hash value of the seventh random number and the sixth random number to obtain the sixth hash data. The process of generating the sixth hash data is recorded as h'=hash(r0', r0"). After the IoT device determines the sixth hash data, it can directly compare the sixth hash data with the fifth hash data to obtain the registration verification information. If the sixth hash data and the fifth hash data are the same, the registration verification information is a successful verification; if the sixth hash data and the fifth hash data are different, the registration verification information is a failed verification. After determining the registration verification information, the IoT device will feedback to the server, so that the server stores the device verification number information and the fifth random number when the registration verification information is a successful verification.
[0148] See also Figure 7In some embodiments, the first verification data includes: a second random number and first hash data; step S502 may include but is not limited to steps S701 to S703:
[0149] Step S701, decrypting the first encrypted data according to a preset private key to obtain a first random number and device verification number information;
[0150] Step S702, comparing the device to-be-verified number information with the device verification number information to obtain first device identity verification information;
[0151] Step S703: randomly generate a second random number, and perform hash value calculation based on the first random number and the second random number to obtain first hash data.
[0152] In some embodiments, in step S701 to step S702, the IoT device sends the first encrypted data c1 and the device verification number information NO DEV The server then decrypts the first encrypted data according to its own private key to obtain the second random number and the device verification number information. Because only the server holding the private key sk can decrypt the first encrypted data to obtain the correct first random number, the first hash data can be accurately calculated based on the first random number. Therefore, the server first compares the decrypted device verification number information with the device verification number information to obtain the first device identity authentication information, so as to determine the identity of the IoT device according to the verification result.
[0153] Please note that, please refer to Fig.11 The process of the server decrypting the first encrypted data is Dec(sk, c)=(r1', NO DEV '), then compare the device to be tested number information and the device verification number information to NO DEV '=NO DEV , then the first device identity authentication information is successfully authenticated. If the first device identity authentication information is unauthenticated, the process is terminated, and the server does not send the first hash data and the second random number to the IoT device.
[0154] In step S703 of some embodiments, if the first device identity authentication information is successfully verified, the server generates a second random number, and performs a hash value calculation based on the decrypted first random number and the second random number to obtain the first hash data. Therefore, the IoT device receives the second random number and the first hash data sent from the server. It should be noted that the process of the server generating the first hash data is h1=hash(r1', r2).
[0155] In steps S701 to S703 shown in this embodiment, the server obtains the device verification number information by decrypting the first encrypted data using its own private key, and compares the device verification number information previously distributed to the IoT device with the device verification number information to determine whether the IoT device is pre-registered. The server then authenticates the IoT device based on the random number and the hash data between the random numbers, so that the authentication between the server and the IoT device does not require a digital certificate, which is simple to operate and saves costs.
[0156] Please refer to Figure 8 In some embodiments, the second verification data is a third hash data; wherein the third hash data is randomly generated by the IoT device as a third random number, a fifth random number is generated according to the third random number and a pre-generated fourth random number, and a hash value is calculated according to the fifth random number and the second random number. Step S505 may include but is not limited to steps S801 to S802:
[0157] Step S801, performing hash value calculation according to the fifth random number and the second random number received in advance to obtain fourth hash data;
[0158] Step S802: compare the third hash data and the fourth hash data to obtain second device identity authentication information.
[0159] In step S801 to step S802 shown in this embodiment, the server performs hash calculation based on the fifth random number and the second random number to obtain the fourth hash data, and compares the fourth hash data with the third hash data to obtain the device identity authentication information. If the third hash data and the fourth hash data are the same, then the device identity authentication information is successfully verified; if the third hash data and the fourth hash data are different, then the device identity authentication information is failed. Therefore, after the device identity authentication is completed between the IoT device and the server, further authentication is performed to improve the accuracy of the device identity authentication.
[0160] For example, see Fig.11 , use PUF to generate a third random number p0, the generation process of the fifth random number is k0=p0⊕q0, the process of calculating the third hash data is h2=hash(k0,r2), and the process of calculating the fourth hash data is h2'=hash(k0,r2). If h2=h2', then the device identity authentication information is successfully verified.
[0161] It should be noted that if the device identity authentication information is successfully verified, the hash value of the first random number and the second random number is used as the key to complete the key sharing. Therefore, the final generated shared key is key, and the shared key is a hash value. The two parameters involved in the hash are the first random number r1 and the second random number r2, and the first random number r1 has not been transmitted on the public link, which ensures the privacy of the shared key key.
[0162] In summary, this application uses device number information and hash data to complete authentication between IoT devices, which can effectively realize two-way identity authentication and shared key establishment between servers and IoT devices, thereby improving the security of network data communication of IoT devices.
[0163] Also, please refer to Fig. 9 The embodiment of the present invention further discloses an authentication method for an Internet of Things device, which may include but is not limited to steps S901 to S907:
[0164] Step S901, the IoT device registers with the server to obtain device verification number information;
[0165] Step S902, the IoT device sends the device verification number information and the preset first encrypted data to the server, and the server authenticates the IoT device according to the first encrypted data to obtain the first device identity authentication information;
[0166] Step S903, if the first device identity authentication information is successfully authenticated, the server generates and sends first authentication data to the IoT device;
[0167] Step S904, the IoT device authenticates the server according to the first authentication data to obtain server authentication information;
[0168] Step S905, if the server identity authentication information is successfully authenticated, generate and send second authentication data to the server;
[0169] Step S906, the server performs identity authentication on the IoT device according to the second verification data to obtain second device identity authentication information;
[0170] Step S907: If the second device identity authentication information is successfully verified, the IoT device shares a key with the server.
[0171] In steps S901 to S907 shown in this embodiment, the device verification number information is obtained by registering the IoT device and the server, so that the IoT device and the server can perform mutual verification based on the device verification number information, and then share the key with each other after the verification is successful. Therefore, by enabling the IoT device and the server to automatically authenticate their identities and share the key, the IoT devices connected through a server can communicate securely, making the authentication operation between IoT devices simple, without the need to set up digital certificates, and saving costs.
[0172] Among them, the registration and authentication process between the IoT device and the server please refer to the above-mentioned IoT device authentication method, which will not be repeated here.
[0173] See also Fig.12 The embodiment of the present application further provides an Internet of Things device, which can implement the authentication method of the above-mentioned Internet of Things device, and the Internet of Things device includes:
[0174] The first registration module 1201 is used to register with the server to obtain device verification number information;
[0175] The encrypted data sending module 1202 is used to send the device verification number information and the preset first encrypted data to the server, so that the server authenticates the IoT device according to the first encrypted data to obtain the first device identity authentication information;
[0176] The first verification data receiving module 1203 is used to receive the first verification data fed back by the server if the first device identity authentication information is successfully verified;
[0177] A first identity authentication module 1204, configured to authenticate the server according to the first authentication data to obtain server identity authentication information;
[0178] The first verification data sending module 1205 is used to generate and send second verification data to the server if the server identity verification information is successfully verified, so that the server can authenticate the IoT device according to the second verification data to obtain second device identity verification information;
[0179] The first key sharing module 1206 is configured to share a key with the server if the second device identity authentication information is successfully authenticated.
[0180] The specific implementation of the Internet of Things device is basically the same as the specific implementation of the authentication method for the Internet of Things device mentioned above, and will not be repeated here.
[0181] See also Fig.13 The embodiment of the present application further provides a server that can implement the above-mentioned authentication method for the Internet of Things device, and the server includes:
[0182] The number generation module 1301 is used to register the IoT device to generate device verification number information, and send the device verification number information to the IoT device;
[0183] The encrypted data receiving module 1302 is used to receive the device verification number information and the first encrypted data sent by the IoT device, and authenticate the IoT device according to the device verification number information and the first encrypted data to obtain the first device identity authentication information, and generate the first verification data;
[0184] The second verification data sending module 1303 is used to send the first verification data to the IoT device if the first device identity verification information is successfully verified, so that the IoT device verifies the server according to the first verification data to obtain the server identity verification information;
[0185] The second verification data receiving module 1304 is used to receive the second verification data sent by the IoT device if the server identity verification information is successfully verified;
[0186] The second identity authentication module 1305 is used to authenticate the IoT device according to the second authentication data to obtain second device identity authentication information;
[0187] The second key sharing module 1306 is configured to share a key with the IoT device if the second device identity authentication information is successfully authenticated.
[0188] The embodiment of the present application also provides an authentication system for an Internet of Things device, comprising the above-mentioned Internet of Things device and a server; wherein the Internet of Things device is used to perform the above-mentioned Figures 1 to 4 The authentication method of the Internet of Things device, the server is used to execute the above Figures 5 to 8 Authentication of IoT devices.
[0189] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the authentication method of the above-mentioned Internet of Things device is implemented.
[0190] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0191] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0192] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0193] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0195] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0196] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0197] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0198] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0200] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0201] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for authenticating an Internet of Things device, characterized in that: Applied to an IoT device, the method comprises: Register with the server to obtain device verification number information; Sending the device verification number information and the preset first encrypted data to the server, so that the server authenticates the IoT device according to the first encrypted data and the device verification number information to obtain first device identity authentication information; If the first device identity authentication information is successfully verified, receiving first verification data fed back by the server; Performing identity authentication on the server according to the first authentication data to obtain server identity authentication information; If the server identity authentication information is successfully authenticated, generate and send second authentication data to the server so that the server authenticates the IoT device according to the second authentication data to obtain second device identity authentication information; If the second device identity authentication information is successfully verified, share a key with the server; The registering with the server to obtain the device verification number information includes: Sending a registration request to the server, so that the server generates candidate verification number information according to the registration request; receiving the candidate verification number information sent by the server, and generating a third random number, a fifth random number and a sixth random number, and generating a fourth random number according to the third random number and the fifth random number; Encrypting the fifth random number, the sixth random number and the candidate verification number information according to a preset public key to obtain third encrypted data; Sending the third encrypted data to the server, so that the server authenticates the IoT device according to the third encrypted data to obtain first registration verification information; If the first registration verification information is successfully verified, receiving an eighth random number and fifth hash data sent by the server; Verifying the server according to the eighth random number and the fifth hash data to obtain second registration verification information; If the second registration verification information is successfully verified, the candidate verification number information is used as the device verification number information.
2. The method according to claim 1, characterized in that: The first encrypted data is a first random number; The first verification data includes: a second random number and first hash data; the authentication of the server is performed according to the first verification data to obtain server authentication information, including: Perform hash value calculation according to the first random number and the second random number to obtain second hash data; The first hash data and the second hash data are compared to obtain the server identity authentication information.
3. The method according to claim 2, characterized in that The step of verifying the server according to the eighth random number and the fifth hash data to obtain second registration verification information includes: Performing hash value calculation based on the eighth random number and the sixth random number to obtain sixth hash data; The fifth hash data and the sixth hash data are compared to obtain the second registration verification information.
4. A method for authenticating an Internet of Things device, characterized in that: Applied to a server, the method comprises: Registering an IoT device to generate device verification number information, and sending the device verification number information to the IoT device; Receive the device verification number information and the first encrypted data sent by the IoT device, and authenticate the IoT device according to the device verification number information and the first encrypted data to obtain the first device identity authentication information, and generate the first verification data; If the first device identity authentication information is successfully authenticated, the first authentication data is sent to the IoT device, so that the IoT device authenticates the server according to the first authentication data to obtain server identity authentication information; If the server identity authentication information is successfully verified, receiving second verification data sent by the IoT device; Performing identity authentication on the IoT device according to the second authentication data to obtain second device identity authentication information; If the second device identity authentication information is successfully verified, share a key with the IoT device; The registering of the IoT device to generate device verification number information, and sending the device verification number information to the IoT device, includes: Receive a registration request sent by the IoT device, and generate candidate verification number information according to the registration request; sending the candidate verification number information to the IoT device, and receiving third encrypted data; Decrypting the third encrypted data according to a preset private key to obtain a fifth random number, a sixth random number and candidate verification number information; Compare the candidate to-be-verified number information with the candidate verification number information to obtain third verification information; If the third verification information is successfully verified, generate a seventh random number, and perform a hash value calculation based on the seventh random number and the sixth random number to obtain fifth hash data; Sending the fifth hash data and the seventh random number to the IoT device, so that the IoT device performs hash value calculation according to the seventh random number and the sixth random number to obtain sixth hash data, and compares the fifth hash data with the sixth hash data to obtain registration verification information; If the registration verification information is successfully verified, the candidate verification number information is used as the device verification number information, and the device verification number information is sent to the Internet of Things device.
5. The method according to claim 4, characterized in that The first verification data includes: a second random number and a first hash data; the receiving device verification number information and the first encrypted data sent by the IoT device, and authenticating the IoT device according to the device verification number information and the first encrypted data to obtain the first device identity authentication information, and generating the first verification data includes: Decrypting the first encrypted data according to a preset private key to obtain a first random number and device verification number information; Compare the device to-be-verified number information with the device verification number information to obtain the first device identity verification information; A second random number is randomly generated, and a hash value is calculated according to the first random number and the second random number to obtain the first hash data.
6. The method according to claim 5, characterized in that The second verification data is third hash data; wherein the third hash data is obtained by randomly generating a third random number by the IoT device, generating a fifth random number according to the third random number and a pre-generated fourth random number, and performing a hash value calculation according to the fifth random number and the second random number; the second device identity authentication information is obtained by authenticating the IoT device according to the second verification data, including: Perform hash value calculation based on the fifth random number received in advance and the second random number to obtain fourth hash data; The third hash data and the fourth hash data are compared to obtain the second device identity authentication information.
7. An authentication method for an Internet of Things device, characterized in that: The method comprises: The IoT device registers with the server to obtain device verification number information; The IoT device sends the device verification number information and the preset first encrypted data to the server, and the server authenticates the IoT device according to the first encrypted data to obtain first device identity authentication information; If the first device identity authentication information is successfully verified, the server generates and sends first verification data to the IoT device; The IoT device authenticates the server according to the first authentication data to obtain server authentication information; If the server identity authentication information is successfully authenticated, generating and sending second authentication data to the server; The server performs identity authentication on the IoT device according to the second verification data to obtain second device identity authentication information; If the second device identity authentication information is successfully verified, the IoT device shares a key with the server; The IoT device registers with the server to obtain device verification number information, including: The IoT device sends a registration request to the server, so that the server generates candidate verification number information according to the registration request; The IoT device receives the candidate verification number information sent by the server, generates a third random number, a fifth random number, and a sixth random number, and generates a fourth random number according to the third random number and the fifth random number; The IoT device encrypts the fifth random number, the sixth random number and the candidate verification number information according to a preset public key to obtain third encrypted data; The IoT device sends the third encrypted data to the server, so that the server authenticates the IoT device according to the third encrypted data to obtain first registration verification information; If the first registration verification information indicates successful verification, the IoT device receives an eighth random number and fifth hash data sent by the server; The Internet of Things device verifies the server according to the eighth random number and the fifth hash data to obtain second registration verification information; If the second registration verification information is successfully verified, the Internet of Things device uses the candidate verification number information as the device verification number information.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the authentication method for an Internet of Things device as described in any one of claims 1 to 3, or the authentication method for an Internet of Things device as described in any one of claims 4 to 6, or the authentication method for an Internet of Things device as described in claim 7.
