Trusted network connection identity authentication and secure communication method based on blockchain

By storing user public keys on the blockchain and generating session keys using the Diffie-Hellman algorithm, combining timestamps and hash value features to evaluate communication links, and utilizing a gradient boosting tree model for security assessment, the shortcomings of dynamic key exchange and link evaluation in existing schemes are addressed, achieving efficient communication security assurance.

CN120389845BActive Publication Date: 2025-10-28HEFEI TANOVO INFORMATION SECURITY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510596422.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-10-28
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

Existing blockchain-based identity authentication and communication security solutions fail to fully integrate dynamic key exchange mechanisms, making it difficult to effectively address man-in-the-middle attacks and replay attacks. They also lack systematic methods for assessing the stability and consistency of communication links and lack adaptive adjustment mechanisms, which affects the flexibility and security of the system.

Method used

The system uses blockchain to store user public keys, generates temporary session keys using the Diffie-Hellman algorithm, and evaluates the stability and consistency of the communication link by using timestamp deviation feature values ​​and consistency deviation feature values. It also combines a gradient boosting tree model to conduct a comprehensive security assessment and dynamically adjusts the session keys to deal with potential threats.

Benefits of technology

It improves communication security and response speed, can accurately identify and respond to potential attacks in a timely manner, ensures the confidentiality and integrity of data transmission, and enhances the system's adaptability and defense capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120389845B_ABST
    Figure CN120389845B_ABST
Patent Text Reader

Abstract

This invention relates to the field of network security technology, specifically disclosing a blockchain-based method for trusted network connection identity authentication and secure communication. First, during user registration, a public-private key pair is generated, and the public key is uploaded to a blockchain smart contract for storage via an encrypted channel. When a user requests a service, they sign a message containing authentication information using their private key. The service provider uses the public key on the blockchain to verify the signature's validity and confirm the user's identity. After successful authentication, both parties use the Diffie-Hellman algorithm to generate a temporary session key and transmit it encrypted using the user's public key, establishing a secure communication channel. To further evaluate the stability and consistency of the communication link, this invention calculates timestamp deviation and consistency deviation characteristics, and uses a gradient boosting tree model to comprehensively analyze these characteristics and output a communication security score. If an insecure situation is detected, the system automatically triggers a mechanism to regenerate and exchange a new session key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network security technology, specifically to a blockchain-based trusted network connection identity authentication and secure communication method. Background Technology

[0002] With the rapid development of information technology, cybersecurity has increasingly become a focus of attention across all sectors of society, especially in terms of identity authentication and data transmission security, where the need is becoming more urgent. Traditional network connection authentication methods often rely on centralized servers for storing and verifying user information. This approach not only faces the risk of single points of failure but also lacks sufficient data privacy protection, making it vulnerable to attacks or leaks. Blockchain technology, with its decentralized, immutable, and highly transparent characteristics, provides new ideas and technical means to solve these problems. By storing users' public keys on the blockchain and using smart contracts to automate the identity verification process, the security and reliability of the system can be significantly improved, while enhancing users' control over their personal data.

[0003] The existing technology has the following shortcomings:

[0004] However, existing blockchain-based identity authentication and communication security solutions still have some limitations. First, most solutions fail to fully integrate dynamic key exchange mechanisms, making it difficult to effectively address complex security threats such as man-in-the-middle attacks and replay attacks in practical applications. Second, there is a lack of systematic methods for assessing the stability and consistency of communication links; relying solely on simple threshold judgments cannot accurately quantify potential risks, thus affecting the overall security level. Furthermore, many existing systems lack adaptive adjustment mechanisms, failing to respond quickly and take action once security vulnerabilities are detected, which greatly limits the system's flexibility and security. Therefore, developing a new method that comprehensively covers the entire process from identity authentication to secure communication, and possesses efficient detection and immediate response capabilities, is particularly important. Summary of the Invention

[0005] The purpose of this invention is to provide a blockchain-based trusted network connection identity authentication and secure communication method to solve the problems mentioned above.

[0006] The objective of this invention can be achieved through the following technical solutions:

[0007] A blockchain-based trusted network connection authentication and secure communication method includes the following steps:

[0008] S1: When a user registers, a public-private key pair is generated, and the public key is uploaded to the blockchain smart contract for storage. When the user requests a service, the user signs the message containing authentication information with their private key and sends it to the service provider. The service provider uses the user's public key stored on the blockchain to verify the validity of the signature.

