Chat secure communication method and system based on dynamic key
By analyzing node interaction mode and abnormal behavior in the chat tool, establishing a dynamic key update evaluation model, and adjusting node weights, the single point of failure of dynamic key encryption technology in the chat tool and inflexible key management are solved, and the problem of inflexible key management is realized. Efficient and reliable secure communication.
Patent Information
- Application Number
- CN202411408054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-10
AI Technical Summary
When using dynamic key encryption technology, existing chat tools have problems such as single point of failure risk, inflexible key management and inter-node communication stability affecting system security.
By creating distributed chat tools, analyzing node interaction modes and abnormal behaviors, establishing a dynamic key update evaluation model, adjusting node weights, realizing timely update of dynamic keys and optimizing key distribution, ensuring the security of information transmission.
Enhance the security and reliability of the system, avoid unnecessary key updates, ensure that high-level secure communication is maintained in different network environments, promptly respond to potential security threats, and improve key distribution efficiency and security.
Smart Images

Figure CN119299091A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more specifically, to a chat security communication method and system based on dynamic keys. Background Art
[0002] Dynamic keys are encryption keys that change constantly during the communication process, and are used to improve the security of data transmission. Secure chat communication refers to the use of encryption technology in chat applications to protect the content of users' messages, ensuring that only the communicating parties can read the information and preventing unauthorized third parties from stealing or tampering with the data. Many modern chat tools such as WhatsApp and Signal use end-to-end encryption technology, but there are still security risks, including relying on centralized servers to process and store data, with the risk of single point failure and server attacks; key management is not flexible enough, and using the same key for a long time increases the possibility of being cracked; the stability of communication between nodes and the quality of data transmission also directly affect 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, an embodiment of the present invention provides a chat security communication method and system based on a dynamic key 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 security communication method of dynamic key comprises the following steps:
[0006] Step S1: Create a distributed chat tool, analyze the interaction mode 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 connection and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process according to the stability of node connection and the quality of historical data transmission, and confirm the node priority;
[0009] Step S4: According to the node priority and the updated dynamic key, the system of the distributed chat tool encrypts the original information sent by the information sender and decrypts the encrypted information received by the information receiver;
[0010] Step S5: By verifying the dynamic key before updating, it is ensured that the dynamic key before updating 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] The nodes in the distributed chat tool record all communication behaviors with other nodes, including the information of each message sent and received. This information is stored in the local log file, and the interaction data is extracted from the log file. The interaction data is segmented according to the unit time set according to the different types of interaction data, and 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;
[0013] 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, namely, 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 means 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 means that there is an abnormality when there is no response between nodes for a long time;
[0018] When the message error rate is greater than or equal to the message error rate threshold, it means that the number of message errors transmitted between nodes is too large and abnormal;
[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 according to the deviation value 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.
[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: abnormal behavior frequency, abnormal behavior type frequency, and abnormal behavior severity. A comprehensive analysis is performed on the abnormal behavior frequency, abnormal behavior type frequency, and abnormal behavior severity, 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 in a unit time, including the number of encryption operations and the number of decryption operations; during the operation of each node, the number of encryption operations and the number of decryption operations are collected in real time through the system monitoring tool of the distributed chat tool, and the data of the collected number of encryption operations and the number of decryption operations are analyzed to calculate 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 key successful uses. The key operation success rate refers to the ratio of the number of key successful 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 ratio of the difference between the node clock time of each node and the reference clock time to the total number of nodes is calculated to obtain the time deviation, and 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 after comprehensive analysis based on 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;
[0025] 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, so as to establish a dynamic key update evaluation model for determining the 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] The stability of node connection refers to the ability of a node to remain online for a period of time. Within the preset time window, the time it takes for a node to drop and reconnect and the number of times the node is disconnected 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 times the node is disconnected.
[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 system of the distributed chat tool uses advanced encryption algorithms and updated keys to encrypt the original information sent by the sender to generate 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. 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] Technical effects and advantages of the method of the present invention:
[0035] 1. By evaluating the interaction mode of nodes, detecting abnormal behaviors between nodes, judging whether dynamic keys need to be updated, and establishing a dynamic key update evaluation model to determine 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 there are potential security threats, 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. Confirm node priority based on the stability of node connection and historical data transmission quality, ensure that nodes with stable connection and high transmission quality are given priority in key distribution, and improve the efficiency and security of key distribution. Use the updated dynamic key to encrypt and decrypt information to achieve secure transmission of information in distributed chat tools. The mechanism of dynamically adjusting node weights and priorities enables the system to flexibly respond to different network environments, enhancing the reliability and overall performance of the system.
[0037] 3. By verifying that the dynamic key before the update cannot decrypt the encrypted message, the risk of old keys being able to decrypt new messages after being leaked is effectively prevented, ensuring that the communication content after each key update is highly secure. This verification mechanism can promptly discover and handle potential vulnerabilities in the key update process, improving the overall security protection capabilities of the system. By automatically verifying the validity of the old key, the need for manual intervention is reduced, the automation of the system is enhanced, and the continuity and stability of secure chat communications are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a secure chat communication method based on a dynamic key 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 be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[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 comprises the following steps:
[0043] Step S1: Create a distributed chat tool, analyze the interaction mode 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 connection and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process according to the stability of node connection and the quality of historical data transmission, and confirm the node priority;
[0046] Step S4: According to the node priority and the updated dynamic key, the system of the distributed chat tool encrypts the original information sent by the information sender and decrypts the encrypted information received by the information receiver;
[0047] Step S5: By verifying the dynamic key before updating, it is ensured that the dynamic key before updating 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 a 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 pattern 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 of each message sent and received. This information is stored in the local log file. The log file contains information such as the number of message transmissions, message size, timestamp and number of message errors. Extract the interaction data from the log file, set the unit time according to the different types of interaction data to segment the interaction data, and calculate the characteristic values of the number of message transmissions, message size, timestamp and number of message errors per unit time, including the message transmission frequency, average message size, node response time and message error rate; the unit time is set to one minute.
[0050] The 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, namely, 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 means 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 means that there is an abnormality in the long-term lack of 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 means 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, and nodes are faulty;
[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 according to the deviation value of message transmission frequency, average message size deviation value, node response time deviation value and message error rate deviation value. 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 performed 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 diffusion. 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, so it is judged 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 number of 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 the number of 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 key generation times, key distribution times and key successful usage times; the key generation times refers to the number of keys generated within a preset unit time; the key distribution times refers to the number of keys distributed within a preset unit time; the key successful usage times refers to 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 usage times to the sum of the key generation times and the key distribution times within a preset unit time.
[0062] The time synchronization accuracy refers to the accuracy of time synchronization between nodes 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] In 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 and the reference clock time of each node and the total number of nodes is calculated to obtain the time deviation, and 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 respectively assigned preset proportional coefficients 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] The analysis of encryption load, key operation success rate and time synchronization accuracy determines the optimal update time window for dynamic keys, improving the security and stability of the system.
[0068] In step S3: The stability of node connection is an important indicator for confirming node priority. 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; stable connected nodes mean that the nodes can quickly respond to key distribution requests and improve 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 the preset time window, the time it takes for a node to drop offline and reconnect and the number of times the node is disconnected 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 times the node is disconnected.
[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 in 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 advanced encryption algorithms and updated keys to encrypt the original information sent by the sender to generate 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. 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. Keys are distributed through distributed networks to avoid single point failures and improve the reliability of distributed chat tools.
[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] A multi-tenant resource sharing system based on big data disclosed in the present invention comprises: a key update module, a message transmission module and a verification module;
[0078] Key update module: determines whether dynamic keys need to be updated based on the interaction mode between nodes and abnormal behaviors between nodes, and determines the dynamic key update time window by establishing a dynamic key update evaluation model;
[0079] Message transmission module: Analyze the stability of node connections and the quality of historical data transmission, adjust the weight of nodes in the dynamic key distribution process, and confirm 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 transmission;
[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 programs 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 devices. 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 site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access 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 hard disk.
[0082] Those of ordinary skill 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 to be beyond the scope of this application.
[0083] Those skilled in the art can 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 the present 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 only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, 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 separated, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[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 can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods 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 is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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 protection scope 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 mode between nodes, detect abnormal behaviors between nodes, and determine whether the dynamic key needs to be updated; 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; Step S3: Analyze the stability of node connection and the quality of historical data transmission, adjust the weight of the node in the dynamic key distribution process according to the stability of node connection and the quality of historical data transmission, and confirm the node priority; Step S4: According to the node priority and the updated dynamic key, the system of the distributed chat tool encrypts the original information sent by the information sender and decrypts the encrypted information received by the information receiver; Step S5: By verifying the dynamic key before updating, it is ensured that the dynamic key before updating 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; The nodes in the distributed chat tool record all communication behaviors with other nodes, including the information of each message sent and received. This information is stored in the local log file, and the interaction data is extracted from the log file. The interaction data is segmented according to the unit time set according to the different types of interaction data, and 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; 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, namely, 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 means 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 means that there is an abnormality when there is no response between nodes for a long time; When the message error rate is greater than or equal to the message error rate threshold, it means that the number of message errors transmitted between nodes is too large and abnormal; 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 according to the deviation value 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. When abnormal behavior of a node is detected, it is necessary to determine whether to perform 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, 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.
3. A chat secure communication method based on dynamic keys according to claim 2, characterized in that: In step S2: The encryption load refers to the number of encryption operations and decryption operations processed by a node in a unit time, including the number of encryption operations and the number of decryption operations; during the operation of each node, the number of encryption operations and the number of decryption operations are collected in real time through the system monitoring tool of the distributed chat tool, and the data of the collected number of encryption operations and the number of decryption operations are analyzed to calculate the encryption load value; Define key operation parameters, including the number of key generation times, the number of key distribution times, and the number of key successful uses. The key operation success rate refers to the ratio of the number of key successful uses to the sum of the number of key generation times and the number of key distribution times within a preset unit time; 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 ratio of the difference between the node clock time of each node and the reference clock time to the total number of nodes is calculated to obtain the time deviation, and 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 after comprehensive analysis based on 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; 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, so as to establish a dynamic key update evaluation model for determining the 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: The stability of node connection refers to the ability of a node to remain online for a period of time. Within the preset time window, the time it takes for a node to drop and reconnect and the number of times the node is disconnected 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 times the node is disconnected. 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 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. The distributed chat tool system uses an advanced encryption algorithm and an updated key to encrypt the original information sent by the information sender, generating encrypted information and an authentication tag. After the information receiver receives the encrypted information, the system uses an advanced encryption algorithm and an updated key to decrypt the received encrypted information to obtain the original information 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 secure communication system based on dynamic keys according to claim 5, characterized in that: include: Key update module: determines whether dynamic keys need to be updated based on the interaction mode between nodes and abnormal behaviors between nodes, and determines the dynamic key update time window by establishing a dynamic key update evaluation model; Message transmission module: Analyze the stability of node connections and the quality of historical data transmission, adjust the weight of nodes in the dynamic key distribution process, and confirm 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 transmission; 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
A secure mobile electronic payment system where only the bank has the key, distributed key handshakes, one way and two way authentication distributed key processes and setting up a dynamic distributed key server
CA2886849A1
Encryption method, device and equipment based on key update distribution and storage medium
CN112202557A
Dynamic key encryption method and dynamic distributed encryption system for network transmission data
CN113660081A
Transparent network security method based on dynamic secret
CN116232738A
Safety management method and system for encryption equipment
CN117390656A
Cited By
Enterprise data security management method and system
CN119475440A
User database information anti-divulging protection system and device based on big data
CN120223434A
Vehicle-mounted device, key exchange method, and key exchange program
WO2026172864A1