A chat security communication method and system based on dynamic key
By detecting abnormal node behavior through distributed chat tools, establishing a dynamic key update evaluation model, adjusting node weights and priorities, and using a dynamic key exchange protocol, the centralization risks and inflexible key management problems of existing chat tools are solved, achieving efficient and secure chat communication.
Patent Information
- Application Number
- CN202411408054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Existing chat tools have risks of centralized servers, inflexible key management, and long-term use of the same key increases the risk of cracking. The stability of communication between nodes and the quality of data transmission affect the security and reliability of the system.
Using distributed chat tools, we detect abnormal node behavior, establish a dynamic key update evaluation model, adjust node weights and priorities, use dynamic key exchange protocols for encryption and decryption, verify that old keys cannot decrypt new messages, and ensure that keys are updated in a timely manner when potential threats occur.
It enhances the security and reliability of the system, optimizes the key update frequency, improves the efficiency and security of key distribution, prevents the risk of decrypting new messages after the old key is leaked, and ensures high-security communication.
Smart Images

Figure CN119299091B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more particularly to a chat security communication method and system based on a dynamic key. Background Art
[0002] Dynamic keys are encryption keys that change continuously during communication, enhancing the security of data transmission. Secure chat communication refers to the use of encryption technology within chat applications to protect user message content, ensuring that only the communicating parties can read the information and preventing unauthorized third parties from eavesdropping or tampering with the data. Many modern chat tools, such as WhatsApp and Signal, utilize end-to-end encryption, but security risks still exist. These include reliance on centralized servers for data processing and storage, creating single points of failure and the risk of server attacks; inflexible key management, with the prolonged use of the same key increasing the likelihood of key cracking; and inter-node communication stability and data transmission quality, which directly impact the overall security and reliability of the system. Summary of the Invention
[0003] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a chat security communication method and system based on dynamic keys to solve the problems raised in the above-mentioned background technology.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] The chat secure communication method using a dynamic key comprises the following steps:
[0006] Step S1: Create a distributed chat tool, analyze the interaction patterns between nodes, detect abnormal behaviors between nodes, and determine whether the dynamic key needs to be updated;
[0007] Step S2: Analyze the encryption load, key operation success rate, and time synchronization accuracy, establish a dynamic key update evaluation model, and determine the dynamic key update time window;
[0008] Step S3: Analyze the stability of node connections and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process based on the stability of node connections and the quality of historical data transmission, and confirm the node priority;
[0009] Step S4: Based on the node priority and the updated dynamic key, the distributed chat tool system encrypts the original message sent by the message sender and decrypts the encrypted message received by the message receiver;
[0010] Step S5: Verify the dynamic key before the update to ensure that the dynamic key before the update cannot decrypt the encrypted message.
[0011] In a preferred embodiment, in step S1, the distributed chat tool adopts a decentralized network structure, consisting of multiple nodes, each of which is both a client and a server;
[0012] Nodes in the distributed chat tool record all communication behaviors with other nodes, including information about each message sent and received. This information is stored in local log files. Interaction data is extracted from the log files and segmented into units of time based on different types of interaction data. The characteristic values of the number of message transmissions, message size, timestamp, and number of message errors per unit time are calculated, including message transmission frequency, average message size, node response time, and message error rate.
[0013] Abnormal behavior refers to the behavior between nodes that deviates from the normal interaction pattern, including abnormal message transmission frequency, abnormal message size, long periods of node unresponsiveness, and excessive number of message errors. Abnormal behavior is defined by four threshold parameters: message transmission frequency threshold, average message size threshold, node response time threshold, and message error rate threshold.
[0014] Detect abnormal behavior, specifically:
[0015] When the message transmission frequency is greater than or equal to the message transmission frequency threshold, it indicates that the message transmission frequency between nodes is abnormal, which may indicate that the node is under attack;
[0016] When the average message size is greater than or equal to the average message size threshold, it indicates that the size of messages transmitted between nodes is abnormal;
[0017] When the node response time is greater than or equal to the node response time threshold, it indicates that there is an abnormality due to a long period of no response between nodes;
[0018] When the message error rate is greater than or equal to the message error rate threshold, it indicates that the number of message errors transmitted between nodes is too large and an abnormality has occurred;
[0019] In order to accurately determine whether a node has abnormal behavior, the deviation values of message transmission frequency, average message size, node response time, and message error rate are calculated respectively. The abnormal comprehensive score is calculated by weighted summation based on the deviation values of message transmission frequency, average message size, node response time, and message error rate. The abnormal comprehensive score threshold is set, and the abnormal comprehensive score and the abnormal comprehensive score threshold are compared and analyzed. When the abnormal comprehensive score is greater than or equal to the abnormal comprehensive score threshold, the node is judged to have abnormal behavior.
[0020] When abnormal behavior of a node is detected, it is necessary to determine whether to perform a dynamic key update. The conditions for determining the dynamic key update include: the frequency of abnormal behavior, the frequency of abnormal behavior types, and the severity of abnormal behavior; a comprehensive analysis is performed on the frequency of abnormal behavior, the frequency of abnormal behavior types, and the severity of abnormal behavior, and a dynamic key update requirement value is obtained by calculation. A dynamic key update threshold is preset, and the dynamic key update requirement value is compared with the dynamic key update threshold. When the dynamic key update requirement value is greater than or equal to the dynamic key update threshold, the dynamic key needs to be updated.
[0021] In a preferred embodiment, in step S2, the encryption load refers to the number of encryption operations and decryption operations processed by the node per unit time, including the number of encryption operations and the number of decryption operations; during operation, each node collects the number of encryption operations and decryption operations in real time through a system monitoring tool of a distributed chat tool, analyzes the collected data on the number of encryption operations and decryption operations, and calculates the encryption load value;
[0022] Define key operation parameters, including the number of key generation times, the number of key distribution times, and the number of successful key uses. The key operation success rate refers to the ratio of the number of successful key uses to the sum of the number of key generation times and the number of key distribution times within a preset unit time;
[0023] The time synchronization accuracy refers to the accuracy of time synchronization between each node of the distributed chat tool, including time deviation and time synchronization frequency. Within a preset time period, the node clock time and reference clock time of each node are counted, and the time deviation is calculated as the ratio of the difference between the node clock time of each node and the reference clock time to the total number of nodes. The time synchronization accuracy is calculated based on the time deviation.
[0024] The dynamic key update time window refers to the most appropriate key update time interval determined by the distributed chat tool system based on a comprehensive analysis of the encryption load, key operation success rate, and time synchronization accuracy; the time interval includes a window start time and a window end time; the window start time is the predicted start time of the key update time window; the window end time is the predicted end time of the key update time window;
[0025] Normalizing the encryption payload value, key operation success rate, and time synchronization accuracy, and assigning preset proportional coefficients to the normalized encryption payload value, key operation success rate, and time synchronization accuracy, respectively, to establish a dynamic key update evaluation model for determining a dynamic key update time window;
[0026] During the operation of the node, the real-time monitored encryption load value, key operation success rate and time synchronization accuracy are input into the dynamic key update evaluation model to calculate the dynamic key update time window, that is, the most appropriate key update time interval; the window start time is determined according to the current time of the node and the calculated key update time interval, and the window end time is based on the window start time plus the preset key update time interval. The key update time interval is set according to the specific needs of the distributed chat tool system.
[0027] In a preferred embodiment, in step S3:
[0028] Node connection stability refers to the ability of a node to remain online over a period of time. Within a preset time window, the time it takes for a node to drop and reconnect, as well as the number of node disconnections, are counted. The average node recovery time is calculated based on the time it takes for a node to drop and reconnect, and the number of node disconnections.
[0029] The system monitoring tool of the distributed chat tool is used to collect historical data transmission results, historical data sending time, and historical data confirmation time, and the transmission quality index is calculated based on the historical data transmission results, historical data sending time, and historical data confirmation time;
[0030] The weighted average method is used to calculate the average node recovery time and transmission quality index to obtain the comprehensive weight. All nodes are sorted from high to low according to the comprehensive weight, and the node priority is assigned according to the sorting result.
[0031] In a preferred embodiment, in step S4, the system of the distributed chat tool uses a dynamic key exchange protocol to generate a new key, including a public key and a private key pair. The system sends a key update notification to the relevant nodes according to the node priority. The notification includes the new public key, key identifier and the timestamp of the key update. After receiving the new key notification, the node verifies the validity of the new key, including checking the new public key, key identifier and the timestamp of the key update, and updates the local key after the verification is passed.
[0032] The distributed chat tool system uses advanced encryption algorithms and updated keys to encrypt the original information sent by the sender, generating encrypted information and authentication tags. After the recipient receives the encrypted information, the system uses advanced encryption algorithms and updated keys to decrypt the received encrypted information to obtain the original information and verify the authentication tag at the same time. During the decryption process, the system will verify whether the authentication tag matches to ensure data integrity. If the verification fails, the system will discard the encrypted information and record the security incident.
[0033] In a preferred embodiment, in step S5, the dynamic key before the update is obtained, and the system uses the advanced encryption algorithm and the key before the update to decrypt the encrypted information; if the decryption of the dynamic key before the update fails, the system records the decryption result and continues to use the new key to encrypt the sent information, which means that the dynamic key update is successful, ensuring the security of the transmission process; if the decryption of the dynamic key before the update is successful, the system records the abnormal event of successful decryption, and immediately rolls back the dynamic key update, and re-determines the dynamic key update time window.
[0034] The technical effects and advantages of the method of the present invention are:
[0035] 1. By evaluating the interaction mode of nodes and detecting abnormal behaviors between nodes, it is determined whether dynamic keys need to be updated. By establishing a dynamic key update evaluation model and determining the dynamic key update time window, it is possible to detect and respond to abnormal behaviors in a timely manner, ensuring that keys are updated in a timely manner when potential security threats exist, thereby enhancing the security of the system, optimizing the frequency of key updates, avoiding unnecessary frequent updates, saving system resources, and ensuring that a high level of secure communication can be maintained in different network environments.
[0036] 2. Node priority is determined based on the stability of node connections and historical data transmission quality, ensuring that nodes with stable connections and high transmission quality are prioritized during key distribution, improving the efficiency and security of key distribution. Updated dynamic keys are used to encrypt and decrypt information, ensuring secure transmission within distributed chat tools. The mechanism for dynamically adjusting node weights and priorities enables the system to flexibly adapt to different network environments, enhancing system reliability and overall performance.
[0037] 3. By verifying that the dynamic key before the update cannot decrypt encrypted messages, the risk of leaked old keys still being able to decrypt new messages is effectively prevented, ensuring the high security of communications after each key update. This verification mechanism can promptly detect and address potential vulnerabilities during the key update process, improving the system's overall security capabilities. By automatically verifying the validity of old keys, the need for manual intervention is reduced, enhancing system automation and ensuring the continuity and stability of secure chat communications. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Schematic diagram of a secure chat communication method based on dynamic keys according to the present invention;
[0039] Figure 2 The diagram is a structural diagram of a chat security communication system based on dynamic keys according to the present invention. DETAILED DESCRIPTION
[0040] The following will provide a clear and complete description of 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0041] Reference Figure 1-Figure 2 .
[0042] The embodiment provides a chat security communication method based on a dynamic key of the present invention, which includes the following steps:
[0043] Step S1: Create a distributed chat tool, analyze the interaction patterns between nodes, detect abnormal behaviors between nodes, and determine whether the dynamic key needs to be updated;
[0044] Step S2: Analyze the encryption load, key operation success rate, and time synchronization accuracy, establish a dynamic key update evaluation model, and determine the dynamic key update time window;
[0045] Step S3: Analyze the stability of node connections and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process based on the stability of node connections and the quality of historical data transmission, and confirm the node priority;
[0046] Step S4: Based on the node priority and the updated dynamic key, the distributed chat tool system encrypts the original message sent by the message sender and decrypts the encrypted message received by the message receiver;
[0047] Step S5: Verify the dynamic key before the update to ensure that the dynamic key before the update cannot decrypt the encrypted message.
[0048] In step S1, a distributed chat tool is created. The distributed chat tool adopts a decentralized network structure and is composed of multiple nodes. Each node is both a client and a server. When the node is initialized, each node will generate and broadcast its node identifier and node address, allowing other nodes to discover and connect, without affecting the existing communication security and system performance; the interaction mode between the nodes refers to the communication behavior between the nodes. The communication behavior between the nodes will generate a large amount of interaction data, and the interaction data mainly includes the number of message transmissions, message size, timestamp and number of message errors; the number of message transmissions is the number of times the node sends and receives messages; the message size is the data size of each message sent and received by the node, usually in bytes; the timestamp is the time when the node sends and receives the message, usually in milliseconds; the number of message errors is the number of errors that occur in the node during the communication process, such as message loss, message timeout, etc.
[0049] Analyze the interaction patterns between nodes to obtain the message transmission frequency, average message size, node response time and message error rate. Specifically, the nodes in the distributed chat tool record all communication behaviors with other nodes, including information about each message sent and received. This information is stored in a local log file. The log file contains information such as the number of message transmissions, message size, timestamp and number of message errors. The interaction data is extracted from the log file, and the interaction data is segmented by setting a unit time according to different types of interaction data. The characteristic values of the number of message transmissions, message size, timestamp and number of message errors per unit time are calculated, including the message transmission frequency, average message size, node response time and message error rate; the unit time is set to one minute.
[0050] Abnormal behavior refers to the behavior between nodes that deviates from the normal interaction mode, including abnormal message transmission frequency, abnormal message size, long-term node non-response and excessive number of message errors; abnormal behavior is defined by four threshold parameters: message transmission frequency threshold, average message size threshold, node response time threshold and message error rate threshold.
[0051] Detect abnormal behavior, specifically:
[0052] When the message transmission frequency is greater than or equal to the message transmission frequency threshold, it indicates that the message transmission frequency between nodes is abnormal, which may indicate that the node is under attack;
[0053] When the average message size is greater than or equal to the average message size threshold, it indicates that the message size transmitted between nodes is abnormal, indicating that the node is sending or receiving files of abnormal size, which may be caused by data leakage or illegal file transfer;
[0054] When the node response time is greater than or equal to the node response time threshold, it indicates that there is an abnormality in the long period of no response between nodes, which may indicate that the node performance is degraded and network congestion occurs;
[0055] When the message error rate is greater than or equal to the message error rate threshold, it indicates that the number of message errors transmitted between nodes is too large and abnormal, which may indicate that the communication between nodes is disturbed, data packets are lost, or there is a node failure;
[0056] In order to accurately determine whether a node has abnormal behavior, the deviation values of message transmission frequency, average message size, node response time and message error rate are calculated respectively. The abnormal comprehensive score is calculated by weighted summation based on the deviation values of message transmission frequency, average message size, node response time and message error rate. The abnormal comprehensive score threshold is set, and the abnormal comprehensive score and the abnormal comprehensive score threshold are compared and analyzed. When the abnormal comprehensive score is greater than or equal to the abnormal comprehensive score threshold, it is judged that the node has abnormal behavior.
[0057] When abnormal behavior is detected in a node, it is necessary to determine whether to perform a dynamic key update. The conditions for determining the dynamic key update include: abnormal behavior frequency, abnormal behavior type frequency and abnormal behavior severity; the abnormal behavior frequency refers to the number of abnormal behaviors detected within a specific time interval; the abnormal behavior type frequency refers to the number of abnormal behavior types detected within a specific time interval; the abnormal behavior severity is scored based on the impact of the abnormal behavior on the security of the chat tool.
[0058] A comprehensive analysis is conducted on the frequency of abnormal behaviors, the frequency of abnormal behavior types, and the severity of abnormal behaviors. The dynamic key update requirement value is obtained by calculation, and a dynamic key update threshold is preset. The dynamic key update requirement value is compared with the dynamic key update threshold. When the dynamic key update requirement value is greater than or equal to the dynamic key update threshold, the distributed chat tool is in a high-risk state and may be attacked and destroyed, resulting in serious consequences such as user data leakage and communication content being spread. Abnormal behavior of nodes will not only consume the system resources of the distributed chat tool, but may also cause a significant decline in system performance, thereby affecting the normal use of users, and thus it is determined that the dynamic key needs to be updated at this time.
[0059] In step S2: the encryption load refers to the number of encryption operations and decryption operations processed by the node per unit time, including the number of encryption operations and the number of decryption operations; the number of encryption operations is the number of encryption operations performed by the distributed chat tool system per unit time; the number of decryption operations is the number of decryption operations performed by the distributed chat tool system per unit time.
[0060] During the operation of each node, the system monitoring tool of the distributed chat tool is used to collect the number of encryption operations and decryption operations in real time, and the collected data of the encryption operations and decryption operations are analyzed to calculate the encryption load value. Specifically, a sliding time window is preset, and the number of encryption operations and decryption operations within the sliding time window are counted. The sum of the number of encryption operations and the number of decryption operations is compared with the sliding time window to calculate the encryption load value.
[0061] Define key operation parameters, including the number of key generation times, the number of key distribution times, and the number of successful key uses; the key generation times is the number of keys generated within a preset unit time; the key distribution times is the number of keys distributed within a preset unit time; the successful key uses are the number of times the key is successfully used for encryption or decryption within a preset unit time; calculate the key operation success rate, specifically: the key operation success rate refers to the ratio of the number of successful key uses to the sum of the number of key generation times and the number of key distribution times within a preset unit time.
[0062] The time synchronization accuracy refers to the accuracy of time synchronization between each node of the distributed chat tool, including time deviation and time synchronization frequency; the time deviation is the deviation between the node clock and the reference clock; the time synchronization frequency is the number of times time synchronization is performed within a preset time period.
[0063] During a preset time period, the node clock time and reference clock time of each node are counted, and the ratio of the difference between the node clock time of each node and the reference clock time and the total number of nodes is calculated to obtain the time deviation. The time synchronization accuracy is calculated based on the time deviation.
[0064] The dynamic key update time window refers to the most appropriate key update time interval determined by the distributed chat tool system after comprehensive analysis of the encryption load, key operation success rate and time synchronization accuracy; the time interval includes the window start time and the window end time; the window start time is the predicted start time of the key update time window; the window end time is the predicted end time of the key update time window.
[0065] The encryption load value, key operation success rate and time synchronization accuracy are normalized, and the normalized encryption load value, key operation success rate and time synchronization accuracy are assigned preset proportional coefficients respectively to establish a dynamic key update evaluation model for determining the dynamic key update time window.
[0066] During the operation of the node, the real-time monitored encryption load value, key operation success rate and time synchronization accuracy are input into the dynamic key update evaluation model to calculate the dynamic key update time window, that is, the most appropriate key update time interval; the window start time is determined according to the current time of the node and the calculated key update time interval, and the window end time is based on the window start time plus the preset key update time interval. The key update time interval is set according to the specific needs of the distributed chat tool system.
[0067] By analyzing the encryption load, key operation success rate and time synchronization accuracy, the optimal update time window for dynamic keys is determined, which improves the security and stability of the system.
[0068] In step S3: The stability of the node connection is an important indicator for determining the node priority. A stable node connection can be continuously online in the network, reducing communication interruptions caused by frequent disconnections, ensuring the continuity and reliability of the key distribution process, and avoiding potential security risks during key updates. A stably connected node means that the node can quickly respond to key distribution requests, improving distribution efficiency, thereby improving the security and reliability of the entire distributed chat system.
[0069] The stability of node connection refers to the ability of a node to remain online for a period of time. Within a preset time window, the time it takes for a node to drop offline and reconnect, as well as the number of node disconnections, are counted. The average node recovery time is calculated based on the time it takes for a node to drop offline and reconnect, and the number of node disconnections.
[0070] The quality of historical data transmission plays an important role in confirming node priority. By analyzing the node's data transmission success rate and data transmission delay over the past period of time, the node's transmission reliability and efficiency can be evaluated. A high data transmission success rate and low data transmission delay indicate that the node is stable and reliable during the data transmission process. These nodes have higher weights and priorities in the dynamic key distribution process.
[0071] The system monitoring tool of the distributed chat tool is used to collect historical data transmission results, historical data sending time, and historical data confirmation time. The transmission quality index is calculated based on the historical data transmission results, historical data sending time, and historical data confirmation time. The larger the transmission quality index, the higher the transmission quality of the node's historical data.
[0072] The weighted average method is used to calculate the average node recovery time and transmission quality index to obtain the comprehensive weight; node priority refers to the dynamic key distribution priority determined according to the comprehensive weight during the dynamic key distribution process. The higher the priority, the higher the priority of the node in the dynamic key distribution process; all nodes are sorted from high to low according to the comprehensive weight, and the node priority is assigned according to the sorting result.
[0073] During the dynamic key distribution process, the distributed chat tool system gives priority to nodes with high priority for dynamic key distribution to ensure the efficiency and reliability of dynamic key distribution.
[0074] In step S4, the system of the distributed chat tool uses a dynamic key exchange protocol to generate a new key, including a public key and a private key pair. The system sends a key update notification to the relevant nodes according to the node priority. The notification includes the new public key, key identifier and the timestamp of the key update. After receiving the new key notification, the node verifies the validity of the new key, including checking the new public key, key identifier and the timestamp of the key update, and updates the local key after the verification is passed.
[0075] The system of the distributed chat tool uses an advanced encryption algorithm and an updated key to encrypt the original information sent by the sender, generating encrypted information and an authentication tag. After the recipient receives the encrypted information, the system uses the advanced encryption algorithm and the updated key to decrypt the received encrypted information to obtain the original information and verify the authentication tag at the same time. During the decryption process, the system will verify whether the authentication tag matches to ensure data integrity. If the verification fails, the system will discard the encrypted information and record the security incident. The key is distributed through a distributed network to avoid single point failures and improve the reliability of the distributed chat tool.
[0076] In step S5: the dynamic key before the update is obtained, and the system uses the advanced encryption algorithm and the key before the update to decrypt the encrypted information; if the decryption of the dynamic key before the update fails, the system records the decryption result and continues to use the new key to encrypt the sent information, which means that the dynamic key update is successful, ensuring the security of the transmission process; if the decryption of the dynamic key before the update is successful, the system records the abnormal event of successful decryption, and immediately rolls back the dynamic key update, re-determines the dynamic key update time window, and ensures the security of user chat communications.
[0077] The present invention discloses a multi-tenant resource sharing system based on big data, comprising: a key update module, a message delivery module and a verification module;
[0078] Key update module: determines whether dynamic keys need to be updated based on the interaction pattern between nodes and abnormal behavior between nodes. It also determines the dynamic key update time window by establishing a dynamic key update evaluation model.
[0079] Message delivery module: Analyzes the stability of node connections and the quality of historical data transmission, adjusts the weight of nodes in the dynamic key distribution process, and confirms node priority. Based on the node priority and the updated dynamic key, the distributed chat tool system encrypts the original message sent by the sender and decrypts the encrypted message received by the receiver to achieve information delivery.
[0080] Verification module: Verifies the dynamic key before the update to ensure that the dynamic key before the update cannot decrypt the encrypted message.
[0081] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0082] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0083] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules 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 modules, which can be electrical, mechanical or other forms.
[0085] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0086] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0087] If the functions are implemented in the form of software function modules and sold or used as independent products, they 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 the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0088] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0089] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A chat security communication method based on dynamic keys, characterized in that: The following steps are involved: Step S1: Create a distributed chat tool, analyze the interaction patterns between nodes, detect abnormal behaviors between nodes, and determine whether the dynamic key needs to be updated; Step S2: Analyze the cryptographic load, key operation success rate, and time synchronization accuracy, establish a dynamic key update evaluation model, and determine the dynamic key update time window; the cryptographic load refers to the number of encryption and decryption operations processed by a node per unit time, including the number of encryption operations and the number of decryption operations; the key operation success rate refers to the ratio of the number of successful key uses to the sum of the number of key generation times and the number of key distribution times within a preset unit time; Step S3: Analyze the stability of node connections and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process based on the stability of node connections and the quality of historical data transmission, and confirm the node priority; Step S4: Based on the node priority and the updated dynamic key, the distributed chat tool system encrypts the original message sent by the message sender and decrypts the encrypted message received by the message receiver; Step S5: Verify the dynamic key before the update to ensure that the dynamic key before the update cannot decrypt the encrypted message.
2. A chat secure communication method based on dynamic keys according to claim 1, characterized in that: In step S1: The distributed chat tool adopts a decentralized network structure, consisting of multiple nodes, each of which is both a client and a server; Nodes in the distributed chat tool record all communication behaviors with other nodes, including information about each message sent and received. This information is stored in local log files. Interaction data is extracted from the log files and segmented into units of time based on different types of interaction data. The characteristic values of the number of message transmissions, message size, timestamp, and number of message errors per unit time are calculated, including message transmission frequency, average message size, node response time, and message error rate. Abnormal behavior refers to the behavior between nodes that deviates from the normal interaction pattern, including abnormal message transmission frequency, abnormal message size, long periods of node unresponsiveness, and excessive number of message errors. Abnormal behavior is defined by four threshold parameters: message transmission frequency threshold, average message size threshold, node response time threshold, and message error rate threshold. Detect abnormal behavior, specifically: When the message transmission frequency is greater than or equal to the message transmission frequency threshold, it indicates that the message transmission frequency between nodes is abnormal, which may indicate that the node is under attack; When the average message size is greater than or equal to the average message size threshold, it indicates that the size of messages transmitted between nodes is abnormal; When the node response time is greater than or equal to the node response time threshold, it indicates that there is an abnormality due to a long period of no response between nodes; When the message error rate is greater than or equal to the message error rate threshold, it indicates that the number of message errors transmitted between nodes is too large and an abnormality has occurred; In order to accurately determine whether a node has abnormal behavior, the deviation values of message transmission frequency, average message size, node response time, and message error rate are calculated respectively. The abnormal comprehensive score is calculated by weighted summation based on the deviation values of message transmission frequency, average message size, node response time, and message error rate. The abnormal comprehensive score threshold is set, and the abnormal comprehensive score and the abnormal comprehensive score threshold are compared and analyzed. When the abnormal comprehensive score is greater than or equal to the abnormal comprehensive score threshold, the node is judged to have abnormal behavior. When abnormal behavior of a node is detected, it is necessary to determine whether to perform a dynamic key update. The dynamic key update determination conditions include: abnormal behavior frequency, abnormal behavior type frequency, and abnormal behavior severity; A comprehensive analysis is performed on the frequency of abnormal behavior, the frequency of abnormal behavior types, and the severity of abnormal behavior. The dynamic key update requirement value is obtained by calculation, and a dynamic key update threshold is preset. The dynamic key update requirement value is compared with the dynamic key update threshold. When the dynamic key update requirement value is greater than or equal to the dynamic key update threshold, the dynamic key needs to be updated.
3. A chat secure communication method based on dynamic keys according to claim 2, characterized in that: In step S2: During operation, each node collects the number of encryption and decryption operations in real time through the system monitoring tool of the distributed chat tool, analyzes the collected data of encryption and decryption operations, and calculates the encryption load value; Define key operation parameters, including key generation times, key distribution times, and key successful usage times; The time synchronization accuracy refers to the accuracy of time synchronization between each node of the distributed chat tool, including time deviation and time synchronization frequency. Within a preset time period, the node clock time and reference clock time of each node are counted, and the time deviation is calculated as the ratio of the difference between the node clock time of each node and the reference clock time to the total number of nodes. The time synchronization accuracy is calculated based on the time deviation. The dynamic key update time window refers to the most appropriate key update time interval determined by the distributed chat tool system based on a comprehensive analysis of the encryption load, key operation success rate, and time synchronization accuracy; the time interval includes a window start time and a window end time; the window start time is the predicted start time of the key update time window; the window end time is the predicted end time of the key update time window; Normalizing the encryption payload value, key operation success rate, and time synchronization accuracy, and assigning preset proportional coefficients to the normalized encryption payload value, key operation success rate, and time synchronization accuracy, respectively, to establish a dynamic key update evaluation model for determining a dynamic key update time window; During the operation of the node, the real-time monitored encryption load value, key operation success rate and time synchronization accuracy are input into the dynamic key update evaluation model to calculate the dynamic key update time window, that is, the most appropriate key update time interval; the window start time is determined according to the current time of the node and the calculated key update time interval, and the window end time is based on the window start time plus the preset key update time interval. The key update time interval is set according to the specific needs of the distributed chat tool system.
4. A chat secure communication method based on dynamic keys according to claim 3, characterized in that: In step S3: Node connection stability refers to the ability of a node to remain online over a period of time. Within a preset time window, the time it takes for a node to drop and reconnect, as well as the number of node disconnections, are counted. The average node recovery time is calculated based on the time it takes for a node to drop and reconnect, and the number of node disconnections. The system monitoring tool of the distributed chat tool is used to collect historical data transmission results, historical data sending time, and historical data confirmation time, and the transmission quality index is calculated based on the historical data transmission results, historical data sending time, and historical data confirmation time; The weighted average method is used to calculate the average node recovery time and transmission quality index to obtain the comprehensive weight. All nodes are sorted from high to low according to the comprehensive weight, and the node priority is assigned according to the sorting result.
5. A chat secure communication method based on dynamic keys according to claim 4, characterized in that: In step S4: The distributed chat tool system uses a dynamic key exchange protocol to generate new keys, including public and private key pairs. The system sends key update notifications to relevant nodes based on node priority. The notifications include the new public key, key identifier, and key update timestamp. After receiving the new key notification, the node verifies the validity of the new key, including checking the new public key, key identifier, and key update timestamp, and updates the local key after verification. The distributed chat tool system uses an advanced encryption algorithm and an updated key to encrypt the original message sent by the sender, generating encrypted information and an authentication tag. After the receiver receives the encrypted message, the system uses the advanced encryption algorithm and the updated key to decrypt the received encrypted message to obtain the original message and verify the authentication tag. During the decryption process, the system will verify whether the authentication tag matches to ensure data integrity. If the verification fails, the system will discard the encrypted information and record the security event.
6. A chat secure communication method based on dynamic keys according to claim 5, characterized in that: In step S5: After obtaining the dynamic key before the update, the system uses the advanced encryption algorithm and the key before the update to decrypt the encrypted information. If the decryption of the dynamic key before the update fails, the system records the decryption result and continues to use the new key to encrypt the information to be sent, indicating that the dynamic key update is successful, ensuring the security of the transmission process. If the decryption of the dynamic key before the update is successful, the system records the abnormal event of successful decryption, and immediately rolls back the dynamic key update, and re-determines the dynamic key update time window.
7. A chat security communication system based on dynamic keys, used to implement a chat security communication method based on dynamic keys according to any one of claims 1 to 6, characterized in that: include: Key update module: determines whether dynamic keys need to be updated based on the interaction pattern between nodes and abnormal behavior between nodes. It also determines the dynamic key update time window by establishing a dynamic key update evaluation model. Message delivery module: Analyzes the stability of node connections and the quality of historical data transmission, adjusts the weight of nodes in the dynamic key distribution process, and confirms node priority. Based on the node priority and the updated dynamic key, the distributed chat tool system encrypts the original message sent by the sender and decrypts the encrypted message received by the receiver to achieve information delivery. Verification module: Verifies the dynamic key before the update to ensure that the dynamic key before the update cannot decrypt the encrypted message.
Citation Information
Patent Citations
Transparent network security method based on dynamic secret
CN116232738A
Network data secure transmission method based on trusted platform
CN118573473A