[0009] S2: After successful authentication, both parties use the Diffie-Hellman algorithm to generate and exchange temporary session keys. The service provider encrypts the session key and sends it to the user.

[0010] S3: After the user decrypts and obtains the session key, the difference between the timestamp when the key was generated and the current time is compared, and the timestamp deviation feature value is calculated to evaluate the stability of the communication link;

[0011] S4: Divide the session key into several fixed-length blocks, calculate the hash value of each block, statistically analyze the distribution of these hash values, and calculate the consistency deviation characteristic value of the key to evaluate the consistency of the communication link.

[0012] S5: Perform a comprehensive analysis of the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link. Based on the analysis results, determine whether the current communication link is secure. If the result is that the communication link is insecure, then regenerate and exchange a new session key mechanism.

[0013] As a further aspect of the present invention: the service provider verifies the validity of the signature using the user's public key stored on the blockchain, specifically including:

[0014] When a user requests a service, the user first signs the message containing authentication information using their private key, generating a digital signature. The digital signature, along with the original message, is sent to the service provider. Upon receiving the message and the digital signature, the service provider retrieves the user's public key from a smart contract on the blockchain. The service provider then uses this public key and the same signature algorithm to process the original message and calculate a signature value. If the calculated signature value matches the digital signature sent by the user, it proves that the message indeed came from the user with the corresponding private key and has not been tampered with during transmission, thus confirming the validity of the signature and the legitimacy of the user's identity.

[0015] As a further aspect of the present invention: the evaluation of the stability of the communication link specifically includes:

[0016] By comparing the difference between the timestamp when the key was generated and the current time, the timestamp deviation feature value is calculated. It is then determined whether the timestamp deviation feature value is greater than or equal to a preset threshold. If it is, the communication link is unstable; otherwise, the communication link is stable.

[0017] As a further aspect of the present invention: the process for obtaining the timestamp deviation feature value is as follows:

[0018] The process for obtaining the timestamp deviation feature value is as follows:

[0019] Obtain the historical key generation timestamp and the corresponding current timestamp, calculate the difference between the current timestamp and the generation timestamp to obtain the timestamp deviation;

[0020] Combine all the calculated timestamp deviations into a dataset;

[0021] Initialize cluster centers, including normal clusters and abnormal clusters, and iteratively update cluster centers. For each timestamp deviation in the dataset, assign it to the nearest cluster center and update the cluster center. Repeat the assignment and update steps until the cluster centers reach the maximum number of iterations.

[0022] The mean of each cluster is calculated using the mean calculation expression, and the variance of each cluster is calculated using the standard deviation calculation expression. A new timestamp bias is preset. ,calculate The distance to each cluster center is calculated, and the timestamp deviation characteristic value is calculated based on the standard deviation of each cluster and the distance to each cluster center from the new timestamp deviation.

[0023] As a further aspect of the present invention: the evaluation of the consistency of the communication link specifically includes:

[0024] The session key is divided into several fixed-length blocks, and the hash value of each block is calculated. The degree of distribution anomaly of these hash values ​​is statistically analyzed, and the consistency deviation characteristic value of the key is calculated. It is then determined whether the consistency deviation characteristic value of the key is greater than or equal to a preset threshold. If it is, the corresponding communication link is inconsistent; otherwise, the corresponding communication link is consistent.

[0025] As a further aspect of the present invention: the process for obtaining the consistency deviation feature value is as follows:

[0026] The process for obtaining the consistency deviation feature value is as follows:

[0027] The session key is divided into several fixed-length blocks, each block having a length of [length missing]. For each block, the SHA-256 secure hash algorithm is used to calculate its corresponding hash value; the occurrence count of hash values ​​for all blocks is counted, with a preset hash value space size of [value missing]. The ratio of the number of fixed-length blocks to the size of the hash value space is calculated to obtain the expected frequency of each hash value. Based on the difference between the actual observed frequency and the expected frequency, the chi-square statistic is calculated. According to the selected confidence level, the chi-square distribution table is looked up to find the corresponding critical value. The ratio of the chi-square statistic to the corresponding critical value is calculated to obtain the consistency deviation characteristic value.

[0028] As a further aspect of the present invention: the comprehensive analysis of the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link specifically includes:

