End-to-end data security encryption method and device, electronic equipment and storage medium
By adopting end-to-end data encryption method based on national secret algorithm in industrial networks, the problem of insufficient combination of information security and functional security is solved, and high real-time and deterministic data transmission is achieved, energy consumption and cost are reduced, and energy consumption and cost are improved. System consistency.
Patent Information
- Application Number
- CN202411289695.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
AI Technical Summary
The combination of information security and functional security in industrial networks is insufficient, especially in heterogeneous multi-protocol network environments, and it is difficult to achieve information security guarantees for high real-time and deterministic data transmission, and there are problems of high energy consumption and high deployment costs. .
Using end-to-end data encryption method based on the national secret algorithm, the session key is generated through key negotiation, and the encryption and decryption process is accelerated on low-computing embedded devices, combining asymmetric encryption and hash signature technology to ensure that Confidentiality and integrity of data transmission.
It improves the information security and functional security of data transmission in industrial control systems, reduces energy consumption and deployment costs, and ensures system consistency and real-timeness.
Smart Images

Figure CN119254468A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data encryption technology, and in particular to an end-to-end data security encryption method, device, electronic device and storage medium. Background Art
[0002] As industrial information security issues become increasingly serious, ensuring data security in industrial control systems has become a key requirement. The complexity and diversity of industrial network environments, especially the widespread use of heterogeneous multi-protocol networks, further exacerbate the challenges of secure data transmission. In response to this problem, the industry has gradually introduced data encryption mechanisms based on national secret algorithms (SM2, SM3, SM4, SM9), aiming to achieve identity identification of information subjects, data ciphertext transmission, and consistent information transmission. The implementation of these mechanisms not only needs to run on high-computing power nodes, but also must take into account the encryption and decryption capabilities of a large number of low-computing power embedded nodes in the control system.
[0003] Among existing technologies, emerging technologies such as time-sensitive networks (TSN), industrial real-time Ethernet, high-performance wireless LAN, and 5G / 6G have been widely used to meet the high real-time, deterministic, and reliability requirements of industrial networks. Existing research mainly focuses on traffic scheduling, timing analysis, TSN configuration, and the integration of 5G and TSN, aiming to improve the transmission efficiency and reliability of the network. However, the application of existing technologies in information security is relatively insufficient, especially in how to effectively integrate information security and functional safety standards (such as IEC61508, IEC62061) in these real-time networks. There is still an obvious technical gap.
[0004] At the same time, although traditional encryption algorithms (such as DES, RSA) and digest algorithms (such as MD5, SHA) have been widely used in industrial network transmission, the application scenarios of these algorithms in real-time data transmission are relatively limited, and they lack the real-time and deterministic guarantees that match the needs of modern industrial control systems. In addition, the existing real-time Ethernet protocol is still fragile when facing challenges in security and anomaly detection, especially for how to achieve seamless integration of 5G / TSN networks and traditional fieldbus control under energy consumption and cost constraints, and at the same time meet the high standards of information security and functional safety. There is still a lack of effective solutions.
[0005] Therefore, how to implement an end-to-end data security encryption mechanism based on the national secret algorithm in a heterogeneous multi-protocol network environment and enhance its information security while meeting the high real-time and deterministic requirements of the industrial network has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] In view of this, the embodiments of the present application provide an end-to-end data security encryption method, device, electronic device and storage medium to solve the problems of insufficient information security and functional safety, poor system consistency, high energy consumption and high deployment cost in the prior art.
[0007] According to a first aspect of an embodiment of the present application, an end-to-end data security encryption method is provided, which is applied to end-to-end data transmission in a heterogeneous multi-protocol network environment, including: initiating a key negotiation between a first terminal and a second terminal of communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal; using the second terminal to receive and process the first random number, wherein the second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal; using the first terminal to receive and process the second random number, wherein the first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number respectively; verifying the validity of the session key, and after the verification is passed, confirming that the first terminal and the second terminal have successfully negotiated the session key, and establishing a secure communication channel for data transmission.
[0008] According to a second aspect of an embodiment of the present application, an end-to-end data security encryption device is provided, which is applied to end-to-end data transmission in a heterogeneous multi-protocol network environment, and includes: an initiating module, configured to initiate a key negotiation between a first terminal and a second terminal of communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal; a processing module, configured to receive and process the first random number using the second terminal, wherein the second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal; a generating module, configured to receive and process the second random number using the first terminal, wherein the first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number respectively; an establishing module, configured to verify the validity of the session key, and after the verification is passed, confirm that the first terminal and the second terminal have successfully negotiated the session key, and establish a secure communication channel for data transmission.
[0009] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.
[0010] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0011] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0012] By initiating a key negotiation between a first terminal and a second terminal in communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal; using the second terminal to receive and process the first random number, wherein the second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal; using the first terminal to receive and process the second random number, wherein the first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number respectively; verifying the validity of the session key, and after the verification is passed, confirming that the first terminal and the second terminal have successfully negotiated the session key, and establishing a secure communication channel for data transmission. This application improves the information security and functional security of end-to-end data encryption and transmission, improves system consistency, and reduces energy consumption and deployment costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 It is a schematic diagram of the encryption and signing process based on the national secret algorithm provided in the embodiment of the present application;
[0015] Figure 2 This is a schematic diagram of the key negotiation process of the national secret encryption technology provided in the embodiment of the present application;
[0016] Figure 3 It is a flowchart of the end-to-end data security encryption method provided by the embodiment of the present application;
[0017] Figure 4 It is a schematic diagram of the structure of an end-to-end data security encryption device provided in an embodiment of the present application;
[0018] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0020] As industrial information security issues become increasingly serious, this project implements an end-to-end data security encryption mechanism based on national secret algorithms (SM2, SM3, SM 4, SM9), and realizes the identity identification of information subjects, ciphertext transmission of transmitted data, and consistent information transmission in a heterogeneous multi-protocol network environment. A hardware-based acceleration solution is adopted to enable a large number of low-computing embedded nodes in the control system to have system-consistent encryption and decryption capabilities. Combining the characteristics of the control network and the characteristics of real-time streaming data, a fine-grained hierarchical encryption method is adopted, and differentiated encryption strategies are adopted for different types of industrial data. On the premise of ensuring the security of industrial streaming data, the certainty of industrial data transmission is guaranteed.
[0021] In order to meet the high requirements of real-time, deterministic and reliability in industrial networks, industrial networks have developed new technologies such as time-sensitive networks (TSN), industrial real-time Ethernet, high-performance wireless LAN, 5G / 6G, and deployed network transmission protocols on them to enable them to have long-distance, low-latency and high-quality data transmission capabilities. IEEE 802.1 uses Ethernet to achieve safety-critical and real-time behaviors for fields such as industrial automation, with low jitter and bounded end-to-end transmission determinism.
[0022] The prior art and its shortcomings are summarized as follows:
[0023] 1. Time-Sensitive Networking (TSN) and Industrial Real-Time Ethernet:
[0024] Prior art 1 proposes a joint routing and scheduling method for time-triggered traffic, making the end-to-end transmission of time-triggered and audio video bridging (AVB) traffic schedulable.
[0025] The second prior art extends the timing analysis method to multiple AVB flows, verifies the credit limits of multiple types of flows, and reduces the worst-case end-to-end delay of AVB flows.
[0026] Prior art 3 discusses the application of TSN in industrial wireless networks and provides general models and concepts.
[0027] Prior Art IV discusses the convergence of 5G and TSN, and proposes technologies, proof of concepts, and network integration methods for converting traffic between TSN and 5G communication technologies.
[0028] Prior art 5 discusses the balance between openness and standardization in 5G systems.
[0029] Although these technologies have made some progress in improving the real-time performance and reliability of industrial network transmission, they still have the following shortcomings in practical applications, especially when facing complex industrial control systems:
[0030] 1) Insufficient encryption and security: Existing technologies in time-sensitive networks (TSN) and industrial real-time Ethernet mainly focus on issues such as traffic scheduling and transmission delay, but relatively little consideration is given to data encryption and information security. There is a relative lack of real-time data transmission protocols with information security standards, which is a major security risk in industrial automation.
[0031] 2) System consistency issues: Although some studies have focused on system consistency (such as end-to-end delay of traffic), there are still challenges in handling consistency between different protocols in a heterogeneous network environment.
[0032] 2. Industrial bus and real-time Ethernet:
[0033] Prior Art 6 Aiming at the vulnerability and detection anomaly problems of real-time Ethernet protocol, a method for optimizing data extraction and classification of traffic features is proposed, and it is successfully applied to anomaly detection in PROFINET network.
[0034] Prior art seven further considers safety and redundant control issues on a real-time basis.
[0035] Although these technologies enhance the anomaly detection and redundant control capabilities of industrial networks, they still have limitations in supporting information security and functional safety transmission, especially in the environment of 5G and TSN network convergence.
[0036] Therefore, in summary, the main problems of the prior art are:
[0037] 1) Insufficient integration of information security and functional safety: Although existing technologies have made progress in the real-time and reliability of data transmission, the real-time application of information security technology is still insufficient. The openness and interconnectivity of industrial networks require higher security guarantees.
[0038] 2) Complexity of multi-protocol integration: How to seamlessly integrate traditional fieldbus control with modern network technologies such as 5G and TSN to support information security and functional safety transmission is an urgent problem to be solved.
[0039] 3) Balance between system performance and cost: Although 5G / TSN networks have excellent performance, their high energy consumption and deployment costs limit their large-scale application in industrial environments.
[0040] In view of the problems existing in the prior art, this application implements an end-to-end data security encryption mechanism based on the national secret algorithm, realizes the identity identification of the information subject, the ciphertext transmission of the transmitted data, and the consistent information transmission in a heterogeneous multi-protocol network environment. The acceleration solution based on hardware 13 / 89 is adopted, so that a large number of low-computing power embedded nodes in the control system have system-consistent encryption and decryption capabilities. Combining the characteristics of the control network and the characteristics of real-time streaming data, a fine-grained hierarchical encryption method is adopted, and differentiated encryption strategies are adopted for different types of industrial data. On the premise of ensuring the security of industrial streaming data, the certainty of industrial data transmission is guaranteed at the same time.
[0041] Based on the principle of autonomous control, the embodiment of the present application proposes an end-to-end data encryption solution using a new national secret encryption algorithm, aiming to provide efficient and secure protection for data transmission in industrial control systems. Before the detailed introduction of the embodiment of the technical solution of the present application, the encryption and signing process based on the national secret algorithm and the key negotiation process of the national secret encryption technology of the present application are first described in conjunction with the accompanying drawings and embodiments.
[0042] In view of the characteristics of industrial field equipment (such as master control equipment and IO connection gateways), the technical solution of this application pays special attention to the encryption processing capabilities of embedded devices. Since embedded devices usually have low computing power, if data encryption is implemented only by software, the computational complexity of the encryption process will significantly affect the real-time nature of communication and the stability of the system. This is unacceptable for industrial networks that require high real-time and deterministic performance. Therefore, this solution uses a dedicated hardware encryption module to ensure that the end-to-end data encryption process is completed without sacrificing real-time performance and stability.
[0043] Figure 1 Schematic diagram of the encryption and signing process based on the national secret algorithm provided in the embodiment of the present application. Figure 1 As shown, the encryption and signing process of the technical solution of this application is based on the identification password system of the national secret algorithm (such as SM2, SM3, SM4, SM9). In this system, the user's public key is derived from his or her identity information, and the private key is generated and distributed by the key generation center (KGC). The specific implementation process is as follows:
[0044] Terminal A initiates communication and first needs to encrypt a message to be sent to terminal B. In order to obtain the public key of terminal B, terminal A generates the corresponding public key based on the identity information of terminal B.
[0045] Terminal A uses the public key of terminal B to encrypt the message and generate ciphertext, which can be transmitted over the network and ensure the confidentiality and integrity of the information during transmission.
[0046] After receiving the ciphertext, terminal B obtains its own private key from the SM9 Key Center (KGC). Using this private key, terminal B can decrypt the ciphertext sent by terminal A and restore the original message.
[0047] In the process of encryption and decryption, the signing and verification of messages also rely on the national secret algorithm. Terminal A signs the message to be sent to ensure that the source of the message can be verified; Terminal B verifies the signature of the received message to ensure that the message has not been tampered with.
[0048] Further, Figure 2 Schematic diagram of the key negotiation process of the national secret encryption technology provided by the embodiment of the present application. Figure 2 As shown in Figure 1, key agreement is a key step in end-to-end encryption and is used to generate session keys for encrypted communications. The process includes the following steps:
[0049] Step 1: Key negotiation request
[0050] Terminal A initiates a key negotiation request, generates a random number R1, and sends it to terminal B. The random number will be used as part of the session key in subsequent calculations.
[0051] Step 2: Generate a response
[0052] After receiving the negotiation request, terminal B generates a second random number R2 and sends it back to terminal A together with the negotiation confirmation information. R2 is also a component of the session key.
[0053] Step 3: Negotiation and confirmation
[0054] After receiving the random number from the other party, terminal A and terminal B use their random numbers R1 and R2 to generate the final session key. The generation of the session key is completed through a specific encryption algorithm and identity information to ensure the uniqueness and security of the key. The session keys generated by both parties are consistent, indicating that the key negotiation is successful. At this point, terminal A and terminal B can establish a secure communication channel based on the session key for subsequent encrypted data transmission.
[0055] The technical solution of this application provides an efficient and secure end-to-end data encryption method by combining a dedicated hardware encryption solution and a national secret algorithm. Dedicated hardware accelerates the encryption and decryption process to ensure efficient real-time data transmission on low-computing embedded devices. The encryption system based on identification passwords uses user identity information to generate public keys, further simplifying the public key management process and enhancing the overall security of the system. These technical means jointly ensure that in a complex heterogeneous multi-protocol network environment, the data transmission of industrial control systems can meet high security requirements without sacrificing the determinism and real-time nature of transmission.
[0056] The contents of the technical solution of the present application are described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Figure 3 Schematic diagram of the process of end-to-end data security encryption method provided by the embodiment of the present application. Figure 3 As shown, the end-to-end data security encryption method may specifically include:
[0058] S301, initiating a key negotiation between a first terminal and a second terminal in communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal;
[0059] S302, using the second terminal to receive and process the first random number, wherein the second terminal decrypts the first random number, generates and encrypts the second random number, and sends the encrypted second random number to the first terminal;
[0060] S303, using the first terminal to receive and process the second random number, wherein the first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number respectively;
[0061] S304, verifying the validity of the session key, and after the verification is passed, confirming that the first terminal and the second terminal have successfully negotiated the session key, and establishing a secure communication channel for data transmission.
[0062] In some embodiments, the first terminal generates and encrypts the first random number, including:
[0063] Generate a first random number and a first timestamp using the first terminal, wherein the first random number is used for negotiating a session key, and the first timestamp is used to identify a generation time of the random number;
[0064] Combining the first random number with the first timestamp to form a data packet to be encrypted;
[0065] The identity information of the second terminal is obtained by using the first terminal, and the identity information of the second terminal is used as a public key to perform asymmetric encryption on the data packet to be encrypted to generate a first ciphertext.
[0066] Specifically, the embodiment of the present application provides a specific process for the first terminal to generate and encrypt a first random number to implement session key negotiation in end-to-end data encryption. First, the first terminal generates a high-quality true random number R1 using an internally integrated hardware random number generator. The random number R1 will serve as an important component of subsequent session key generation. At the same time, the first terminal obtains the current system time and generates a timestamp T1 corresponding to the time. The timestamp T1 is used to identify the generation time of the random number, ensure the timeliness of data transmission, and prevent replay attacks.
[0067] Subsequently, the first terminal combines the generated random number R1 with the timestamp T1 to form a data packet to be encrypted. This data packet will contain R1 and T1, ensuring that it contains not only the random number required for the session key, but also the time information, which is used by the receiver to verify the validity of the data when decrypting.
[0068] Furthermore, after the data packet is ready, the first terminal obtains the identity information (ID_B) of the second terminal (ie, the communication peer) through a pre-set secure channel. The identity information is usually a unique identifier of the second terminal, which is used to ensure the uniqueness and target certainty of data encryption.
[0069] Furthermore, the first terminal uses the obtained second terminal identity information (ID_B) as a public key to asymmetrically encrypt the above data packet. The encryption process uses an asymmetric encryption algorithm (such as SM2) in the national secret algorithm to encrypt the data packet composed of the random number R1 and the timestamp T1 into the first ciphertext. The use of asymmetric encryption ensures that even if the data is intercepted during transmission, it cannot be decrypted without the correct private key, thereby ensuring the confidentiality and integrity of the data.
[0070] Furthermore, in the subsequent data transmission process, the first terminal and the second terminal will use the session key generated by negotiation to encrypt and decrypt the communication data. Specifically, the two parties generate the session key through negotiation, and use the symmetric encryption algorithm to encrypt and decrypt the communication data during the session. In this way, the security and efficiency of end-to-end communication are guaranteed.
[0071] For example, the first terminal uses the preset second terminal ID_B to perform an asymmetric encryption operation on the generated random number R1 and timestamp T1 according to the above steps to obtain the first ciphertext. The ciphertext is then transmitted to the second terminal, and the second terminal decrypts the ciphertext using its own private key to obtain part of the session key information.
[0072] Through the above-mentioned method of this embodiment, this embodiment effectively demonstrates how to achieve secure session key negotiation by generating and encrypting random numbers and using asymmetric encryption technology in practical applications, thereby providing reliable security protection for end-to-end data transmission.
[0073] In some embodiments, sending the encrypted first random number to the second terminal includes:
[0074] Using the first terminal to generate an original negotiation request message including the first ciphertext, and performing hash processing on the original negotiation request message to generate a corresponding hash value;
[0075] Digitally signing the hash value using the private key of the first terminal to generate a first signature value;
[0076] The first ciphertext and the first signature value are combined to form a sending data packet, and the sending data packet is transmitted to the second terminal.
[0077] Specifically, the process of the first terminal sending the encrypted first random number to the second terminal is described in detail. The process is intended to ensure the integrity, authenticity and non-repudiation of the encrypted data. First, the first terminal A generates an original negotiation request message containing a first ciphertext. The original negotiation request message contains the first ciphertext previously generated by asymmetric encryption, which carries the first random number and timestamp information, and is the basic data for subsequent session key negotiation.
[0078] Furthermore, in order to ensure the integrity of the data during transmission, the first terminal A performs hash processing on the original negotiation request message. Specifically, the first terminal A uses the SM3 algorithm to perform hash calculation on the original message to generate a corresponding hash value. The hash value is a unique identifier of the original data. Once any change occurs to the data content, the corresponding hash value will also change, thereby effectively detecting the integrity of the data.
[0079] Furthermore, in order to ensure the authenticity and non-repudiation of the message, the first terminal A uses its private key to digitally sign the generated hash value. Through the signature operation of the SM3 algorithm, a first signature value is generated. The signature value will be attached to the data packet for the second terminal B to verify the signature after receiving the data packet. Only the recipient who has the corresponding public key can verify the authenticity of the signature and thus confirm the identity of the sender of the data.
[0080] Further, after completing the hash processing and digital signature, the first terminal A combines the first ciphertext with the first signature value to form a final transmission data packet. The data packet includes two parts: one part is the encrypted ciphertext including the first random number and the timestamp, and the other part is the signature information used to verify the integrity and authenticity of the data.
[0081] Finally, the first terminal A transmits the above generated transmission data packet to the second terminal B through the network. During the transmission process, the ciphertext ensures the confidentiality of the data content, while the signature ensures the integrity of the data and the authenticity of the sender. After receiving the data packet, the second terminal B can verify the signature with its public key and obtain the information required for session key negotiation through decryption operation.
[0082] It should be noted that in order to further improve the security and data credibility during the communication process, this embodiment specifically uses the SM3 algorithm for hash processing and signature generation. As a secure hash algorithm, the SM3 algorithm can effectively prevent data from being tampered with, and the digital signature mechanism ensures the non-repudiation of data. In practical applications, this embodiment is suitable for various scenarios with high data security requirements, especially end-to-end encrypted communications in industrial control systems.
[0083] Through the method of the present embodiment described above, the present embodiment ensures the security and integrity of the encrypted first random number during the transmission process and lays a solid foundation for subsequent session key negotiation and secure communication.
[0084] In some embodiments, the second terminal decrypts the first random number, generates and encrypts the second random number, and sends the encrypted second random number to the first terminal, including:
[0085] The second terminal decrypts the first ciphertext using the private key, obtains a first random number and a first timestamp, and verifies the validity of the first timestamp;
[0086] After the verification is successful, the first signature value is verified, and after the verification is successful, the first random number is saved, and a second random number and a second timestamp are generated;
[0087] Asymmetrically encrypt the second random number and the second timestamp using the identity information of the first terminal to obtain a second ciphertext;
[0088] The response message is hashed by the second terminal, and the hash value is signed to generate a second signature value, and the second ciphertext and the second signature value are sent to the first terminal.
[0089] Specifically, this embodiment also provides a specific process in which the second terminal receives and processes the encrypted data sent by the first terminal, decrypts the first random number and generates the second random number. The process includes verifying the integrity and legitimacy of the data and ensuring the security of subsequent session key negotiation.
[0090] First, after receiving the encrypted data packet sent by the first terminal A, the second terminal B first determines the legitimacy of the message according to the message type. The second terminal B will check whether the message belongs to a legitimate request in the current negotiation phase. If other types of data messages are received during the negotiation process, they will be discarded directly to prevent potential man-in-the-middle attacks or malicious data injection.
[0091] Furthermore, for a legitimate negotiation request message, the second terminal B uses its private key to decrypt the first ciphertext in the message. Through decryption, the second terminal B obtains the first random number R1 and the first timestamp T1. This step ensures the secure transmission of the first random number and provides necessary data support for subsequent key negotiation.
[0092] Furthermore, after decrypting the first timestamp T1, the second terminal B immediately verifies the validity of the timestamp, that is, checks the "freshness" of the timestamp. If the timestamp indicates that the data packet was generated within a reasonable time range, the judgment is passed, otherwise the data packet may be the product of a replay attack and will be directly discarded.
[0093] Furthermore, if the timestamp verification is successful, the second terminal B will continue to verify the signature (first signature value) of the first terminal A. Using the public key of the first terminal A, the second terminal B performs a signature verification operation on the first signature value to confirm the authenticity of the signature and ensure that the message has not been tampered with during transmission. If the signature verification is successful, the second terminal B saves the first random number R1 obtained by decryption to generate a session key later.
[0094] Furthermore, the second terminal B generates a new random number R2 as a second random number. At the same time, the second terminal B obtains the current system time and generates a second timestamp T2. These data will be used for further encryption operations and key negotiation.
[0095] Furthermore, the second terminal B uses the identity information (ID_A) of the first terminal A as a public key to asymmetrically encrypt the second random number R2 and the second timestamp T2 to generate a second ciphertext. This encryption operation ensures that the second random number and timestamp are effectively protected during transmission.
[0096] Furthermore, the second terminal B combines the generated second ciphertext with other negotiation information into a response message. To ensure the non-repudiation of the message, the second terminal B uses the SM3 algorithm to hash the response message to generate a hash value, and signs the hash value with its own private key to generate a second signature value.
[0097] Finally, the second terminal B sends the encrypted data packet containing the second ciphertext and the second signature value to the first terminal A. The transmission of the data packet completes the secure exchange of random numbers between the two parties and provides necessary data support for the two parties to generate a consistent session key.
[0098] It should be noted that this embodiment emphasizes the importance of each step in the secure communication process, especially the operations of decryption, timestamp verification, and signature verification, which are crucial to preventing data tampering and replay attacks. The combination of asymmetric encryption and SM3 signature algorithm ensures that the end-to-end data encryption process in the industrial control environment is both efficient and provides strong security. This implementation method is suitable for industrial network environments that have high data security requirements and need to guard against complex attack scenarios.
[0099] In some embodiments, the first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number, respectively, including:
[0100] The first terminal decrypts the second ciphertext using the private key to obtain a second random number and a second timestamp, and verifies the validity of the second timestamp;
[0101] Verifying the second signature value using the first terminal, and synthesizing a session key based on the first random number and the second random number after the verification succeeds;
[0102] The synthesized session key value is hashed to generate a third hash value, and the third hash value is sent to the second terminal.
[0103] Specifically, this embodiment provides a specific process of how the first terminal decrypts the second random number and generates a final session key after receiving the encrypted data sent by the second terminal. This process ensures the security of the session key negotiation and the consistency of data transmission between the two parties.
[0104] First, after receiving the response data packet from the second terminal B, the first terminal A first uses its private key to decrypt the second ciphertext in the data packet. Through decryption, the first terminal A can extract the second random number R2 and the second timestamp T2. This step ensures the confidentiality and security of the random number and time information generated by the second terminal B during transmission.
[0105] Furthermore, after the first terminal A obtains the second timestamp T2 through decryption, it immediately verifies the validity of the timestamp. Specifically, the first terminal A will check the "freshness" of T2, that is, determine whether the timestamp is generated within a reasonable time range. Only after the timestamp verification is passed can the next step be performed. If the timestamp is invalid, it indicates that the data packet may have a security risk, and the first terminal A will terminate the key negotiation process.
[0106] Furthermore, after the timestamp verification is passed, the first terminal A will verify the second signature value in the data packet sent by the second terminal B. The first terminal A uses the public key of the second terminal B to verify the signature to ensure the integrity and authenticity of the data packet. If the signature verification is successful, it indicates that the data packet has not been tampered with and is indeed from the second terminal B. Only if the signature verification is passed, the first terminal A will continue to generate the session key.
[0107] Furthermore, after the signature verification is passed, the first terminal A synthesizes the final session key based on the first random number R1 generated by itself and the second random number R2 received from the second terminal B. The generation of the session key is based on the random numbers of both parties and is calculated using a specific key derivation algorithm to ensure the security and uniqueness of the session key.
[0108] Furthermore, after successfully generating the session key, the first terminal A performs hash processing on the session key to generate a third hash value. The purpose of hash processing is to provide necessary information for the next step of data verification, ensure that the session keys generated by both parties are consistent, and prevent the key from being leaked in subsequent transmissions.
[0109] Finally, the first terminal A sends the generated third hash value to the second terminal B. The third hash value will be used by the second terminal B to verify the session key to confirm that the session keys of both parties are consistent. This step ensures that both parties can establish a secure communication channel based on the same session key and perform subsequent encrypted data transmission.
[0110] Through the method of the above-mentioned embodiment, this embodiment describes in detail how the first terminal decrypts, verifies and generates a session key after receiving the encrypted data from the second terminal, and shows the specific implementation process of ensuring end-to-end secure communication. In particular, through steps such as asymmetric encryption, timestamp verification, signature verification, and hash processing, the security of session key negotiation, the integrity of data transmission, and the confidentiality of communication between the two parties are ensured. These measures effectively prevent possible man-in-the-middle attacks, data tampering, and other security threats, and are particularly suitable for communication scenarios that require high security and high real-time performance in industrial control networks.
[0111] In some embodiments, verifying the validity of the session key includes:
[0112] The second terminal receives a verification data packet including a third hash value sent by the first terminal;
[0113] Extracting and checking the timestamp in the verification data packet using the second terminal to determine the validity of the timestamp;
[0114] Calculate a local hash value using the second terminal based on the session key, the first random number, and the second random number;
[0115] Compare the local hash value with the third hash value to confirm whether the session keys generated by both parties are consistent;
[0116] If the third hash value is consistent with the local hash value, the first terminal and the second terminal have successfully negotiated the same session key.
[0117] Specifically, this embodiment provides a specific process for the second terminal to verify the validity of the session key, so as to ensure that the keys generated by the two terminals during the session key negotiation process are consistent, thereby establishing a secure communication channel.
[0118] First, the second terminal B receives a verification data packet sent from the first terminal A. The verification data packet contains a third hash value, which is obtained by hashing the session key generated by the negotiation between the two parties by the first terminal A. The receipt of the verification data packet indicates that the first terminal A has completed the generation of the session key and is ready to perform consistency verification.
[0119] Furthermore, the second terminal B extracts the timestamp information from the verification data packet and performs a freshness check on the timestamp. Specifically, the second terminal B checks whether the timestamp is generated within a reasonable time window to determine whether the verification data packet is timely and valid. The verification of the timestamp freshness helps prevent replay attacks and ensures the security of the verification process.
[0120] Furthermore, after the timestamp verification is passed, the second terminal B calculates a local hash value based on the generated session key, the first random number R1 and the second random number R2. This hash value is generated by the same hash algorithm as the first terminal A, and its purpose is to provide a basis for subsequent hash value comparison.
[0121] Furthermore, the second terminal B compares the calculated local hash value bit by bit with the third hash value sent by the first terminal A. If the two hash values are completely consistent, it indicates that the first terminal A and the second terminal B have generated the same session key. This consistency verification ensures that the session key negotiated by both parties has not been tampered with or attacked during transmission.
[0122] Furthermore, if the third hash value is consistent with the local hash value, the second terminal B confirms that both terminals have successfully negotiated the same session key. This means that the first terminal A and the second terminal B can establish a secure communication channel based on the consistent session key, thereby performing subsequent encrypted communication.
[0123] Through the method of the above-mentioned embodiment, this embodiment describes in detail how the second terminal performs a series of operations such as timestamp verification, calculation of local hash values, and comparison of hash values after receiving the verification data packet to ensure the validity and consistency of the session key. Through strict verification steps, the session key is prevented from being tampered with or intercepted during the transmission and negotiation process, thereby improving the security of end-to-end communication. Especially in industrial control networks with high security requirements, these steps are crucial to ensuring the integrity, confidentiality, and authenticity of data transmission. This implementation method effectively responds to the risks of replay attacks and data tampering, and provides a solid security guarantee for industrial network communications.
[0124] In some embodiments, confirming that the first terminal successfully negotiates a session key with the second terminal and establishing a secure communication channel for data transmission includes:
[0125] After confirming that the session keys are consistent, using the second terminal to generate a confirmation signal and return it to the first terminal to notify the first terminal that the session key has been successfully negotiated;
[0126] The first terminal and the second terminal establish a secure communication channel based on the session key to facilitate subsequent data transmission.
[0127] Specifically, this embodiment provides a specific process of how to establish a secure communication channel for subsequent data transmission after the first terminal and the second terminal successfully negotiate a session key. This process ensures that both terminals can safely and reliably communicate data based on the consistency of the session key.
[0128] First, after completing the validity verification of the session key, the second terminal B confirms that the session keys generated by both parties are consistent. Specifically, through the hash value comparison in the previous step, the second terminal B has confirmed that it and the first terminal A have generated the same session key using the same random number (R1 and R2). The session key consistency verification is passed, which means that the key negotiation between the two parties is successful and can proceed to the next step.
[0129] Further, after confirming that the session key is consistent, the second terminal B generates a confirmation signal. The confirmation signal is a specific data packet used to notify the first terminal A that the key negotiation has been successfully completed and the two parties can establish a secure communication channel based on this key. The confirmation signal may include a series of identification information, such as a negotiation identifier, a timestamp, or other additional data for verification to ensure that the first terminal A can correctly identify and process the signal.
[0130] Furthermore, the second terminal B sends the generated confirmation signal to the first terminal A through the network. The transmission of this signal indicates that both parties have entered the preparation process for the secure communication phase. After receiving the confirmation signal, the first terminal A performs corresponding verification to ensure the authenticity and integrity of the confirmation signal. Usually, the first terminal A will use the previously negotiated session key to decrypt and verify the confirmation signal to ensure that the signal is indeed from the second terminal B and has not been tampered with during the transmission process.
[0131] Furthermore, once the first terminal A successfully verifies the confirmation signal, it indicates that the two parties have completed the negotiation of the session key and confirmed the consistency of the key. At this point, the first terminal A and the second terminal B establish a secure communication channel based on the session key. The establishment of a secure communication channel usually includes encryption processing of all subsequent data transmission to ensure the confidentiality, integrity and authenticity of the data.
[0132] Furthermore, after the secure communication channel is established, the first terminal A and the second terminal B can perform subsequent data transmission. All transmitted data will be symmetrically encrypted using the session key negotiated by both parties to prevent data leakage and tampering during transmission. This encrypted transmission mechanism provides strong security protection for sensitive data in industrial control networks.
[0133] Through the method of the above-mentioned embodiment, this embodiment describes in detail the operation steps after the session key consistency is confirmed, and shows how to ensure the communication security between terminals. By generating and verifying the confirmation signal, the terminals of both parties can reliably confirm the success of the key negotiation, thereby establishing a secure communication channel. This process effectively prevents man-in-the-middle attacks and data leakage, and is particularly suitable for industrial control network scenarios that require high security and high reliability. In this way, the security of subsequent data transmission is ensured, and the overall security level of industrial network communication is further enhanced.
[0134] According to the technical solution provided in the embodiments of the present application, the technical solution of the present application has at least the following advantages:
[0135] This application implements an end-to-end data encryption solution based on a new national secret encryption algorithm, which significantly improves the security and real-time performance of data transmission in industrial control systems.
[0136] First, in response to the special needs of industrial control flow data, this application has developed a lightweight encryption scheme suitable for real-time control applications based on the national secret algorithm. While ensuring data security, this scheme minimizes the occupation of system resources by the encryption process, thereby reducing the impact on control applications with high real-time requirements and ensuring the efficient operation of the system.
[0137] Secondly, this application uses identity encryption technology to build a data security channel. By using the terminal's identity information to generate a public key, the uniqueness and security of data encryption are ensured. The application of identity encryption simplifies the public key management process and enhances the security of the system, which is particularly suitable for end-to-end encryption requirements in industrial control networks.
[0138] In addition to the data security channel, this application also builds a functional safety channel based on the black channel technology. This channel runs independently of the data encryption channel and is specifically used to ensure the transmission of functional safety data. Through the introduction of the black channel, this application effectively separates data security and functional safety, ensuring the independence and reliability of the two, and providing dual protection for industrial automation environments.
[0139] Finally, in order to solve the message processing delay problem that may be introduced in the encryption and decryption process, this application proposes a fine-grained message partitioning technology. By fine-grained partitioning of communication messages and using encryption schemes with different computational complexities for different types of data, the computational burden in the encryption and decryption process is effectively reduced, the data transmission delay is reduced, and the real-time performance of the system is further improved.
[0140] To summarize, this application significantly improves the data transmission security and real-time performance of industrial control systems by optimizing encryption algorithms, dividing encryption tasks, and introducing dual security channels. It solves the delay problem existing in traditional encryption methods in high-real-time industrial applications, and ensures the safe and efficient operation of industrial automation networks.
[0141] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0142] Figure 4 1 is a schematic diagram of the structure of an end-to-end data security encryption device provided by an embodiment of the present application, which is applied to end-to-end data transmission in a heterogeneous multi-protocol network environment. Figure 4 As shown, the end-to-end data security encryption device includes:
[0143] The initiating module 401 is configured to initiate a key negotiation between a first terminal and a second terminal of communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal;
[0144] The processing module 402 is configured to receive and process the first random number using the second terminal, wherein the second terminal decrypts the first random number, generates and encrypts the second random number, and sends the encrypted second random number to the first terminal;
[0145] The generating module 403 is configured to receive and process the second random number using the first terminal, wherein the first terminal decrypts the second random number and generates a session key with the second terminal based on the first random number and the second random number respectively;
[0146] The establishing module 404 is configured to verify the validity of the session key, and after the verification is passed, confirm that the first terminal and the second terminal have successfully negotiated the session key, and establish a secure communication channel for data transmission.
[0147] In some embodiments, Figure 4The initiating module 401 uses the first terminal to generate a first random number and a first timestamp, wherein the first random number is used for negotiating a session key, and the first timestamp is used to identify the generation time of the random number; the first random number and the first timestamp are combined to form a data packet to be encrypted; the identity information of the second terminal is obtained by using the first terminal, and the identity information of the second terminal is used as a public key to asymmetrically encrypt the data packet to be encrypted to generate a first ciphertext.
[0148] In some embodiments, Figure 4 The initiating module 401 uses the first terminal to generate an original negotiation request message including the first ciphertext, and performs hash processing on the original negotiation request message to generate a corresponding hash value; uses the private key of the first terminal to digitally sign the hash value to generate a first signature value; combines the first ciphertext and the first signature value to form a sending data packet, and transmits the sending data packet to the second terminal.
[0149] In some embodiments, Figure 4 The processing module 402 is used for the second terminal to decrypt the first ciphertext using a private key, obtain a first random number and a first timestamp, and verify the validity of the first timestamp; after the verification is passed, verify the first signature value, save the first random number after the verification is successful, and generate a second random number and a second timestamp; use the identity information of the first terminal to asymmetrically encrypt the second random number and the second timestamp to obtain a second ciphertext; use the second terminal to hash the response message, sign the hash value, generate a second signature value, and send the second ciphertext and the second signature value to the first terminal.
[0150] In some embodiments, Figure 4 The generation module 403 is used for the first terminal to decrypt the second ciphertext using the private key, obtain the second random number and the second timestamp, and verify the validity of the second timestamp; use the first terminal to verify the second signature value, and after the verification is successful, synthesize the session key based on the first random number and the second random number; hash the value of the synthesized session key to generate a third hash value, and send the third hash value to the second terminal.
[0151] In some embodiments, Figure 4 The establishment module 404 is used for the second terminal to receive a verification data packet containing a third hash value sent by the first terminal; the second terminal is used to extract and check the timestamp in the verification data packet to determine the validity of the timestamp; the second terminal is used to calculate a local hash value based on the session key, the first random number and the second random number; the local hash value is compared with the third hash value to confirm whether the session keys generated by both parties are consistent; if the third hash value is consistent with the local hash value, the first terminal and the second terminal have successfully negotiated the same session key.
[0152] In some embodiments, Figure 4 After confirming that the session keys are consistent, the establishment module 404 generates a confirmation signal using the second terminal and returns it to the first terminal to notify the first terminal that the session key has been successfully negotiated; the first terminal and the second terminal establish a secure communication channel based on the session key for subsequent data transmission.
[0153] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0154] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0155] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.
[0156] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0157] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.
[0158] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0159] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0160] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An end-to-end data security encryption method, applied to end-to-end data transmission in a heterogeneous multi-protocol network environment, characterized in that: include: Initiating a key negotiation between a first terminal and a second terminal of communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal; receiving and processing the first random number using the second terminal, wherein the second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal; Using the first terminal to receive and process the second random number, wherein the first terminal decrypts the second random number and generates a session key with the second terminal based on the first random number and the second random number respectively; The validity of the session key is verified, and after the verification is passed, it is confirmed that the first terminal and the second terminal have successfully negotiated the session key and established a secure communication channel for data transmission.
2. The method according to claim 1, characterized in that The first terminal generates and encrypts a first random number, including: Generate a first random number and a first timestamp using the first terminal, wherein the first random number is used for negotiating a session key, and the first timestamp is used to identify a generation time of the random number; Combining the first random number with the first timestamp to form a data packet to be encrypted; The identity information of the second terminal is obtained by using the first terminal, and the identity information of the second terminal is used as a public key to asymmetrically encrypt the data packet to be encrypted to generate a first ciphertext.
3. The method according to claim 2, characterized in that The step of sending the encrypted first random number to the second terminal includes: Using the first terminal to generate an original negotiation request message including the first ciphertext, and performing hash processing on the original negotiation request message to generate a corresponding hash value; Digitally signing the hash value using the private key of the first terminal to generate a first signature value; The first ciphertext and the first signature value are combined to form a sending data packet, and the sending data packet is transmitted to the second terminal.
4. The method according to claim 1, characterized in that The second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal, including: The second terminal decrypts the first ciphertext using the private key to obtain a first random number and a first timestamp, and verifies the validity of the first timestamp; After the verification is passed, the first signature value is verified, and after the verification is successful, the first random number is saved, and the second random number and the second timestamp are generated; Asymmetrically encrypt the second random number and the second timestamp using the identity information of the first terminal to obtain a second ciphertext; The response message is hashed using the second terminal, and the hash value is signed to generate a second signature value, and the second ciphertext and the second signature value are sent to the first terminal.
5. The method according to claim 4, characterized in that The first terminal decrypts the second random number, and generates a session key with the second terminal based on the first random number and the second random number, respectively, including: The first terminal decrypts the second ciphertext using the private key to obtain the second random number and the second timestamp, and verifies the validity of the second timestamp; Verifying the second signature value using the first terminal, and synthesizing a session key based on the first random number and the second random number after the verification succeeds; The value of the synthesized session key is hashed to generate a third hash value, and the third hash value is sent to the second terminal.
6. The method according to claim 1, characterized in that The verifying the validity of the session key includes: The second terminal receives a verification data packet including a third hash value sent by the first terminal; Extracting and checking the timestamp in the verification data packet using the second terminal to determine the validity of the timestamp; Calculate a local hash value using the second terminal based on the session key, the first random number, and the second random number; Compare the local hash value with the third hash value to confirm whether the session keys generated by both parties are consistent; If the third hash value is consistent with the local hash value, the first terminal and the second terminal have successfully negotiated the same session key.
7. The method according to claim 6, characterized in that The step of confirming that the first terminal successfully negotiates a session key with the second terminal and establishing a secure communication channel for data transmission includes: After confirming that the session keys are consistent, using the second terminal to generate a confirmation signal and returning it to the first terminal to notify the first terminal that the session key has been successfully negotiated; The first terminal and the second terminal establish a secure communication channel based on the session key to facilitate subsequent data transmission.
8. An end-to-end data security encryption device, applied to end-to-end data transmission in a heterogeneous multi-protocol network environment, characterized in that: include: An initiating module, configured to initiate a key negotiation between a first terminal and a second terminal of communication, wherein the first terminal generates and encrypts a first random number, and sends the encrypted first random number to the second terminal; a processing module, configured to receive and process the first random number using the second terminal, wherein the second terminal decrypts the first random number, generates and encrypts a second random number, and sends the encrypted second random number to the first terminal; a generating module configured to receive and process the second random number using the first terminal, wherein the first terminal decrypts the second random number and generates a session key with the second terminal based on the first random number and the second random number respectively; The establishing module is configured to verify the validity of the session key, and after the verification is passed, confirm that the first terminal and the second terminal have successfully negotiated the session key, and establish a secure communication channel for data transmission.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Key agreement method, cloud server, device, storage medium, and system
CN109039628A
Lightweight authentication method based on equipment identity label and gateway
CN111835752A
Data transmission method, device, system and equipment
CN114024710A
Data transmission method and system based on NB-iot communication, and medium
WO2022021992A1
Cited By
Zero-trust gateway data access method, client, gateway, communication system, storage medium and computer program product
CN121173591A