Distributed device authentication method and system based on pre-embedded secure asymmetric key
Patent Information
- Application Number
- CN202410216178.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-02-27
AI Technical Summary
以上提及的两种场景,只考虑了如何高效的发现和连接设备,对于连接认证和连接安全性,并没有进行考虑,无线网络的开放性,导致可能存在冒充设备入侵的风险,如何有效预防中间人攻击是一个问题,一般认证和安全性会在这个协议更上层,由用户实现
[0040] The present invention uses the public and private key pairs preset in the TPM device or TCM secure storage to generate device identity verification data packets. Through the discovery protocol and the verification of the receiving end, the device piggybacks the device itself in the process of requesting discovery broadcast and service release. Device type verification is performed on the encrypted authentication data packet to confirm whether the device is a trusted device. If it is a trusted device, there is no need for additional connection authentication, and it can directly connect to each other and establish a secure communication channel. If the device is not trusted, the receiving end refuses communication with the device. To enhance the security of distributed device connection authentication, simplify the process of distributed device interconnection, and realize automatic authentication and connection of connected devices during the discovery and service release process of broadcast or multicast.
Smart Images

Figure CN118174902B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of device security authentication, and provides a distributed device authentication method and system based on pre-embedded secure asymmetric keys. Background Art
[0002] At present, the core technologies of P2P network technology are UPNP and SSDP protocols. The SSDP protocol, namely the Simple Service Discovery Protocol, provides discovery and connection functions for service providers and service users in the local area network. Similarly, a similar protocol has been developed in the IoT field - the COAP Constrained Application Protocol. The Hongmeng system soft bus module applies this technology and establishes device key negotiation, connection and transmission based on the COAP protocol. The application scenarios of these two protocols greatly simplify the connection and management problems of a large number of devices in the local area network. The two scenarios mentioned above only consider how to efficiently discover and connect devices, and do not consider connection authentication and connection security. The openness of wireless networks may lead to the risk of intrusion by impersonating devices. How to effectively prevent man-in-the-middle attacks is a problem. Generally, authentication and security will be implemented by users at a higher level of this protocol. Moreover, device connection authentication generally adopts interactive confirmation, which makes it difficult to achieve automatic discovery, connection, and networking. Summary of the invention
[0003] In order to solve at least one of the technical problems mentioned in the background technology, the purpose of the present invention is to provide a distributed device authentication method and system based on pre-embedded secure asymmetric keys, which automatically performs security authentication on connected devices during broadcast or multicast discovery and service publishing.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A distributed device authentication method based on pre-embedded secure asymmetric keys comprises the following steps:
[0006] S1: Issue the same private key and different public keys to each device type, and store the device's private key and public key pair in the TPM module;
[0007] S2: piggyback the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing links through the receiving end;
[0008] S3: Decrypt and verify the encrypted authentication data packet of the device. After the verification is successful, the device requesting the connection is identified as trustworthy, and business interaction is carried out after an encrypted session link is established. After the verification fails, the receiving end refuses to communicate with the device.
[0009] Furthermore, the step S2 comprises:
[0010] S21: Generate a hash value by using a hash algorithm for the device serial number and the timestamp data at the current moment, and encrypt the hash value with a private key to obtain hash signature data;
[0011] S22: Using the device public key that matches the private key, the device serial number, timestamp data, and encrypted hash signature data are used as input for encryption to obtain an encrypted authentication data packet.
[0012] Furthermore, the step S2 further includes:
[0013] S23: In the discovery broadcast request phase, the device sends its own authentication data packet along with the broadcast message;
[0014] S24: In the service publishing phase, the device will carry its own authentication data packet in the published service information.
[0015] Furthermore, the step S3 comprises:
[0016] S31: Decrypt the encrypted authentication data packet using the authentication private key built into the receiving end to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext;
[0017] S32: Decrypt the hash signature ciphertext using the identity authentication public key built into the receiving end to obtain the hash plaintext.
[0018] Furthermore, the step S3 further includes:
[0019] S33: Perform device hash signature verification, call the same hash algorithm as step S21, perform hash calculation on the device serial number and timestamp data, and compare the obtained hash value with the hash value obtained in step S32. If the comparison is consistent, it means passing, otherwise it means failure;
[0020] S34: Perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving system and the timestamp in the decrypted data in step S31, if the absolute value of the difference is greater than the threshold, it indicates failure; if the absolute value of the difference is less than or equal to the threshold, it indicates passing;
[0021] S35: When the device hash signature verification results are consistent and the TOTP verification passes, the device making the connection request is identified as credible.
[0022] A distributed device authentication system based on pre-embedded secure asymmetric keys, comprising:
[0023] Public and private key pre-setting module: used to issue the same private key and different public keys for each device type, and store the device's private key and public key pair in the TPM module;
[0024] Encryption carrying and receiving module: used to carry the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing link through the receiving end;
[0025] Decryption and verification module: used to decrypt and verify the encrypted authentication data packet of the device. After the verification is passed, the device requesting the connection is identified as trustworthy, and business interaction is carried out after an encrypted session link is established; after the verification fails, the receiving end refuses to communicate with the device.
[0026] Furthermore, the encryption carrying and receiving module includes:
[0027] Hash signature data generation unit: used to generate a hash value by using a hash algorithm to generate the device serial number and the timestamp data of the current moment, and encrypt the hash value with a private key to obtain hash signature data;
[0028] Encrypted authentication data packet generation unit: uses the device public key that matches the private key to encrypt the device serial number, timestamp data, and encrypted hash signature data as input to obtain an encrypted authentication data packet.
[0029] Furthermore, the encryption carrying and receiving module also includes:
[0030] Sending unit: used for sending the device's own authentication data packet along with the broadcast message in the discovery broadcast request phase;
[0031] Publishing unit: used in the service publishing link, the device will carry its own authentication data packet in the published service information.
[0032] Furthermore, the decryption and verification module includes:
[0033] The first decryption unit: uses the authentication private key built into the receiving end to decrypt the encrypted authentication data packet to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext;
[0034] The second decryption unit: uses the identity authentication public key built into the receiving end to decrypt the hash signature ciphertext to obtain the hash plaintext.
[0035] Furthermore, the decryption and verification module also includes:
[0036] Hash signature verification unit: used to verify the hash signature of the device. It calls the same hash algorithm as that in the hash signature data generation unit to perform hash calculation on the device serial number and timestamp data. The obtained hash value is compared with the hash value obtained by the second decryption unit. If the comparison is consistent, it means passing, otherwise it means failure;
[0037] TOTP verification unit: used to perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving end system and the timestamp in the decrypted data of the first decryption unit, if the absolute value of the difference is greater than the threshold, it means failure; if the absolute value of the difference is less than or equal to the threshold, it means passing;
[0038] Identification unit: used to identify the device making the connection request as credible when the device hash signature verification results are consistent and TOTP verification passes.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The present invention uses a public-private key pair preset in a TPM device or TCM secure storage to generate a device identity authentication data packet. Through discovery protocol piggybacking and verification by the receiving end, the device piggybacks its own encrypted identity authentication data packet to perform device type verification when requesting discovery broadcast and service publishing to confirm whether the device is a trusted device. If it is a trusted device, no additional connection authentication is required, and the connection is directly connected and a secure communication channel is established. If it is not a trusted device, the receiving end refuses to communicate with the device. This enhances the security of distributed device connection authentication, simplifies the distributed device interconnection process, and realizes automatic authentication and connection of connected devices during broadcast or multicast discovery and service publishing. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flow chart of a distributed device authentication method based on a pre-embedded secure asymmetric key provided in Embodiment 1 of the present invention;
[0042] Figure 2 A flowchart of step S2 in the distributed device authentication method based on pre-embedded secure asymmetric keys provided in the first embodiment of the present invention;
[0043] Figure 3 A flowchart of step S3 in the distributed device authentication method based on pre-embedded secure asymmetric keys provided in the first embodiment of the present invention;
[0044] Figure 4 A flow chart of generating a device identity authentication data packet in a distributed device authentication method based on a pre-embedded secure asymmetric key provided in the first embodiment of the present invention;
[0045] Figure 5A flow chart of a device performing trusted authentication using a received identity authentication data packet in a distributed device authentication method based on a pre-embedded secure asymmetric key provided in the first embodiment of the present invention;
[0046] Figure 6 The distributed device authentication system structure frame based on pre-embedded secure asymmetric key provided in the second embodiment of the present invention Figure 1 ;
[0047] Figure 7 The distributed device authentication system structure frame based on pre-embedded secure asymmetric key provided in the second embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Embodiment 1
[0050] See also Figure 1 This embodiment provides a distributed device authentication method based on a pre-embedded secure asymmetric key, comprising the steps of:
[0051] S1: Issue the same private key and different public keys to each device type, and store the device's private key and public key pair in the TPM module;
[0052] S2: piggyback the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing links through the receiving end;
[0053] S3: Decrypt and verify the encrypted authentication data packet of the device. After the verification is successful, the device requesting the connection is identified as trustworthy, and business interaction is carried out after an encrypted session link is established. After the verification fails, the receiving end refuses to communicate with the device.
[0054] Specifically, issuing a unified private key and a different public key for each device type helps ensure the uniqueness and type identification of the device. The private key is used to generate valid signature data, while the public key is used to verify the signature data. Among them, the private key is used by the device to generate signature data or perform encryption operations. Since the private key is unified, it can ensure the consistency of communication and verification between devices. A unique public key is issued to each device. Among them, the public key is used to verify signature data or decrypt received encrypted data. Since the public key of each device is unique, it can ensure that only the device with the corresponding private key can successfully verify or decrypt the data.
[0055] Specifically, the TPM module stores public and private key pairs. Storing the public and private key pairs of the device in the TPM module, i.e., the trusted platform, can improve the security of the key. The TPM module usually has hardware-level secure storage and encryption functions, which can protect the key from unauthorized access and tampering.
[0056] Specifically, the timestamp signature data, when broadcasting discovery and service release, the device carries the timestamp signature data, which can increase the integrity and credibility of the message. The timestamp can verify the timeliness of the message, while the signature data can verify the source of the message and whether the content has been tampered with.
[0057] Specifically, the receiving end verifies the device signature and TOTP. The receiving broadcast end verifies the device signature and performs TOTP verification, which is a time-based one-time password, to further enhance security. TOTP generates a one-time password based on time changes, and only passwords that match the current timestamp are considered valid.
[0058] Specifically, the encrypted authentication packet carries the encrypted authentication packet of the device in the message structure or payload structure of the discovery protocol, which helps the receiving end to verify the identity and type of the device. The encrypted authentication packet contains information used to verify the identity of the device, such as the device serial number, timestamp data, and encrypted hash signature data.
[0059] Specifically, an encrypted session link is established, and after verification, the receiving end establishes an encrypted session link with the device. This usually involves the use of strong encryption algorithms and secure communication protocols to ensure the confidentiality and integrity of data during the communication process.
[0060] Specifically, if the verification fails, the communication is rejected. If the encrypted authentication data packet of the device cannot pass the verification, the receiving end can choose to reject the communication with the device. This can prevent potential malicious devices from accessing the network and improve overall security.
[0061] Specifically, the data structure of the authentication data packet in the protocol is generally placed in the protocol request data body. The specific organizational forms of the SSDP protocol and the CoAP protocol may be different. The main difference is that SSDP is based on the HTTP protocol and needs to convert binary data into text for transmission. The CoAP protocol directly supports binary data transmission. It only needs to put the encrypted data into the payload area according to the negotiated format. The message structure or load structure of the discovery protocol is used to carry the encrypted identity data verification package of each device. The device that receives the data packet decrypts and verifies the encrypted identity data verification package. After the verification is passed, it can be considered that the device requesting the connection is already trusted. After establishing an encrypted session link, business interaction can be carried out directly. The method ensures that only authenticated and authorized devices can participate in communication, thereby improving the security of the Internet of Things system.
[0062] See also Figure 2 , wherein step S2 comprises:
[0063] S21: Generate a hash value by using a hash algorithm for the device serial number and the timestamp data at the current moment, and encrypt the hash value with a private key to obtain hash signature data;
[0064] S22: Using the device public key that matches the private key, the device serial number, timestamp data, and encrypted hash signature data are used as input for encryption to obtain an encrypted authentication data packet.
[0065] Specifically, to generate a hash value: the device first combines its serial number, a string that uniquely identifies the device, with the current timestamp, a number that represents a specific time. Using a hash algorithm such as sha, md5, etc., this combined data is hashed to generate a hash value of fixed length. This hash value is a summary of the original data, which is unique and cannot be tampered with, meaning that as long as the original data changes, the hash value will also change.
[0066] Specifically, generate hash signature data: use the device's private key to encrypt the hash value and generate a hash signature. This signature is a digital signature of the hash value, used to verify the integrity and source of the data. The private key and public key are a pair used for asymmetric encryption. The private key is used to sign data, and the public key is used to verify the signature.
[0067] Specifically, generate an encrypted authentication packet: combine the device serial number, timestamp data, and encrypted hash signature data. Use the public key that matches the private key to encrypt this combined data to generate an encrypted authentication packet. This packet contains the device's identity information and timestamp, as well as a signature that can verify its integrity and origin.
[0068] Wherein, step S2 further includes:
[0069] S23: In the discovery broadcast request phase, the device sends its own authentication data packet along with the broadcast message;
[0070] S24: In the service publishing phase, the device will carry its own authentication data packet in the published service information.
[0071] Specifically, request discovery broadcast link: When a device needs to be discovered by other devices, it will attach its own authentication data packet to the broadcast message. The broadcast message contains an encrypted authentication data packet, so that any device receiving the broadcast can use the public key to decrypt the data packet and verify the identity of the device and the freshness of the message, that is, whether the timestamp is within the current valid range. Service publishing link: When a device provides a certain service, it will attach its own authentication data packet when publishing service information. After receiving the service information and authentication data packet, the service requester can also use the public key to decrypt the data packet to verify the identity of the device and the authenticity of the service. The above can prevent malicious devices from impersonating other devices or sending outdated or tampered information. By verifying the integrity of identity and data, the system can operate more securely and reliably.
[0072] See also Figure 3 , wherein step S3 comprises:
[0073] S31: Decrypt the encrypted authentication data packet using the authentication private key built into the receiving end to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext;
[0074] S32: Decrypt the hash signature ciphertext using the identity authentication public key built into the receiving end to obtain the hash plaintext.
[0075] Specifically, decrypt the authentication data packet, wherein the operation is: decrypt the encrypted authentication data packet using the authentication private key built into the receiving end. The result is: obtaining the device serial number plaintext, timestamp plaintext, and hash signature ciphertext. The device serial number plaintext: the unique identifier of the device. The timestamp plaintext: data indicating the time when the message was created. The hash signature ciphertext: the hash value encrypted by the private key, used to verify the integrity and source of the message.
[0076] Specifically, the hash signature ciphertext is decrypted, wherein the operation is: decrypting the hash signature ciphertext using the authentication public key built into the receiving end. The result is: obtaining the hash plaintext, that is, the original hash value.
[0077] Wherein, step S3 also includes:
[0078] S33: Perform device hash signature verification, call the same hash algorithm as step S21, perform hash calculation on the device serial number and timestamp data, and compare the obtained hash value with the hash value obtained in step S32. If the comparison is consistent, it means passing, otherwise it means failure;
[0079] S34: Perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving system and the timestamp in the decrypted data in step S31, if the absolute value of the difference is greater than the threshold, it indicates failure; if the absolute value of the difference is less than or equal to the threshold, it indicates passing;
[0080] S35: When the device hash signature verification results are consistent and the TOTP verification passes, the device making the connection request is identified as credible.
[0081] Specifically, the device hash signature verification, where the operation is: use the same hash algorithm as step S21 to hash the device serial number and timestamp data to obtain a new hash value. Compare this newly calculated hash value with the hash value obtained in step S32. The result is: if they are consistent, it means that the message has not been tampered with during transmission and is indeed from a device with the corresponding private key. If they are inconsistent, it means that the message may have been tampered with or is not from the expected device.
[0082] Specifically, TOTP authentication is a time-based one-time password. The operation is: calculate the current timestamp of the receiving system. Calculate the absolute value of the difference between the timestamp decrypted in step S31 and the current timestamp. Compare this absolute value of the difference with a preset threshold. The result is: if the absolute value of the difference is greater than the threshold, it means that the message may be outdated or delayed during transmission. If the absolute value of the difference is less than or equal to the threshold, it means that the message is fresh and arrives within a reasonable time range.
[0083] Specifically, the conditions for identifying the credibility of the device are: the device hash signature verification results are consistent, and the TOTP verification is passed. The result is: the condition is met: the device that identifies the connection request is credible. The condition is not met: the connection request is rejected or other security measures are taken. This process ensures that only devices with valid private keys and corresponding public keys can successfully authenticate, and that the message is not tampered with or delayed during transmission. At the same time, TOTP verification ensures the freshness of the message, that is, it was not created a long time ago. Such a mechanism is very effective in protecting the system from man-in-the-middle attacks, replay attacks, and other security threats.
[0084] See also Figure 4 , the generation of authentication data packet is encrypted twice:
[0085] The first encryption is to use the device serial number and the timestamp data of the moment when the encrypted authentication data is generated, generate a hash value (i.e., the original hash data) using the hash algorithm SHA, encrypt the hash value using the private key, and then encrypt the hash data after the plaintext hash data is input into the TPM device. The purpose of this step is to use the uniqueness of the private key to allow the receiver to perform public key decryption verification on the hash signature to determine that the data is not counterfeit.
[0086] The second encryption is to use the device-specific public key that matches the private key to encrypt the device serial number, timestamp, and encrypted hash signature data as input, and the device authentication raw data is input into the TPM device and the device authentication encrypted data is output to generate encrypted device authentication data, i.e., encrypted identity authentication data packet. The purpose of this step is to ensure that the data is secure during transmission.
[0087] The private key encryption and public key encryption performed here are both performed in the TPM device. The keys do not leave the TPM hardware, which can ensure that the public and private keys will not be leaked. Both the private key and the public key are built into the TPM to ensure the security of the public and private keys.
[0088] See also Figure 5 ,Device encrypted authentication data verification requires two decryptions and two security verifications.
[0089] Decrypt twice:
[0090] For the first decryption, the receiver uses the built-in authentication private key to decrypt the encrypted device authentication data, i.e., the encrypted authentication data packet, and obtains the following three sets of data: the device serial number plaintext, the device timestamp plaintext, and the hash signature ciphertext of the serial number + timestamp.
[0091] Second decryption: The receiver uses the built-in authentication public key to decrypt the SHA hash ciphertext to obtain a hash plaintext.
[0092] Two verifications:
[0093] For the first verification, the receiving end calls the same hash algorithm SHA to perform hash calculation on the device serial number + timestamp data. The calculated hash value is compared with the hash value decrypted above. If the comparison is consistent, the verification is passed, otherwise it fails.
[0094] In the second verification, the receiving end compares the absolute value of the difference between the current timestamp of the receiving end system and the timestamp in the decrypted data of the sending end. If the absolute value of the difference exceeds a threshold, it fails. If it is less than or equal to this threshold, it passes. It is generally recommended to control the threshold within 10 seconds and should not be too long. In principle, the smaller the threshold is set, the lower the probability of a successful replay attack. However, the smaller the threshold, the higher the synchronization requirements between multiple devices. In actual applications, dynamic settings can be made according to the device time synchronization performance and security requirement level. Only when both verifications are passed, the device identity authentication is considered to have passed, and the next stage of key exchange security session and other processes are carried out. Only when any one verification passes or both verifications fail, the verification is considered to have failed. The key used for decryption verification is similar to the encryption process, and the TPM is used to ensure the security of the key.
[0095] This method uses the public-private key pair preset in the TPM device or TCM secure storage to generate a device identity authentication data packet. Through the discovery protocol piggybacking and verification by the receiving end, the device piggybacks its own encrypted identity authentication data packet to perform device type verification when requesting discovery broadcast and service release to confirm whether the device is a trusted device. If it is a trusted device, no additional connection authentication is required, and the connection is directly established and a secure communication channel is established. If it is not a trusted device, the receiving end refuses to communicate with the device. This enhances the security of distributed device connection authentication, simplifies the distributed device interconnection process, and realizes automatic authentication and connection of connected devices during broadcast or multicast discovery and service release.
[0096] Embodiment 2
[0097] See also Figure 6 This embodiment provides a distributed device authentication system based on a pre-embedded secure asymmetric key, including:
[0098] Public and private key pre-setting module: used to issue the same private key and different public keys for each device type, and store the device's private key and public key pair in the TPM module;
[0099] Encryption carrying and receiving module: used to carry the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing link through the receiving end;
[0100] Decryption and verification module: used to decrypt and verify the encrypted authentication data packet of the device. After the verification is passed, the device requesting the connection is identified as trustworthy, and business interaction is carried out after an encrypted session link is established; after the verification fails, the receiving end refuses to communicate with the device.
[0101] See also Figure 7, wherein the encryption carrying and receiving module includes:
[0102] Hash signature data generation unit: used to generate a hash value by using a hash algorithm to generate the device serial number and the timestamp data of the current moment, and encrypt the hash value with a private key to obtain hash signature data;
[0103] Encrypted authentication data packet generation unit: uses the device public key that matches the private key to encrypt the device serial number, timestamp data, and encrypted hash signature data as input to obtain an encrypted authentication data packet.
[0104] Among them, the encryption carrying and receiving module also includes:
[0105] Sending unit: used for sending the device's own authentication data packet along with the broadcast message in the discovery broadcast request phase;
[0106] Publishing unit: used in the service publishing link, the device will carry its own authentication data packet in the published service information.
[0107] Among them, the decryption and verification modules include:
[0108] The first decryption unit: uses the authentication private key built into the receiving end to decrypt the encrypted authentication data packet to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext;
[0109] The second decryption unit: uses the identity authentication public key built into the receiving end to decrypt the hash signature ciphertext to obtain the hash plaintext.
[0110] Among them, the decryption and verification module also includes:
[0111] Hash signature verification unit: used to verify the hash signature of the device. It calls the same hash algorithm as that in the hash signature data generation unit to perform hash calculation on the device serial number and timestamp data. The obtained hash value is compared with the hash value obtained by the second decryption unit. If the comparison is consistent, it means passing, otherwise it means failure;
[0112] TOTP verification unit: used to perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving end system and the timestamp in the decrypted data of the first decryption unit, if the absolute value of the difference is greater than the threshold, it means failure; if the absolute value of the difference is less than or equal to the threshold, it means passing;
[0113] Identification unit: used to identify the device making the connection request as credible when the device hash signature verification results are consistent and TOTP verification passes.
[0114] This system uses the public-private key presetting module to pre-set the public-private key pair in the TPM device or TCM secure storage, and generates the device identity authentication data packet in the encryption carrying and receiving module. Through the discovery protocol piggybacking and the verification of the receiving end, the device requests to discover the broadcast and service release link, and the encrypted identity authentication data packet of the device itself is piggybacked for device type verification in the decryption and verification module to confirm whether the device is a trusted device. If it is a trusted device, no additional connection authentication is required, and the connection is directly connected and a secure communication channel is established. If it is not a trusted device, the receiving end refuses to communicate with the device. In order to enhance the security of distributed device connection authentication, simplify the process of distributed device interconnection, and realize automatic authentication and connection of connected devices during broadcast or multicast discovery and service release.
[0115] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.
Claims
1. A distributed device authentication method based on pre-embedded secure asymmetric keys, characterized in that: Includes steps: S1: Issue the same private key and different public keys to each device type, and store the device's private key and public key pair in the TPM module; S2: piggyback the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing links through the receiving end; S3: Decrypt and verify the encrypted authentication data packet of the device. After the verification is passed, the device requesting the connection is identified as credible, and the encrypted session link is established for business interaction. If the verification fails, the receiving end refuses to communicate with the device. The step S2 comprises: S21: Generate a hash value by using a hash algorithm for the device serial number and the timestamp data at the current moment, and encrypt the hash value with a private key to obtain hash signature data; S22: using the device public key that matches the private key, encrypting the device serial number, timestamp data, and encrypted hash signature data as input to obtain an encrypted authentication data packet; The step S2 further comprises: S23: In the discovery broadcast request phase, the device sends its own authentication data packet along with the broadcast message; S24: In the service publishing phase, the device will carry its own authentication data packet in the published service information.
2. The distributed device authentication method based on pre-embedded secure asymmetric keys according to claim 1, characterized in that: The step S3 comprises: S31: Decrypt the encrypted authentication data packet using the authentication private key built into the receiving end to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext; S32: Decrypt the hash signature ciphertext using the identity authentication public key built into the receiving end to obtain the hash plaintext.
3. The distributed device authentication method based on pre-embedded secure asymmetric keys according to claim 2, characterized in that: The step S3 further comprises: S33: Perform device hash signature verification, call the same hash algorithm as step S21, perform hash calculation on the device serial number and timestamp data, and compare the obtained hash value with the hash value obtained in step S32. If the comparison is consistent, it means passing, otherwise it means failure; S34: Perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving system and the timestamp in the decrypted data in step S31, if the absolute value of the difference is greater than the threshold, it indicates failure; if the absolute value of the difference is less than or equal to the threshold, it indicates passing; S35: When the device hash signature verification results are consistent and the TOTP verification passes, the device making the connection request is identified as credible.
4. A distributed device authentication system based on pre-embedded secure asymmetric keys, characterized in that: include: Public and private key pre-setting module: used to issue the same private key and different public keys for each device type, and store the device's private key and public key pair in the TPM module; Encryption carrying and receiving module: used to carry the encrypted authentication data packet of the device in the message structure or payload structure of the discovery protocol, and receive the encrypted authentication data packet of the piggybacked device in the request discovery broadcast and service publishing link through the receiving end; Decryption and verification module: used to decrypt and verify the encrypted identity authentication data packet of the device. After the verification is passed, the device requesting the connection is identified as credible, and the encrypted session link is established for business interaction. After the authentication fails, the receiving end refuses to communicate with the device; The encryption carrying and receiving module comprises: Hash signature data generation unit: used to generate a hash value by using a hash algorithm to generate the device serial number and the timestamp data of the current moment, and encrypt the hash value with a private key to obtain hash signature data; An encrypted authentication data packet generation unit: using a device public key matching a private key, encrypting the device serial number, timestamp data, and encrypted hash signature data as input to obtain an encrypted authentication data packet; The encryption carrying and receiving module also includes: Sending unit: used for sending the device's own authentication data packet along with the broadcast message in the discovery broadcast request phase; Publishing unit: used in the service publishing link, the device will carry its own authentication data packet in the published service information.
5. The distributed device authentication system based on pre-embedded secure asymmetric keys according to claim 4, characterized in that: The decryption and verification module includes: The first decryption unit: uses the authentication private key built into the receiving end to decrypt the encrypted authentication data packet to obtain the device serial number plaintext, timestamp plaintext and hash signature ciphertext; The second decryption unit: uses the identity authentication public key built into the receiving end to decrypt the hash signature ciphertext to obtain the hash plaintext.
6. The distributed device authentication system based on pre-embedded secure asymmetric keys according to claim 5, characterized in that: The decryption and verification module also includes: Hash signature verification unit: used to verify the hash signature of the device. It calls the same hash algorithm as that in the hash signature data generation unit to perform hash calculation on the device serial number and timestamp data. The obtained hash value is compared with the hash value obtained by the second decryption unit. If the comparison is consistent, it means passing, otherwise it means failure; TOTP verification unit: used to perform TOTP verification, compare the absolute value of the difference between the current timestamp of the receiving end system and the timestamp in the decrypted data of the first decryption unit, if the absolute value of the difference is greater than the threshold, it means failure; if the absolute value of the difference is less than or equal to the threshold, it means passing; Identification unit: used to identify the device making the connection request as credible when the device hash signature verification results are consistent and TOTP verification passes.