[0029] The timestamp deviation feature value and consistency deviation feature value of the communication link are obtained, and the timestamp deviation feature value and consistency deviation feature value are constructed into a comprehensive feature vector, which is used as the input of the machine learning model. The training objective is to minimize the error between the predicted communication security score and the actual communication security score. Based on the trained model, the communication security score is output. The machine learning model is a gradient boosting tree model.

[0030] As a further aspect of the present invention: the training process of the machine learning model is as follows:

[0031] After constructing the feature vectors, a gradient boosting tree model is used for training. During training, the objective function is to minimize the error between the predicted communication security score and the actual communication security score. The gradient boosting tree model is an ensemble learning method that iteratively constructs multiple decision trees, and each new tree is dedicated to correcting the prediction errors of all previous trees, thereby gradually improving the overall performance of the model. Cross-validation technology is used, and the training set is divided multiple times, using different subsets of data for model training and validation.

[0032] As a further aspect of the present invention: the determination of whether the current communication link is secure specifically includes:

[0033] Determine whether the communication security score of the current communication link is greater than or equal to a preset threshold. If yes, the current communication link is secure; otherwise, the current communication link is insecure.

[0034] The beneficial effects of this invention are:

[0035] (1) This invention constructs a highly secure and reliable communication framework by integrating blockchain technology, advanced key exchange mechanisms, and sophisticated security assessment methods. First, during the user registration phase, blockchain technology is used to store the user's public key. This approach not only ensures the immutability and high availability of the public key but also greatly enhances the trust and security of the user authentication process. As a decentralized distributed ledger technology, blockchain's unique data structure and consensus algorithm guarantee that the information stored on the chain has extremely high transparency and tamper resistance, providing a solid foundation for subsequent authentication. In actual communication, this invention uses the Diffie-Hellman algorithm to dynamically generate temporary session keys and encrypts these keys using the user's public key. This strategy ensures that only the user holding the corresponding private key can decrypt and obtain the original session key content. This method not only effectively prevents man-in-the-middle attacks but also ensures that both parties can establish a secure communication channel without exposing long-term keys, thereby significantly improving the security and confidentiality of data transmission. Furthermore, to comprehensively evaluate the stability and consistency of the communication link, this invention introduces the concepts of timestamp deviation characteristic value and consistency deviation characteristic value. By analyzing the difference between the timestamp at the time of session key generation and the current time, a timestamp deviation feature value is calculated to assess the stability of the communication link. Simultaneously, the key is divided into several small blocks, and hash values ​​are calculated using the SHA-256 algorithm. Based on the distribution of these hash values, a consistency deviation feature value is calculated to assess the link's consistency. The calculation and application of these two feature values ​​enable the system to accurately identify potential attack behaviors (such as delay attacks or replay attacks) and take corresponding protective measures in the early stages, significantly improving the overall system's defense capabilities and response speed.

[0036] (2) This invention innovatively introduces a comprehensive security assessment method for communication links based on a gradient boosting tree model. This method constructs a comprehensive feature vector containing timestamp deviation feature values ​​and consistency deviation feature values ​​as input, and trains it with the goal of minimizing the error between the predicted communication security score and the actual communication security score, thereby achieving a rapid and accurate assessment of the security level of the communication link. Once the security score of the communication link is detected to be lower than a preset threshold, indicating a potential security threat, the system will automatically activate a mechanism to regenerate and exchange new session keys, ensuring timely adjustment of response strategies and effectively resisting security challenges such as delay attacks or replay attacks. This dynamic adaptation mechanism not only significantly improves the accuracy of security assessment, but also identifies and responds to potential security risks in the early stages, ensuring the confidentiality and integrity of data transmission. In addition, by using cross-validation technology to optimize model parameters, the stability and generalization ability of the system are further enhanced, giving the entire communication framework a high degree of adaptability and response speed, providing strong technical support for building a more secure and reliable data transmission environment. Attached Figure Description

[0037] The invention will now be further described with reference to the accompanying drawings.

[0038] Figure 1 This is a flowchart illustrating the specific steps of the blockchain-based trusted network connection identity authentication and secure communication method of the present invention. Detailed Implementation

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making any creative efforts shall fall within the scope of protection of the present invention.

[0040] Please see Figure 1 As shown, this invention is a blockchain-based trusted network connection identity authentication and secure communication method, comprising the following steps:

[0041] S1: When a user registers, a public-private key pair is generated, and the public key is uploaded to the blockchain smart contract for storage. When the user requests a service, the user signs the message containing authentication information with their private key and sends it to the service provider. The service provider uses the user's public key stored on the blockchain to verify the validity of the signature.

[0042] S2: After successful authentication, both parties use the Diffie-Hellman algorithm to generate and exchange temporary session keys. The service provider encrypts the session key and sends it to the user.

[0043] S3: After the user decrypts and obtains the session key, the difference between the timestamp when the key was generated and the current time is compared, and the timestamp deviation feature value is calculated to evaluate the stability of the communication link;

[0044] S4: Divide the session key into several fixed-length blocks, calculate the hash value of each block, statistically analyze the distribution of these hash values, and calculate the consistency deviation characteristic value of the key to evaluate the consistency of the communication link.

[0045] S5: Perform a comprehensive analysis of the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link. Based on the analysis results, determine whether the current communication link is secure. If the result is that the communication link is insecure, then regenerate and exchange a new session key mechanism.

[0046] In S1, a public-private key pair is generated during user registration, and the public key is uploaded to the blockchain smart contract for storage. When a user requests a service, they sign a message containing authentication information using their private key and send it to the service provider. The service provider verifies the validity of the signature using the user's public key stored on the blockchain, specifically including:

[0047] The client software uses a secure key generation algorithm to create the key pair, with the private key securely stored on the user's device to ensure it is not accessed or disclosed without authorization. The user uploads the generated public key to the blockchain network via encrypted communication and calls a smart contract interface to permanently record it on the blockchain. This process not only guarantees the immutability and high availability of the public key but also provides the foundation for subsequent authentication and data exchange.

[0048] The service provider verifies the validity of the signature using the user's public key stored on the blockchain, specifically including:

[0049] When a user requests a service, the user first signs the message containing authentication information using their private key, generating a digital signature. The digital signature, along with the original message, is sent to the service provider. Upon receiving the message and the digital signature, the service provider retrieves the user's public key from a smart contract on the blockchain. The service provider then uses this public key and the same signature algorithm to process the original message and calculate a signature value. If the calculated signature value matches the digital signature sent by the user, it proves that the message indeed came from the user with the corresponding private key and has not been tampered with during transmission, thus confirming the validity of the signature and the legitimacy of the user's identity.

[0050] In S2, after successful authentication, both parties use the Diffie-Hellman algorithm to generate and exchange temporary session keys. The service provider encrypts the session key and sends it to the user, specifically including:

[0051] After successful authentication, both parties first publicly share a set of parameters (such as large prime numbers and a base case), and then each independently chooses a private random number and calculates the corresponding public value based on it. Next, they exchange these public values ​​and combine the other party's public value with their own private random number using a specific formula to generate the same temporary session key at both ends. This process ensures that even if a third party intercepts all the exchanged information, they cannot easily deduce the session key.

[0052] After generating a temporary session key, the service provider encrypts it using the user's public key and sends it to the user. To achieve this, the service provider retrieves the user's public key from the blockchain, uses it to encrypt the session key, and ensures that only the corresponding private key holder (i.e., the user) can decrypt and obtain the original session key content. The encrypted session key is then transmitted to the user's end via a secure channel. Upon receiving the encrypted information, the user decrypts it using their private key to obtain the session key. In this way, both parties establish a secure communication channel based on symmetric encryption, enabling subsequent encrypted data transmission using the temporary session key, ensuring data confidentiality and integrity, and reducing the risk of key theft.

[0053] In S3, after the user decrypts and obtains the session key, the difference between the timestamp when the key was generated and the current time is compared. The timestamp deviation feature value is calculated to evaluate the stability of the communication link, specifically including:

[0054] By comparing the difference between the timestamp when the key was generated and the current time, the timestamp deviation feature value is calculated. It is then determined whether the timestamp deviation feature value is greater than or equal to a preset threshold. If it is, the communication link is unstable; otherwise, the communication link is stable.

[0055] The process for obtaining the timestamp deviation feature value is as follows:

[0056] Obtain the historical key generation timestamp and the corresponding current timestamp, calculate the difference between the current timestamp and the generation timestamp to obtain the timestamp deviation;

[0057] Combine all the calculated timestamp deviations into a dataset;

[0058] Initialize cluster centers ,in, Indicates the number of cluster centers. , preset The dataset includes normal and abnormal clusters. Cluster centers are iteratively updated. For each timestamp deviation in the dataset, it is assigned to the nearest cluster center. The calculation expression is: ;in, This indicates the number of timestamp discrepancies in the dataset. Represents the first in the dataset timestamp deviation Indicates the cluster center. Indicates will Assignment to make The smallest cluster center, express The cluster to which it belongs;

[0059] Update cluster centers, calculate the expression: ;in, Indicates the first The set of all timestamp deviations for each cluster center. Indicates the first The number of timestamp deviations for each cluster center is counted, and the assignment and update steps are repeated until the cluster centers reach the maximum number of iterations.

[0060] The mean of each cluster is calculated using the mean calculation expression, and the variance of each cluster is calculated using the standard deviation calculation expression. A new timestamp bias is preset. ,calculate The distance to each cluster center is calculated using the following expression: ;in, express Distance to each cluster center This represents the mean of each cluster; based on the standard deviation of each cluster and the distance from the new timestamp bias to the center of each cluster, the timestamp bias characteristic value is calculated, and the calculation expression is: ;in, This represents the characteristic value of timestamp deviation. This represents the standard deviation of each cluster.

[0061] It should be noted that by comparing the timestamp at the time of session key generation with the current time, a timestamp deviation feature value is calculated to assess the stability of the communication link. Cluster analysis is then used to classify and identify the timestamp deviation, distinguishing between normal and abnormal patterns. This method not only improves the accuracy of communication link stability assessment but also effectively identifies potential anomalies, such as delay attacks or replay attacks, thereby enhancing system security and reliability.

[0062] In S4, the session key is divided into several fixed-length blocks, and the hash value of each block is calculated. The distribution of these hash values ​​is statistically analyzed, and the consistency deviation characteristic value of the key is calculated to evaluate the consistency of the communication link. Specifically, this includes:

[0063] The session key is divided into several fixed-length blocks, and the hash value of each block is calculated. The degree of distribution anomaly of these hash values ​​is statistically analyzed, and the consistency deviation characteristic value of the key is calculated. It is then determined whether the consistency deviation characteristic value of the key is greater than or equal to a preset threshold. If it is, the corresponding communication link is inconsistent; otherwise, the corresponding communication link is consistent.

[0064] The process for obtaining the consistency deviation feature value is as follows:

[0065] The session key is divided into several fixed-length blocks, each block having a length of [length missing]. For each block, the SHA-256 secure hash algorithm is used to calculate its corresponding hash value; the occurrence count of hash values ​​for all blocks is counted, with a preset hash value space size of [value missing]. The expected frequency of each hash value is calculated by comparing the number of fixed-length blocks with the size of the hash space. Based on the difference between the actual observed frequency and the expected frequency, the chi-square statistic is calculated. The expression for this statistic is: In the formula, This represents the chi-square statistic. Indicates the first One hash value, Indicates the size of the space for the hash value. Indicates the first The number of times each hash value appears. Indicates the first The expected frequency of each hash value; calculate the degrees of freedom, the calculation expression is: ,in, Indicates degrees of freedom. This represents the spatial size after the hash values ​​are grouped. Based on the selected confidence level (95%), the chi-square distribution table is searched to find the corresponding critical value. The chi-square statistic is then compared with the corresponding critical value to obtain the consistency deviation characteristic value.

[0066] It should be noted that by dividing the session key used in the communication link into fixed-length blocks and calculating the hash value of each block using the SHA-256 algorithm, the consistency deviation characteristic value of the key is evaluated based on the distribution of the hash values, thereby effectively judging the consistency and security of the communication link. Statistical methods (chi-square test) are used to quantify the deviation between the actual and theoretical distributions of the key block hash values, serving as an important indicator of communication link consistency. This method not only improves the accuracy of detecting communication link anomalies but also enables the early detection of potential security threats, ensuring the confidentiality and integrity of data transmission.

[0067] In S5, the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link are comprehensively analyzed. Based on the analysis results, it is determined whether the current communication link is secure. If the determination result is an insecure communication link, a new session key mechanism is regenerated and exchanged, specifically including:

[0068] The timestamp deviation feature value and consistency deviation feature value of the communication link are obtained, and the timestamp deviation feature value and consistency deviation feature value are constructed into a comprehensive feature vector, which is used as the input of the machine learning model. The training objective is to minimize the error between the predicted communication security score and the actual communication security score. Based on the trained model, the communication security score is output. The machine learning model is a gradient boosting tree model.

[0069] The training process of the machine learning model is as follows:

[0070] After constructing the feature vectors, a gradient boosting tree model is used for training. During training, the objective function is to minimize the error between the predicted communication security score and the actual communication security score. The GBT model is an ensemble learning method that iteratively builds multiple decision trees, with each new tree working to correct the prediction errors of all previous trees, thereby gradually improving the overall performance of the model. To ensure the model's generalization ability and avoid overfitting, this embodiment employs cross-validation, dividing the training set multiple times and using different data subsets for model training and validation, ultimately determining the optimal configuration of the model parameters.

[0071] The determination of whether the current communication link is secure specifically includes:

[0072] Determine whether the communication security score of the current communication link is greater than or equal to a preset threshold. If yes, the current communication link is secure; otherwise, the current communication link is insecure. If the determination result is an insecure communication link, a new session key mechanism is regenerated and exchanged.

[0073] It should be noted that a well-trained gradient boosting tree model can quickly output a corresponding communication security score when it receives new communication link data. This score reflects the security level of the communication link; a higher score indicates more secure communication.

[0074] The working principle of this invention is as follows: During the user registration phase, a public-private key pair is generated, and the public key is uploaded to the blockchain smart contract for storage, ensuring the immutability and high availability of the public key and providing a solid foundation for subsequent identity verification and data exchange. When a user requests a service, they sign a message containing identity verification information using their private key and send it to the service provider; the service provider then uses the user's public key obtained from the blockchain to verify the validity of the signature and confirm the legitimacy of the user's identity. After successful identity verification, both parties generate and exchange a temporary session key using the Diffie-Hellman algorithm. The service provider encrypts this key and transmits it to the user through a secure channel, establishing a secure communication channel based on symmetric encryption. Furthermore, to evaluate the stability and consistency of the communication link, this invention proposes methods for calculating timestamp deviation and consistency deviation characteristics. For stability evaluation, the timestamp deviation characteristic is calculated by comparing the difference between the timestamp at the time of key generation and the current time, and cluster analysis is used to identify normal and abnormal patterns; for consistency evaluation, the key is divided into several small blocks, and the hash value is calculated using the SHA-256 algorithm. The consistency deviation characteristic is then evaluated based on the distribution of the hash values. By comprehensively analyzing the timestamp deviation and consistency deviation features, a comprehensive feature vector is constructed and used as input to the gradient boosting tree model. The model is trained to minimize the error between the predicted and actual communication security scores. The gradient boosting tree model can quickly output a communication security score, reflecting the security level of the communication link. If the communication link is determined to be insecure, a new session key needs to be generated and exchanged. This invention not only improves the accuracy of communication link security assessment but also promptly identifies and addresses potential security issues, ensuring the security and integrity of data transmission. Therefore, it provides strong technical support for building a more secure and reliable communication environment.

[0075] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A blockchain-based trusted network connection identity authentication and secure communication method, characterized in that, Includes the following steps: S1: When a user registers, a public-private key pair is generated, and the public key is uploaded to the blockchain smart contract for storage. When the user requests a service, the user signs the message containing authentication information with their private key and sends it to the service provider. The service provider uses the user's public key stored on the blockchain to verify the validity of the signature. S2: After successful authentication, both parties use the Diffie-Hellman algorithm to generate and exchange temporary session keys. The service provider encrypts the session key and sends it to the user. S3: After the user decrypts and obtains the session key, the difference between the timestamp when the key was generated and the current time is compared, and the timestamp deviation feature value is calculated to evaluate the stability of the communication link; S4: Divide the session key into several fixed-length blocks, calculate the hash value of each block, statistically analyze the distribution of these hash values, and calculate the consistency deviation characteristic value of the key to evaluate the consistency of the communication link. S5: Perform a comprehensive analysis of the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link. Based on the analysis results, determine whether the current communication link is secure. If the result is that the communication link is insecure, then regenerate and exchange a new session key mechanism.

2. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 1, characterized in that, The service provider verifies the validity of the signature using the user's public key stored on the blockchain, specifically including: When a user requests a service, the user first signs the message containing authentication information using their private key, generating a digital signature. The digital signature, along with the original message, is sent to the service provider. Upon receiving the message and the digital signature, the service provider retrieves the user's public key from a smart contract on the blockchain. The service provider then uses this public key and the same signature algorithm to process the original message and calculate a signature value. If the calculated signature value matches the digital signature sent by the user, it proves that the message indeed came from the user with the corresponding private key and has not been tampered with during transmission, thus confirming the validity of the signature and the legitimacy of the user's identity.

3. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 1, characterized in that, The evaluation of the stability of the communication link specifically includes: By comparing the difference between the timestamp when the key was generated and the current time, the timestamp deviation feature value is calculated. It is then determined whether the timestamp deviation feature value is greater than or equal to a preset threshold. If it is, the communication link is unstable; otherwise, the communication link is stable.

4. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 3, characterized in that, The process for obtaining the timestamp deviation feature value is as follows: The process for obtaining the timestamp deviation feature value is as follows: Obtain the historical key generation timestamp and the corresponding current timestamp, calculate the difference between the current timestamp and the generation timestamp to obtain the timestamp deviation; Combine all the calculated timestamp deviations into a dataset; Initialize cluster centers, including normal clusters and abnormal clusters, and iteratively update cluster centers. For each timestamp deviation in the dataset, assign it to the nearest cluster center and update the cluster center. Repeat the assignment and update steps until the cluster centers reach the maximum number of iterations. The mean of each cluster is calculated using the mean calculation expression, and the variance of each cluster is calculated using the standard deviation calculation expression. A new timestamp bias is preset. ,calculate The distance to each cluster center is calculated, and the timestamp deviation characteristic value is calculated based on the standard deviation of each cluster and the distance to each cluster center from the new timestamp deviation.

5. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 1, characterized in that, The evaluation of the consistency of the communication link specifically includes: The session key is divided into several fixed-length blocks, and the hash value of each block is calculated. The degree of abnormality in the distribution of these hash values ​​is statistically analyzed. The consistency deviation characteristic value of the key is calculated, and it is determined whether the consistency deviation characteristic value of the key is greater than or equal to a preset threshold. If it is, the corresponding communication link is inconsistent; otherwise, the corresponding communication link is consistent.

6. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 5, characterized in that, The process for obtaining the consistency deviation feature value is as follows: The process for obtaining the consistency deviation feature value is as follows: The session key is divided into several fixed-length blocks, each block having a length of [length missing]. For each block, the SHA-256 secure hash algorithm is used to calculate its corresponding hash value; the occurrence count of hash values ​​for all blocks is counted, with a preset hash value space size of [value missing]. The ratio of the number of fixed-length blocks to the size of the hash value space is calculated to obtain the expected frequency of each hash value. Based on the difference between the actual observed frequency and the expected frequency, the chi-square statistic is calculated. According to the selected confidence level, the chi-square distribution table is looked up to find the corresponding critical value. The ratio of the chi-square statistic to the corresponding critical value is calculated to obtain the consistency deviation characteristic value.

7. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 1, characterized in that, The comprehensive analysis of the timestamp deviation characteristic value and consistency deviation characteristic value of the communication link specifically includes: The timestamp deviation feature value and consistency deviation feature value of the communication link are obtained, and the timestamp deviation feature value and consistency deviation feature value are constructed into a comprehensive feature vector, which is used as the input of the machine learning model. The training objective is to minimize the error between the predicted communication security score and the actual communication security score. Based on the trained model, the communication security score is output. The machine learning model is a gradient boosting tree model.

8. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 7, characterized in that, The training process of the machine learning model is as follows: After constructing the feature vectors, a gradient boosting tree model is used for training. During training, the objective function is to minimize the error between the predicted communication security score and the actual communication security score. The gradient boosting tree model is an ensemble learning method that iteratively constructs multiple decision trees, and each new tree is dedicated to correcting the prediction errors of all previous trees, thereby gradually improving the overall performance of the model. Cross-validation technology is used, and the training set is divided multiple times, using different subsets of data for model training and validation.

9. The blockchain-based trusted network connection identity authentication and secure communication method according to claim 1, characterized in that, The determination of whether the current communication link is secure specifically includes: Determine whether the communication security score of the current communication link is greater than or equal to a preset threshold. If yes, the current communication link is secure; otherwise, the current communication link is insecure.

Citation Information

Patent Citations

  • Internet of Things trusted data management method based on block chain technology

    CN113553574A

  • Authentication method and system of security terminal based on blockchain

    CN113824570A