End-to-end data processing method and device
By determining the private key and public key respectively at the data sending end and receiving end, and generating a shared key through public key exchange, end-to-end data encryption transmission is realized, solving the problem of difficulty in dealing with complex network attacks in the prior art and improving the security of data transmission.
Patent Information
- Application Number
- CN202411538380.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing technology is difficult to deal with increasingly complex cyber attacks, resulting in security risks of privacy data leakage during remote data transmission.
An end-to-end data processing method is adopted to realize data encryption transmission by determining the preset key generation protocol, private key, public key and shared key. The specific steps include determining the private key and the public key respectively at the data sending end and the receiving end, and generating a shared key through public key exchange, for encrypting and decrypting the data.
Through end-to-end data encryption transmission, the security during data transmission is improved, privacy data leakage is prevented, and the security of keys is enhanced.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of electrical communication technology, and in particular to an end-to-end data processing method and device. Background Art
[0002] The BMC (Baseboard Management Controller) system is a management system that monitors servers or switches and provides a remote control interface. This type of system communicates with other hardware and software inside the host through interfaces such as LPC or USB, and provides query and control functions to remote operators through remote transmission interfaces such as the network, allowing administrators to remotely access the host to send instructions or perform various tasks, such as remote power control, hardware monitoring, logging and other management tasks.
[0003] With the expansion of BMC system functions, remote data transmission has greatly facilitated enterprise-level server and device management. However, in the process of remote data transmission, there is a security risk of privacy data leakage due to malicious attacks by attackers. The current communication encryption technology is difficult to cope with increasingly complex network attacks. Therefore, a more secure and reliable communication encryption method is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of the present specification provides an end-to-end data processing method, which is applied to a data sending end. One or more embodiments of the present specification also relate to an end-to-end data processing method, which is applied to a data receiving end, an end-to-end data processing device, which is configured at a data sending end, an end-to-end data processing device, which is configured at a data receiving end, a computing device, a computer-readable storage medium, and a computer program product, to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, an end-to-end data processing method is provided, which is applied to a data sending end, and includes:
[0006] Determining a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key;
[0007] Determine a first private key and a first public key of a data sending end according to a first protocol;
[0008] Sending the first public key to the data receiving end, and receiving the second public key sent by the data receiving end, wherein the second public key is generated based on the second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol;
[0009] According to the second protocol, determining a first calculation coefficient corresponding to the first private key, generating a shared key according to the first calculation coefficient and the second public key, and encrypting the target data based on the shared key to obtain target encrypted data;
[0010] The target encrypted data is sent to a data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
[0011] According to a second aspect of an embodiment of this specification, an end-to-end data processing method is provided, which is applied to a data receiving end, and includes:
[0012] Determining a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key;
[0013] Determine a second private key and a second public key of the data receiving end according to the first protocol;
[0014] Sending the second public key to the data sending end, and receiving the first public key sent by the data sending end, wherein the first public key is generated based on the first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol;
[0015] Determine, according to the second protocol, a second calculation coefficient corresponding to the second private key, and generate a shared key according to the second calculation coefficient and the first public key;
[0016] Receive target encrypted data sent by a data sender, and decrypt the target encrypted data based on a shared key to obtain target data, wherein the target encrypted data is obtained by the data sender generating a shared key based on a first private key and a second public key according to a second protocol, and encrypting the target data based on the shared key.
[0017] According to a third aspect of an embodiment of this specification, there is provided an end-to-end data processing device, which is configured at a data sending end and includes:
[0018] A first acquisition module is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key;
[0019] A first determination module is configured to determine a first private key and a first public key of a data sending end according to a first protocol;
[0020] A first receiving module is configured to send a first public key to a data receiving end, and receive a second public key sent by the data receiving end, wherein the second public key is generated based on a second private key of the data receiving end, and the second public key and the second private key are determined according to a first protocol;
[0021] an encryption module, configured to determine a first calculation coefficient corresponding to a first private key according to a second protocol, generate a shared key according to the first calculation coefficient and a second public key, and encrypt target data based on the shared key to obtain target encrypted data;
[0022] The sending module is configured to send the target encrypted data to a data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
[0023] According to a fourth aspect of an embodiment of this specification, there is provided an end-to-end data processing device, which is configured at a data receiving end and includes:
[0024] A second acquisition module is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key;
[0025] A second determination module is configured to determine a second private key and a second public key of the data receiving end according to the first protocol;
[0026] A second receiving module is configured to send the second public key to the data sending end, and receive the first public key sent by the data sending end, wherein the first public key is generated based on the first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol;
[0027] A generating module, configured to determine a second calculation coefficient corresponding to a second private key according to a second protocol, and generate a shared key according to the second calculation coefficient and the first public key;
[0028] The decryption module is configured to receive target encrypted data sent by a data sender, and decrypt the target encrypted data based on a shared key to obtain target data, wherein the target encrypted data is obtained by the data sender generating a shared key based on a first private key and a second public key according to a second protocol, and encrypting the target data based on the shared key.
[0029] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including:
[0030] Memory and processor;
[0031] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned end-to-end data processing method are implemented.
[0032] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned end-to-end data processing method are implemented.
[0033] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned end-to-end data processing method when executed by a processor.
[0034] An embodiment of the present specification implements determining a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; according to the first protocol, determining a first private key and a first public key of a data sending end; sending the first public key to a data receiving end, and receiving a second public key sent by the data receiving end, wherein the second public key is generated based on the second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol; according to the second protocol, determining a first calculation coefficient corresponding to the first private key, generating a shared key based on the first calculation coefficient and the second public key, and encrypting target data based on the shared key to obtain target encrypted data; sending the target encrypted data to the data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, and decrypt the target encrypted data based on the shared key to obtain the target data.
[0035] In this way, by determining the first private key and the first public key of the data sending end according to the first protocol, the second public key of the data receiving end can be exchanged based on the first public key, so that the data sending end can generate a shared key based on the first private key and the second public key according to the second protocol, and the data receiving end can generate the same shared key based on the second private key and the first public key according to the second protocol, thereby realizing end-to-end data encryption transmission; and, since the public key is exchanged, even if the attacker intercepts the public key from the key exchange process, the shared key cannot be cracked based on the public key, which can effectively ensure the security of the key and thus improve the security of the encrypted data; encrypting the target data by the shared key can improve the security of the end-to-end data transmission process and ensure the security of privacy data. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is an architecture diagram of an end-to-end data processing system provided by an embodiment of this specification;
[0037] Figure 2 This is a flow chart of an end-to-end data processing method provided by an embodiment of this specification, and the method is applied to a data sending end;
[0038] Figure 3a is a schematic diagram of determining a third point based on a slope provided by an embodiment of this specification;
[0039] Figure 3b is a schematic diagram of determining a third point based on two points provided by an embodiment of this specification;
[0040] Figure 3c It is a schematic diagram of an infinite point provided by an embodiment of this specification;
[0041] Figure 4 is a shared key encryption flow chart provided by an embodiment of this specification;
[0042] Figure 5 is a key update flow chart provided by an embodiment of this specification;
[0043] Figure 6 is a Hamming code encoding flow chart provided by an embodiment of this specification;
[0044] Figure 7 is a message digest processing flow chart provided by an embodiment of this specification;
[0045] Figure 8 is a flow chart of an end-to-end data processing method provided by an embodiment of this specification, and the method is applied to a data receiving end;
[0046] Fig. 9 is a shared key decryption flow chart provided by an embodiment of this specification;
[0047] Fig.10 This is a data integrity check and data recovery flow chart provided by an embodiment of this specification;
[0048] Fig.11 is a Hamming code error correction flow chart provided by an embodiment of this specification;
[0049] Fig.12 This is an architecture diagram of a BMC-client communication encryption and decryption system provided by an embodiment of this specification;
[0050] Fig.13 is a flow chart of a data encryption and data decryption process provided by an embodiment of this specification;
[0051] Fig.14 It is a structural diagram of an end-to-end data processing device provided by an embodiment of the present specification, and the device is configured at a data sending end;
[0052] Fig.15 It is a structural diagram of an end-to-end data processing device provided by an embodiment of the present specification, and the device is configured at a data receiving end;
[0053] Fig.16 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0054] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0055] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0056] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0057] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0058] First, the terms involved in one or more embodiments of this specification are explained.
[0059] BMC (Baseboard Management Controller): is an embedded management controller, usually located on the server motherboard. It is mainly responsible for monitoring, managing and remotely operating the server.
[0060] SSL (Secure Sockets Layer): is an encryption protocol used for network communications, which provides encryption, authentication and data integrity protection functions at the transport layer. The SSL protocol is not absolutely secure. If the SSL certificate is issued incorrectly or the security of the certificate authority itself is compromised, the security of SSL encryption will be affected.
[0061] TLS (Transport Layer Security): is a standard protocol for providing security in network communications, designed to protect the security of data transmission between clients (such as web browsers, mobile applications, etc.) and servers (such as web servers, API servers, etc.). The TLS protocol uses asymmetric encryption technology to securely exchange a symmetric key between the client and the server. This symmetric key will be used in the subsequent data encryption and decryption process.
[0062] ECC (Elliptic Curve Cryptography) protocol: provides an encryption algorithm based on mathematical operations on elliptic curves. Due to the complexity and unpredictability of elliptic curves, it is very difficult to crack ECC encryption, so that data encryption transmission with higher security and higher computing efficiency can be achieved through shorter key lengths.
[0063] Modular multiplication modulus value: Since ECC encryption is performed on a finite field, modular multiplication modulus value can be used to perform modular operations to ensure that the result of the multiplication operation will not exceed the range of the finite field. In addition, defining a unified modular multiplication modulus value on a finite field can make all operations follow the same rules, facilitating the implementation and standardization of the algorithm. Based on the complexity of the ECC algorithm, the modular multiplication modulus value can also greatly increase the difficulty of cracking encryption and improve the security of encryption.
[0064] AES-256-CBC encryption algorithm: is an encryption algorithm that combines the Advanced Encryption Standard (AES) and Cipher Block Chaining (CBC). AES is a symmetric encryption algorithm, and CBC mode is an operation mode used to process data in block encryption to improve encryption security.
[0065] SHA-256(S): is a one-way hash function that can convert an input (message or data) of any length into an output of a fixed length (256 bits, or 32 bytes).
[0066] Hamming code: It is a linear debugging code widely used in data transmission and storage. By adding redundant bits (check bits) to the original data, it can detect and correct single-bit errors during data transmission or storage, thereby improving data transmission accuracy and reliability.
[0067] BMC is a controller used to monitor and manage servers. It can record basic server information (such as server host name, IP address, model, manufacturer, production date, production and technical information of each component, chassis information, motherboard information, etc.), and can monitor the temperature, voltage and other health status of each server component (such as CPU, memory, hard disk, fan, chassis, etc.) in real time. The remote control and management functions provided by BMC can support the client to remotely control the server to perform operations such as power on and off, restart, maintenance, firmware update, system installation, etc., and support remote viewing of various server events and log information (such as hardware errors, operating system errors, user operations, etc.), which greatly facilitates the work of administrators.
[0068] In order to ensure the security of data transmission during BMC remote communication, encryption protocols such as SSL or TLS are usually used for data transmission to ensure that data is not stolen or tampered with during transmission. However, in SSL or TLS communication, the client and BMC control end often use certificates for identity authentication. If an attacker can forge a valid certificate or use DNS spoofing to make the client trust the forged certificate, a man-in-the-middle attack may be possible, which may lead to security risks such as attackers intercepting, tampering with or stealing communication data. Therefore, the current encrypted communication methods cannot better cope with increasingly complex network attacks, and a more secure and reliable end-to-end encryption method is urgently needed.
[0069] Based on this, an embodiment of the present specification provides an end-to-end data processing method, which determines a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; according to the first protocol, determines a first private key and a first public key of a data sending end; sends the first public key to a data receiving end, and receives a second public key sent by the data receiving end, wherein the second public key is generated based on the second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol; according to the second protocol, determines a first calculation coefficient corresponding to the first private key, generates a shared key based on the first calculation coefficient and the second public key, and encrypts target data based on the shared key to obtain target encrypted data; sends the target encrypted data to a data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, and decrypts the target encrypted data based on the shared key to obtain the target data.
[0070] In this way, by determining the first private key and the first public key of the data sending end according to the first protocol, the second public key of the data receiving end can be exchanged based on the first public key, so that the data sending end can generate a shared key based on the first private key and the second public key according to the second protocol, and the data receiving end can generate the same shared key based on the second private key and the first public key according to the second protocol, thereby realizing end-to-end data encryption transmission; and, since the public key is exchanged, even if the attacker intercepts the public key from the key exchange process, the shared key cannot be cracked based on the public key, which can effectively ensure the security of the key and thus improve the security of the encrypted data; encrypting the target data by the shared key can improve the security of the end-to-end data transmission process and ensure the security of privacy data.
[0071] In this specification, an end-to-end data processing method is provided, which is applied to a data sending end. This specification also relates to an end-to-end data processing method, which is applied to a data receiving end, an end-to-end data processing device, which is configured at a data sending end, an end-to-end data processing device, which is configured at a data receiving end, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0072] See also Figure 1 , Figure 1 The data processing system 100 includes a data sending end 102 and a data receiving end 104 .
[0073] The data sending end 102 is used to determine a first private key according to a preset key generation protocol; and generate a first public key based on the first private key.
[0074] The data receiving end 104 is used to determine the second private key according to a preset key generation protocol; and generate a second public key based on the second private key.
[0075] The data sending end 102 is also used to exchange public keys with the data receiving end 104, send a first public key to the data receiving end 104, and receive a second public key sent by the data receiving end 104; generate a shared key based on the first private key and the second public key.
[0076] The data receiving end 104 is also used to exchange public keys with the data sending end 102, send the second public key to the data receiving end 104, and receive the first public key sent by the data receiving end 104; generate a shared key based on the second private key and the first public key.
[0077] In actual applications, the data transmitting end 102 and the data receiving end 104 can be a BMC control end or a client. When the BMC control end transmits data to the client, the BMC control end is the data transmitting end and the client is the data receiving end; when the client transmits data to the BMC control end, the BMC control end is the data receiving end and the client is the data transmitting end. The client can include one or more.
[0078] In order to ensure the security of data transmission, the BMC control end can agree on encryption keys with each client before establishing a communication connection with each client. The encryption keys between different clients and the BMC control end can be different. In this way, during the process of establishing a communication connection for data transmission, data encryption transmission is performed based on the encryption key agreed between the two ends.
[0079] In an optional embodiment of the present specification, the BMC control terminal may send a communication connection establishment request to each client, and when the target client returns a response message, send a key generation instruction to the target client, wherein the target client is a client among the clients that agrees to establish a communication connection with the BMC control terminal, and the key generation instruction carries a preset key generation protocol. The preset key generation protocol may indicate a method for generating a key, and specifically, may specify an algorithm for generating a key. The algorithm for generating a key may include an algorithm for generating a private key and a public key, and may also include an algorithm for generating a shared key based on a private key and a public key.
[0080] Further, the BMC control end can determine the first private key based on a preset key generation protocol, generate a first public key based on the first private key, and send the first public key to the target client. The target client can respond to the key generation instruction, generate a second private key based on the same preset key generation protocol, generate a second public key based on the second private key, and send the second public key to the BMC control end.
[0081] In another optional embodiment of the present specification, the client may send a communication connection establishment request to the BMC control end, and the BMC control end may establish a communication connection with the client in response to the communication connection establishment request, and send a key generation instruction to the client, wherein the key generation instruction carries a preset key generation protocol.
[0082] Alternatively, the client may send a key generation instruction carrying a preset key generation protocol to the BMC control terminal.
[0083] In actual applications, before the BMC control end establishes a communication connection with each client, the communicating parties can agree on the same preset key generation protocol and generate a shared key between the two ends according to the preset key generation protocol, thereby performing data encryption transmission or decryption processing based on the shared key.
[0084] Furthermore, when the BMC control end and each client agree on the same shared key based on a preset key generation protocol and implement data encryption transmission based on the shared key, the old shared key can also be dynamically updated according to the key update mechanism, thereby avoiding the risk of data leakage caused by the key being cracked by an attacker.
[0085] In an optional embodiment of the present specification, the BMC control end may stop sending data packets to the client based on the key update mechanism, and send a key update instruction to the client.
[0086] In response to the key update instruction, the client stops sending data packets to the BMC control end, generates a new second private key and a new second public key based on the preset encryption protocol, and sends the new second public key to the BMC control end. The BMC control end can generate a new first private key and a new first public key based on the preset encryption protocol, and send the new first public key to the client. The client generates a new shared key based on the new second private key and the new first public key, and the BMC control end generates a new shared key based on the new first private key and the new second public key. Both ends perform subsequent data communication based on the new shared key.
[0087] In another optional embodiment of the present specification, the client may stop sending data packets to the BMC control terminal based on the key update mechanism, and send a key update instruction to the BMC control terminal.
[0088] In response to the key update instruction, the BMC control end stops sending data packets to the client, generates a new first private key and a new first public key based on the preset encryption protocol, and sends the new first public key to the client. The client generates a new second private key and a new second public key based on the preset encryption protocol, and sends the new second public key to the client. The BMC control end generates a new shared key based on the new first private key and the new second public key, and the client generates a new shared key based on the new second private key and the new first public key. Both ends perform subsequent data communication based on the new shared key.
[0089] Specifically, the key update mechanism can be used to specify the triggering conditions for updating the shared key between the two ends. The triggering conditions may include at least one of the following conditions: the communication time exceeds a preset threshold, the number of attacks exceeds a preset threshold, the communication traffic exceeds a preset threshold, etc.; a multi-dimensional preset threshold may also be determined based on a combination of multiple conditions, and the triggering condition may include a result calculated based on multiple conditions exceeding the multi-dimensional preset threshold.
[0090] By applying this embodiment, the data sending end and the data receiving end respectively determine the corresponding private key and public key based on the same preset key generation protocol, exchange the public keys, and generate the same shared key based on the exchanged public key and the private key of each end, thereby realizing encrypted data transmission between the ends. The data sending end can encrypt the data packet based on the shared key before sending the data, and the data receiving end can decrypt the encrypted data packet based on the shared key after receiving the encrypted data packet, thereby obtaining the data. Since only the public key is exchanged between the two ends, even if the attacker obtains the public key through a man-in-the-middle attack, the shared key cannot be cracked based on the public key, thereby improving data security and making end-to-end communication more secure and reliable.
[0091] See also Figure 2 , Figure 2 A flow chart of an end-to-end data processing method provided according to an embodiment of the present specification is shown. The method is applied to a data sending end and specifically includes the following steps.
[0092] Step 202: Determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key.
[0093] In actual applications, in the process of data interaction between the two ends, in order to protect data security and avoid privacy data leakage, the same preset key generation protocol can be agreed upon before data transmission, so that key data can be generated at each end based on the preset key generation protocol.
[0094] According to an optional embodiment of the present specification, the data sending end may determine a preset key generation protocol.
[0095] Specifically, the preset key generation protocol can indicate the generation method of the public-private key pair and the shared key. The preset key generation protocol may include a first protocol for generating a private key and a public key and a second protocol for generating a shared key.
[0096] In an optional embodiment of the present specification, determining a preset key generation protocol may include:
[0097] The data sending end determines the preset key generation protocol according to the preset encryption protocol.
[0098] In actual applications, the data sending end can determine the preset key generation protocol based on the preset encryption protocol, and send the preset key generation protocol to the data receiving end, so that the data receiving end can generate the public and private key pair of the data receiving end based on the same preset key generation protocol, and exchange the public key with the data sending end, thereby generating the same shared key at both ends based on its own private key and the exchanged public key.
[0099] Specifically, the preset encryption protocol may be an ECC protocol, which specifies a data encryption method based on an elliptic curve function and can determine a set of complex and difficult-to-crack key generation methods based on the characteristics of the elliptic curve function.
[0100] In the actual implementation process, according to the preset encryption protocol, a first protocol for generating a private key and a public key, and a second protocol for generating a shared key can be determined.
[0101] It should be noted that in order to ensure that the shared key generated between the two ends of data exchange is the same, the first protocol and the second protocol agreed upon based on the preset encryption protocol between the two ends need to be the same.
[0102] In another optional embodiment of the present specification, determining a preset key generation protocol may include:
[0103] The data sending end receives the preset key generation protocol sent by the data receiving end.
[0104] In actual applications, the data receiving end can determine the preset key generation protocol based on the preset encryption protocol, and then send the preset key generation protocol to the data sending end, so that the data sending end can generate the public and private key pair of the data sending end based on the same preset key generation protocol, and exchange the public key with the data receiving end, thereby generating the same shared key for both ends based on its own private key and the exchanged public key.
[0105] Step 204: Determine a first private key and a first public key of the data sending end according to the first protocol.
[0106] In actual applications, before the data sending end sends the data to be transmitted to the data receiving end, the first private key and the first public key of the data sending end can be determined according to the first protocol.
[0107] Specifically, the data sending end can be understood as the sender of the data to be transmitted. The first private key can be understood as a private key determined by the data sending end, and the private key is used to be stored in the data sending end. The first public key can be understood as a public key determined by the data sending end, and the public key is used to be sent to the data receiving end, so as to exchange public keys with the data receiving end.
[0108] The first protocol can indicate the generation method of the first private key and the first public key. The first protocol may include encryption parameter information determined based on the ECC protocol, such as parameter information of the elliptic function curve, initial coordinate points, password table length, modular multiplication modulus value and other information; the first protocol can also specify the generation algorithm of the private key and the public key.
[0109] In actual applications, based on encryption parameter information and the generation algorithm of private key and public key, the public key corresponding to the private key can be generated on the basis of determining the private key, thereby obtaining a public-private key pair. The public key in the public-private key pair is used to exchange the public key with the other end. After the public key is exchanged, a shared key can be generated based on the private key of the local end and the public key of the other end.
[0110] In actual implementation, the data sending end can be either the BMC control end or any client that establishes a communication connection with the BMC control end. When the BMC control end transmits data to the client, the BMC control end is the data sending end; when the client transmits data to the BMC control end, the client is the data sending end.
[0111] In an optional embodiment of the present specification, before the data sending end and the data receiving end establish a communication connection, the data sending end may send a key generation instruction carrying a preset key generation protocol to the data receiving end; or, the data receiving end may send a key generation instruction carrying a preset key generation protocol to the data sending end.
[0112] Furthermore, in the case where the data sending end and the data receiving end respectively generate a shared key based on the same preset encryption protocol, a communication connection is established between the data sending end and the data receiving end and data transmission is performed.
[0113] In another optional embodiment of the present specification, when a communication connection is established between the data sending end and the data receiving end, and there is no shared key that meets the security requirements between the data sending end and the data receiving end, the data sending end may send a key generation instruction carrying a preset encryption protocol to the data receiving end; or, the data receiving end may send a key generation instruction carrying a preset key generation protocol to the data sending end.
[0114] Furthermore, data transmission is performed when the data sending end and the data receiving end respectively generate shared keys that meet security requirements based on the same preset key generation protocol.
[0115] According to one or more optional embodiments of the present specification, determining the first private key and the first public key of the data sending end according to the first protocol may include the following steps:
[0116] Obtain parameter information, initial coordinate points and preset value range of the target elliptic function curve;
[0117] Determine a target integer within a preset value range as a first private key, wherein the target integer is any integer within the preset value range;
[0118] According to the parameter information and the initial coordinate point, a first coordinate point corresponding to the target integer on the target elliptic function curve is generated, and the first coordinate point is determined as the first public key.
[0119] In actual applications, based on the encryption parameter information and the public-private key generation algorithm specified in the first protocol, a first private key and a first public key of the data sender can be generated.
[0120] Specifically, the encryption parameter information may include parameter information, initial coordinate points, and preset value ranges of the target elliptic function curve. The target elliptic function curve can be understood as an elliptic function curve determined based on the ECC protocol. The parameter information can be used to characterize the physical meaning of the target elliptic function curve; based on the parameter information, the function graph of the target elliptic function curve and the finite field corresponding to the various calculation results calculated according to the target elliptic function curve can be determined. The parameter information may specifically include the linear term coefficient (a), constant term (b), modular multiplication modulus value (p), etc. of the target elliptic function curve. Among them, through the modular multiplication modulus value, the coordinate value of the point on the elliptic function curve obtained by calculation can be converted into an integer value through modular multiplication inverse element conversion, so that the calculated key data can be an integer, which is convenient for subsequent encryption based on the key data.
[0121] Optionally, the curve equation of the target elliptic function curve may be as shown in the following formula (1).
[0122] Formula (1)
[0123] Specifically, the initial coordinate point can be understood as any integer coordinate point determined based on the target elliptic function curve, that is, the initial coordinate point is any integer point on the target elliptic function curve. Based on the initial coordinate point and parameter information, multiple integer coordinate points on the target elliptic function curve can be determined, so that the password table and password table length corresponding to the target elliptic function curve can be determined.
[0124] The preset value range can be determined according to the length of the password table, which can be understood as the integer value range of the private key, that is, the value range corresponding to the private key. Optionally, the preset value range can include the entire password table, or a part of the password table can be selected, which can be determined according to the needs of the actual application.
[0125] In the actual implementation process, when the data sending end and the data receiving end unify the parameter information, initial coordinate points and preset value range of the target elliptic function curve, the data sending end and the data receiving end can respectively generate different public-private key pairs based on the same target elliptic function curve (that is, the same parameter information), the same initial coordinate points and the same preset value range, and further generate the same shared key.
[0126] Optionally, the parameter information and initial coordinate points of the target elliptic function curve can be predefined according to actual needs. Based on the parameter information and the initial coordinate points, a complete password table can be calculated and the length of the password table can be determined, thereby determining the preset value range.
[0127] The following is combined with Figure 3a-3c , an example is given to illustrate the method of determining the preset value range. Figure 3a A schematic diagram of determining a third point based on a slope provided by an embodiment of this specification is shown; Figure 3b A schematic diagram of determining a third point based on two points provided by an embodiment of this specification is shown; Figure 3c A schematic diagram of an infinity point provided by an embodiment of the present specification is shown.
[0128] See also Figure 3a , the slope information corresponding to the initial coordinate point can be determined according to the parameter information, and based on the principle of determining the third point by the slope, the initial coordinate point (named point G) and point G are calculated, and the calculation result is inverted by modular multiplication to obtain the next integer coordinate point (named point 2G).
[0129] See also Figure 3b On the basis of determining the 2G point, we can calculate the 2G point and the G point based on the principle of determining the third point by two points, and inverse the calculation result through modular multiplication to obtain the next integer coordinate point (named as the 3G point). Further, on the basis of determining the 3G point, we can continue to calculate the 3G point and the G point based on the principle of determining the third point by two points, and inverse the calculation result through modular multiplication to obtain the 4G point; calculate the 4G point and the G point to obtain the 5G point... and so on, until the nG point (n is an integer) is obtained.
[0130] See also Figure 3c , the nG point can be understood as the point where the result of the first n·G is infinite.
[0131] Based on the above processing, the password sequence from G to nG can be calculated based on the parameter information (a, b, modulus p) of the target elliptic function curve and the initial coordinate point (G). Through G to nG, the length of the password table can be determined, thereby determining the preset value range.
[0132] In the following example, p=101, a=0, b=17, and the G coordinate value is (4,9). The specific calculation method of the key sequence can refer to the following steps S1-S3:
[0133] S1: Define elliptic curve Specific parameters.
[0134] For example, set a = 0, b = 17, modulo p = 101; obtain the curve .
[0135] It should be noted that when using elliptic curves to calculate data, the third point can be obtained based on two points in the following two ways.
[0136] The first method: double point formula (the coordinates of the two points are the same, both (x1, y1)). The specific calculation formula can be found in the following formulas (2) to (4).
[0137] Formula (2)
[0138] Formula (3)
[0139] Formula (4)
[0140] The second method: point addition formula (the coordinates of the two points are different, one is (x1, y1) and the other is (x2, y2)). The specific calculation formula can be found in the following formulas (5) to (7).
[0141] Formula (5)
[0142] Formula (6)
[0143] Formula (7)
[0144] Specifically, λ is the slope. In the first method above, since there is only one point coordinate (x1, y1), λ is the slope of the tangent calculated based on the function itself. In the second method above, there are two different point coordinates (x1, y1) and (x2, y2), and λ is the slope of the line equation connecting these two points, calculated based on the coordinates of these two points.
[0145] S2: Take a base point G(4,9) on the elliptic curve and calculate the 2G point based on G and G using the doubling point formula.
[0146] The specific calculation process is as follows:
[0147]
[0148]
[0149]
[0150] In this way, the 2G point (44,19) can be obtained.
[0151] S3: Calculate 3G point by adding 2G and G.
[0152] The specific calculation process is as follows:
[0153]
[0154]
[0155]
[0156] In this way, the 3G point (72,75) can be obtained.
[0157] Furthermore, 3G and G are calculated using point addition to obtain 4G, and 4G and G are calculated using point addition to obtain 5G... and so on, the password sequence shown in Table 1 below can be obtained.
[0158] It should be noted that Table 1 shows the key sequence obtained using relatively simple ECC curve parameters. In practical applications, more complex key data can be generated by optimizing the coordinates of the G point and the values of a, b and the modulus p.
[0159] Table 1
[0160]
[0161] Optionally, according to the private key generation algorithm specified in the first protocol, when a preset value range is determined, the data sending end can select any integer within the preset value range as the first private key.
[0162] Furthermore, when the first private key is determined, the first public key can be obtained by performing modular multiplication on the first private key and the initial coordinate point according to the public key generation algorithm specified in the first protocol.
[0163] Exemplarily, assuming that the data sender determines the integer 5 as the first private key of the data sender, based on 5·G, the first public key 5G (90, 91) of the data sender can be calculated.
[0164] It should be noted that in the process of calculating the key data based on the parameter information and the initial coordinate point, the specific coordinate values of 2G-nG can be obtained by real-time calculation by calling the method in the openssl library. By using real-time calculation instead of pre-generating the password table and reading the table, it is possible to avoid the problem of excessive memory usage and high performance consumption caused by storing and reading the table when the n value is large.
[0165] Exemplarily, the key data generation method based on the ECC protocol that can be called in the openssl library may include: #include<openssl / ec.h> 、#include<openssl / obj_mac.h> 、#include<openssl / bn.h> 、#include<openssl / ecdsa.h> wait.
[0166] By applying this embodiment, through the ECC protocol, the data sending end and the data receiving end determine the same parameter information, initial coordinate point and preset value range, so that the data sending end can determine the first private key according to the preset value range, and generate the first public key based on the first private key, the initial coordinate point and the parameter information; the data receiving end can determine the second private key according to the preset value range, and generate the second public key based on the second private key, the initial coordinate point and the parameter information. The generation efficiency of private keys and public keys can be improved, and the key security can be improved.
[0167] Furthermore, more complex key data can be generated by optimizing parameter information (i.e., a, b, and modulus value p). In this way, it is basically impossible to determine the other party's private key by reading the table, which can further improve the reliability of the encryption key and the security of the encrypted data.
[0168] Step 206: Send the first public key to the data receiving end, and receive the second public key sent by the data receiving end, wherein the second public key is generated based on the second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol.
[0169] In actual applications, the data sending end can send the first public key to the data receiving end, and receive the second public key sent by the data receiving end, so that the data sending end can generate a shared key based on the first private key and the second public key, and the data receiving end can generate a shared key based on the second private key and the first public key.
[0170] According to an optional embodiment of the present specification, the data sending end can send a public key exchange request to the data receiving end after determining the first private key and generating the first public key based on the first private key. When the data receiving end sends a response message agreeing to the exchange, the data sending end sends the first public key to the data receiving end and receives the second public key sent by the data receiving end.
[0171] According to another optional embodiment of the present specification, the data sending end may also send the first public key to the data receiving end in response to the public key exchange request sent by the data receiving end, and receive the second public key sent by the data receiving end.
[0172] Optionally, the data sending end may also carry a security token of the data sending end in the first public key; the data receiving end may verify the identity of the data sending end based on the security token, and if the verification is successful, receive the first public key, and send the second public key carrying the security token of the data receiving end to the data sending end. The data sending end may also verify the identity of the data receiving end based on the security token, and if the verification is successful, receive the second public key.
[0173] Optionally, QKD (Quantum Key Distribution) technology can be used to achieve a higher level of key exchange security.
[0174] Specifically, QKD technology is an innovative method that uses the characteristics of quantum mechanics to ensure the security of communications. QKD technology enables both parties to generate and share a random, secure key for message encryption and decryption. QKD technology is based on the basic principles of quantum mechanics, especially the non-cloning of quantum states and the measurement interference, to ensure the security of the communication process.
[0175] Optionally, the implementation method of QKD can be determined according to the needs in practical applications, and can mainly include a method based on preparation and measurement (BB84 protocol) and a method based on entangled states (E91 protocol).
[0176] Among them, the BB84 protocol uses four different quantum states to encode key information and detects eavesdropping by randomly selecting a measurement basis. The E91 protocol uses quantum entangled states to distribute keys and generates keys by measuring the state of entangled photons.
[0177] In the actual implementation process, a higher level of key exchange security can be achieved by integrating QKD technology on the BMC control end.
[0178] Step 208: According to the second protocol, determine the first calculation coefficient corresponding to the first private key, generate a shared key according to the first calculation coefficient and the second public key, and encrypt the target data based on the shared key to obtain the target encrypted data.
[0179] In actual applications, when the data sending end determines the first private key and receives the second public key sent by the data receiving end, it can generate a shared key based on the first private key and the second public key according to the second protocol; and encrypt the target data based on the shared key to obtain the target encrypted data, thereby realizing encrypted transmission of data.
[0180] Specifically, the target data can be understood as the plaintext data of the data to be transmitted, and the target encrypted data can be understood as the encrypted data after the plaintext data is encrypted based on the shared key. The second protocol can specify the shared key generation algorithm. The two ends of the data exchange can generate the same shared key based on the same shared key generation algorithm.
[0181] The first calculation coefficient is determined according to the first private key, and the first calculation coefficient represents the number of calculations on the second public key.
[0182] According to an optional embodiment of the present specification, generating a shared key based on the first private key and the second public key according to the second protocol may include the following steps:
[0183] Determine a first calculation coefficient corresponding to the first private key;
[0184] A shared key is generated according to the first calculation coefficient and the second public key.
[0185] Specifically, the first calculation coefficient can be understood as the number of calculations of the second public key.
[0186] In practical applications, the calculation coefficient corresponding to the second public key can be determined based on the first private key, so that the first calculation coefficient can be calculated multiple times on the second public key according to the shared key generation algorithm specified in the second protocol to obtain the shared key.
[0187] Optionally, the first calculation coefficient is the first private key-1; the shared key generation algorithm may include a doubling formula and a point addition formula.
[0188] In the actual implementation process, when the data sending end generates the first private key and receives the second public key sent by the data receiving end, the first calculation coefficient can be determined to be the first private key-1; the first private key-1 calculation is performed on the exchanged second public key according to the shared key generation algorithm to obtain the shared key. Correspondingly, when the data receiving end generates the second private key and receives the first public key sent by the data sending end, the second calculation coefficient can be determined to be the second private key-1; the second private key-1 calculation is performed on the exchanged first public key according to the shared key generation algorithm to obtain the same shared key.
[0189] Exemplarily, generating a shared key based on the first private key and the second public key may include:
[0190] Assuming that the data sending end determines the integer 5 in the preset value range 1-n as the first private key of the data sending end, based on 5·G, the first public key 5G (90,91) of the data sending end can be calculated; the data receiving end determines the integer 6 in 1-n as the second private key of the data receiving end, and based on 6·G, the second public key 6G (71,61) of the data receiving end can be calculated. The data sending end exchanges the first public key 5G and the second public key 6G with the data receiving end. Based on the first private key 5 and the second public key 6·G, the data sending end can calculate the shared key 30G based on 30·G; based on the second private key 6 and the first public key 5·G, the data receiving end can also calculate the same shared key 30G based on 30·G.
[0191] The following takes the process of generating a shared key based on the first private key and the second public key by the data sending end as an example to further illustrate the specific generation process of the shared key.
[0192] Using the above example, the data sending end determines the first private key as 5, and calculates the first public key 5G based on the first private key; the data receiving end determines the second private key as 6, and calculates the second public key 6G based on the second private key. After the two ends exchange public keys, the data sending end calculates the shared key 30G based on the first private key 5 and the second public key 6G.
[0193] The specific calculation process is as follows:
[0194] The data sending end receives the second public key 6G, the cumulative number of times is 1;
[0195] Based on the first private key 5, the second public key 6G is multiplied by 5-1 times, that is, 4 times, to obtain the shared key 30G.
[0196] Specifically, the first calculation process is 6G times 6G, resulting in 12G; the second calculation process is 12G plus 6G, resulting in 18G; the third calculation process is 18G plus 6G, resulting in 24G; the fourth calculation process is 24G plus 6G, resulting in 30G.
[0197] Correspondingly, the process of generating a shared key based on the second private key and the first public key at the data receiving end is similar to the above process.
[0198] The data receiving end determines that the second private key is 6, and calculates the first public key 6G based on the first private key; after the two ends exchange public keys, the data receiving end calculates the shared key 30G based on the second private key 6 and the first public key 5G.
[0199] The specific calculation process is as follows:
[0200] The data receiving end receives the first public key 5G, the cumulative number of times is 1;
[0201] Based on the second private key 6, the first public key 5G is multiplied by 6-1 times, that is, 5 times, to obtain the shared key 30G.
[0202] Specifically, the first calculation process is 5G times 5G, getting 10G; the second calculation process is 10G plus 5G, getting 15G; the third calculation process is 15G plus 5G, getting 20G; the fourth calculation process is 20G plus 5G, getting 25G; the fifth calculation process is 25G plus 5G, getting 30G.
[0203] That is to say, both ends calculate the exchanged public key m-1 times based on the private key coefficient m to obtain the same shared key.
[0204] By applying this embodiment, the data sending end and the data receiving end can determine the public and private key pairs generated by each end by agreeing on the same parameter information (a, b, modulus value p), initial coordinate point (G) and preset value range (1-n), and generate the same shared key based on each end's own private key and the exchanged public key. Based on the characteristics of the ECC protocol, even if the attacker obtains the public key, it is difficult to restore the corresponding private key based on the public key, so it is difficult to crack the shared key, which can improve the key security, thereby improving the security and reliability of the data transmission process. In addition, by using the openssl library to calculate the key data in real time, the key calculation efficiency can also be improved, thereby improving the efficiency of data encryption transmission.
[0205] According to one or more optional embodiments of the present specification, encrypting target data based on a shared key to obtain target encrypted data may include the following steps:
[0206] Determine the symmetric key corresponding to the initial vector and the shared key;
[0207] The target data is encrypted according to the initial vector and the symmetric key to obtain the target encrypted data.
[0208] In an optional embodiment of the present specification, determining the symmetric key corresponding to the initial vector and the shared key may include:
[0209] Based on the preset encryption algorithm, calculate the symmetric key corresponding to the shared key.
[0210] Specifically, the preset encryption algorithm may be an AES-256-CBC encryption algorithm. The shared key may be understood as a target coordinate value of a target coordinate point on a target elliptic function curve.
[0211] Optionally, based on the AES-256-CBC encryption algorithm, the target coordinate value of the shared key can be hashed using the SHA-256(S) hash function, and the calculation result can be mapped to an output of a fixed length (256 bits) to obtain a hash value of 256 bits in length, and the 256-bit hash value is determined as the symmetric key corresponding to the shared key.
[0212] Optionally, the AES-256-CBC encryption algorithm may be called to determine a random initialization vector.
[0213] In practical applications, by determining the symmetric key corresponding to the initial vector and the shared key, the target data can be encrypted according to the initial vector and the symmetric key, thereby realizing symmetric encryption between the data sender and the data receiver, and improving the data security of the encrypted data.
[0214] In an optional embodiment of the present specification, encrypting the target data according to the initial vector and the symmetric key to obtain the target encrypted data may include the following steps:
[0215] Split the target data into N data blocks, where N ≥ 1 and is a positive integer;
[0216] Based on the initial vector, perform XOR processing on the first data block, and encrypt the XOR processing result using the symmetric key to obtain the first encrypted data block;
[0217] Based on the i-th encrypted data block, perform XOR processing on the i+1-th data block, and encrypt the XOR processing result with the symmetric key to obtain the i+1-th encrypted data block, where 1≤i≤N-1 is a positive integer;
[0218] According to the 1st to Nth encrypted data blocks, target encrypted data is obtained.
[0219] The following combination Figure 4 , further explains an encryption processing method provided in this embodiment. Specifically, Figure 4 A shared key encryption flow chart provided by an embodiment of this specification is shown.
[0220] Get the target data to be encrypted and the shared key S (x, y) of the data sender; generate the symmetric key K (256 bits) corresponding to the shared key S (x, y) based on SHA-256 (S); call the AES-256-CBC encryption algorithm to generate a random initial vector IV (128 bits); divide the target data into data blocks [B1, ..., BN], where there are N data blocks in total, and N is a positive integer greater than or equal to 1.
[0221] Perform an XOR operation (XOR, symbol ⊕) on the data block B1 and the random initial vector IV, encrypt the XOR operation result with the symmetric key K, and obtain the encrypted data block C1; perform an XOR operation on the data block B2 and the encrypted data block C1, encrypt the XOR operation result with the symmetric key K, and obtain the encrypted data block C2; perform an XOR operation on the data block B3 and the encrypted data block C2, encrypt the XOR operation result with the symmetric key K, and obtain the encrypted data block C3; ... and so on, until performing an XOR operation on the data block BN and the encrypted data block CN-1, encrypting the XOR operation result with the symmetric key K, and obtaining the encrypted data block CN.
[0222] The N encrypted data blocks C1 to CN and IV are packaged to obtain target encrypted data. Specifically, the target encrypted data can be understood as the data in the data packet to be transmitted.
[0223] Furthermore, the AES-256-CBC encryption algorithm can be called to output 14 round keys (each round key is 128 bits). The round keys will perform byte substitution, row shift, column confusion and other operations on the data.
[0224] Optionally, before each XOR operation, the round key may be used to perform byte substitution, row shift, column confusion and other operations on the plaintext data block, and then the result processed by the round key is XORed with the IV, or the encrypted data block corresponding to the previous data block to obtain the XOR processing result.
[0225] Optionally, the specific implementation means of AES encryption and decryption can be implemented by calling the underlying function of the openssl library. Exemplarily, the callable method includes: #include<openssl / conf.h> 、#include<openssl / evp.h> 、#include<openssl / err.h> 、#include<openssl / rand.h> wait.
[0226] By applying this embodiment, the target data is divided into N data blocks, and an XOR operation is performed on the next data block based on the encryption result of the previous data block, and this cycle is repeated until each data block is encrypted with a symmetric key based on the result after the XOR operation. This can further increase the complexity of the encryption process, thereby improving the security of the password and better protecting the security of privacy data.
[0227] In the actual implementation process, when the communication traffic between the two ends is large, frequent key updates will affect system performance and reduce communication efficiency. However, as time goes by, the security of fixed keys will gradually decrease, making it difficult to cope with more complex network attacks.
[0228] Based on this, an embodiment of the present specification provides a dynamic key update mechanism, which can ensure data transmission efficiency while realizing dynamic key update, thereby taking into account both data security and transmission efficiency.
[0229] According to one or more optional embodiments of the present specification, before determining the first private key and the first public key of the data sending end, the following steps may also be included:
[0230] Determine the current communication index between the data sending end and the data receiving end;
[0231] When the current communication indicator is lower than a preset update threshold, a key update instruction is generated, wherein the key update instruction is used to instruct the data sending end and the data receiving end to perform key update.
[0232] Specifically, the current communication indicator can reflect the security level of the shared key used in the current transmission process. The preset update threshold can be understood as the security warning value of the shared key. When the current communication indicator is lower than the preset update threshold, it means that the security level of the current shared key is lower than the security warning value, and the current shared key is no longer secure and needs to be updated.
[0233] Optionally, the preset update threshold may be determined according to requirements in actual applications.
[0234] Specifically, the key update instruction can be understood as an instruction instructing the data sending end and the data receiving end to update the key.
[0235] In actual implementation, the above update mechanism can be implemented by the data sending end or the data receiving end; that is, it can be executed by the BMC control end or the client end, or can be executed by the BMC control end and the client end together.
[0236] Exemplarily, when the above update mechanism is executed by the BMC control end, the BMC control end can monitor the current communication index between the BMC control end and the client in real time, and when the current communication index is lower than the preset update threshold, stop transmitting data to the client and send a key update instruction to the client. The BMC control end regenerates the first private key and the first public key based on the key update instruction; the client regenerates the second private key and the second public key in response to the key update instruction, and both ends regenerate the updated shared key based on the exchanged public key and their respective private keys, and then perform subsequent data transmission based on the updated shared key.
[0237] By applying this embodiment, by determining the current communication indicators between the data sending end and the data receiving end, the security level of the shared key currently used between the two ends can be judged based on the current communication indicators and the preset update threshold, so that the key can be updated in time when the security level is lower than the security warning value, and data security can be better improved on the basis of ensuring data transmission efficiency.
[0238] In an optional embodiment of the present specification, the current communication indicator may be determined based on a security indicator of a single dimension.
[0239] Specifically, single-dimensional security indicators may include time length, communication traffic size, number of data anomalies, etc., where time length can be understood as the cumulative time that the current shared key has not been updated, that is, the cumulative usage time of the current shared key; the communication traffic size can be understood as the total communication traffic between the BMC control end and the client within the cumulative usage time, or the average communication traffic; the number of data anomalies may include the number of times the communication link has been attacked, the number of times data transmission errors have occurred (such as data loss, data tampering), etc.
[0240] In practical applications, a preset update threshold can be set based on any single-dimensional security indicator, and the above dynamic key update mechanism can be implemented based on the real-time monitored indicator and the preset update threshold. It is also possible to calculate a comprehensive indicator value based on any two or more single-dimensional security indicators, and pre-set the preset update threshold corresponding to the comprehensive indicator value.
[0241] Optionally, an AI-based intrusion detection system (IDS) can be integrated for real-time communication traffic analysis.
[0242] Specifically, IDS can monitor network or system activities in real time and detect and report any behavior that violates security policies or security vulnerabilities. IDS can promptly detect and block potential attacks and improve network and system security.
[0243] IDS usually implements communication detection based on the following steps: Capture data stream: capture network traffic data; Analyze data stream: deeply decode and analyze the captured data stream to extract and identify key information; Feature matching: compare and match the data stream with known attack features to determine whether there are malicious attacks and threats; Issue an alarm: when malicious attacks and threats are detected, an alarm is issued to the administrator so that the administrator can take timely measures.
[0244] In the actual implementation process, the IDS can be integrated into the BMC control end to analyze and detect the communication traffic between the BMC control end and each client, so as to trigger the key update in the event of a security alarm.
[0245] In another optional embodiment of the present specification, determining the current communication index between the data sending end and the data receiving end may include the following steps:
[0246] Obtain the accumulated usage time of the current shared key, the average communication flow rate between the data sender and the data receiver per unit time, and the number of communication anomalies within the accumulated usage time;
[0247] The current communication indicators are obtained based on the cumulative usage time, average communication traffic and number of communication anomalies.
[0248] Optionally, the cumulative usage time can be understood as the cumulative time (in min) from the last time the key was updated until the next time the key was updated. It can be determined based on the current time and the generation time of the current shared key; it can also be determined based on the current time and the sending time of the first data packet transmitted after encryption based on the current shared key.
[0249] Optionally, the unit time can be determined according to actual needs, and can usually be 1 minute.
[0250] Optionally, the number of communication anomalies can be determined based on the number of attacks, the number of data errors, etc. within the accumulated usage time.
[0251] In the actual implementation process, the current communication index is obtained according to the cumulative usage time, average communication traffic and number of communication anomalies, as shown in the following formula (8).
[0252] Formula (8)
[0253] Specifically, B(t) is the average communication flow per unit time (flow unit: megabytes (M)); t (unit: min) is the cumulative usage time; n is the number of communication anomalies within the cumulative usage time; and T is the current communication index obtained by calculation. K1, K2, and K3 are the impact factors of the three dimensions on the preset update thresholds. Among them, K1 is the impact factor of the current node's average communication flow on the preset update threshold, K2 is the impact factor of the cumulative usage time on the preset update threshold, and K3 is the impact factor of the number of communication anomalies on the preset update threshold.
[0254] Optionally, initially the three influencing factors K1, K2, and K3 may all be set equal to 1. Whenever a data anomaly occurs, it is equivalent to accumulating 60 minutes more time, and the effect of the data anomaly is directly linked to the accumulated time.
[0255] In actual implementation, when the current communication index of the communication channel between the data sending end and the data receiving end is less than a preset update threshold, the key update can be triggered immediately, and the other end of the communication channel connection can be notified to also update the key.
[0256] Exemplarily, when the BMC control end monitors that the current communication indicator T of the dedicated channel of the target client is less than a preset update threshold, the BMC control end may understand to update the current shared key and notify the client corresponding to the dedicated channel to also update the shared key.
[0257] In an optional embodiment of the present specification, the preset update threshold can be calculated based on the impact factor being 1, the average communication flow between the two ends being 1M / min, and the cumulative usage time being 1440min (24h). 1 / 1440 is obtained. That is, the preset update threshold can be set to 1 / 1440.
[0258] It should be noted that, in different projects, developers can set parameters according to actual conditions, so as to calculate different preset update thresholds.
[0259] See also Figure 5 , Figure 5 A key update flow chart provided by an embodiment of this specification is shown.
[0260] At the beginning, the BMC defines the initial public key and private key, and notifies each client 1 to client N to determine the initial public key and private key respectively. When the BMC and each client have exchanged public keys respectively, the initial shared key S1 between the BMC and client 1, the initial shared key S2 between the BMC and client 2, ..., and the initial shared key SN between the BMC and client N are calculated and obtained.
[0261] The BMC monitors the current communication indicators T1 to TN with each client respectively, determines T that is less than a preset update threshold, and notifies the corresponding client to update the key when T is less than the preset update threshold.
[0262] By applying this embodiment, the preset update threshold is determined based on the influencing factors of the three dimensions, and the current communication index in the communication process between the two ends is calculated in real time. The security of the current shared key can be comprehensively evaluated according to the communication flow, cumulative duration and number of abnormalities, and the key update can be triggered in time when it is lower than the preset update threshold, thereby improving the key security. In addition, the privacy data security can be guaranteed on the basis of taking into account the data transmission efficiency.
[0263] In practical applications, the network environment during data transmission may interfere with the integrity of the data, resulting in data loss or damage. In order to improve the anti-interference ability of data, automatic error correction of data can also be achieved based on the anti-interference coding mechanism.
[0264] According to one or more optional embodiments of the present specification, before encrypting the target data based on the shared key and obtaining the target encrypted data, the following steps may also be included:
[0265] Identify key data in the target data;
[0266] Determining at least one check bit of the key data based on the data bits of the key data;
[0267] At least one check digit is inserted into the key data, and a check digit value of each check digit is generated to obtain updated target data.
[0268] It should be noted that the coding method adopted by the anti-interference coding mechanism can be determined according to the needs of actual applications. One or more embodiments of this specification are based on the Hamming code coding method to further explain the implementation of the anti-interference coding mechanism.
[0269] Specifically, key data can be understood as privacy data or important information in the target data.
[0270] By way of example, key data may include account information, user personal data, and the like.
[0271] In an optional embodiment of the present specification, the target data as a whole may be encoded with a Hamming code, or the encrypted data after encryption may be encoded with a Hamming code as a whole.
[0272] In another optional embodiment of the present specification, in order to improve data transmission efficiency, Hamming code encoding may be performed only on key data in the target data, thereby avoiding loss or damage of the key data.
[0273] Optionally, the key data in the target data may be determined according to type information of each data item in the target data.
[0274] Optionally, determining at least one check bit of the key data according to the data bits of the key data may include:
[0275] Determine the first value and the first position corresponding to the data bit of the key data;
[0276] The second bit value and the second position of the check bit are determined according to the first bit value and the first position.
[0277] Specifically, the first bit value can be understood as the bit value of the data bit of the key data, for example, if the key data includes n bits, the first bit value is n. The first position can be understood as the position of the data bit.
[0278] The second digit value can be understood as the digit value of the check digit of the key data. Using the above example, based on the first digit n, the second digit value can be further determined. The second position can be understood as the position of the check digit.
[0279] Optionally, the second digit value may be determined based on the first digit value, and the specific calculation method may refer to the following formula (9).
[0280] Formula (9)
[0281] Among them, k is the second digit value, and n is the first digit value.
[0282] Optionally, the second position may be determined based on the first position. Typically, the check bit may be inserted into a power-of-two position of the data (eg, the first bit, the second bit, the fourth bit, etc.).
[0283] Optionally, inserting at least one check digit into the key data, generating a check digit value for each check digit, and obtaining updated target data may include:
[0284] Insert the second digit value check digit into the second position of the key data to obtain the intermediate key data;
[0285] Calculate the check values corresponding to each check digit, and add the check values to the second position to obtain updated key data;
[0286] Based on the updated key data, updated target data is obtained.
[0287] See also Figure 6 , Figure 6 A Hamming code encoding flow chart provided by an embodiment of this specification is shown.
[0288] At the beginning of encoding, obtain the key data to be encoded; input the data bits (n bits) of the key data; calculate the required check bits (k bits) based on the data bits, and the calculation formula can be found in the above formula (9); determine the check bit position (usually the power of 2 position); generate a codeword containing the check bit and the data bit. Optionally, in the process of generating the codeword, the check bit position is usually occupied by 0, and the remaining position is filled with data bits.
[0289] For a codeword composed of data bits and check bits, each check bit value is calculated. Optionally, each check bit value can be calculated by performing a parity check on the data bits at a specific position in the codeword. Specifically, the check bit p i The corresponding check bit value is obtained by performing a parity check on all data bits including the i-th bit in the position number.
[0290] Furthermore, the check bit is inserted into the corresponding position, and the encoded data with the Hamming code is output.
[0291] By applying this embodiment, by inserting a Hamming code with a check bit value into the key data, forward error correction of the data can be implemented through the Hamming code. During the data transmission or storage process, single-bit errors can be accurately detected and corrected, thereby improving the reliability of the data transmission process and enhancing the anti-interference ability during the data transmission process.
[0292] In an optional embodiment of the present specification, a higher level anti-interference coding technology may be used to further improve the reliability of data transmission. The higher level anti-interference coding technology may include LDPC (Low-Density Parity-Check Code) code.
[0293] Specifically, LDPC code is a linear block code that detects and corrects errors during transmission by introducing the concept of a check matrix. The check matrix of the LDPC code has a low density characteristic, that is, most of the elements in the matrix are zero, and only a few are non-zero elements.
[0294] During the encoding process, the information bit vector is multiplied by the check matrix of the LDPC code through matrix multiplication to obtain the codeword; during the decoding process, the sparse characteristics of the LDPC code are utilized through the BP algorithm, the Sum-Product Algorithm, etc., and the received noisy signal is gradually corrected through iterative operations.
[0295] In actual implementation, the excellent error correction performance of LDPC codes can further improve the anti-interference ability during data transmission and improve data reliability. In addition, the low-complexity decoding algorithm of LDPC codes can also further improve system efficiency, thereby improving the overall system performance.
[0296] Step 210: Send the target encrypted data to a data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
[0297] In actual applications, the data receiving end determines the second private key and the second public key corresponding to the data receiving end based on the same preset encryption protocol as the data sending end, sends the second public key to the data sending end and receives the first public key sent by the data sending end; and generates a shared key corresponding to the data receiving end based on the second private key and the first public key.
[0298] It should be noted that, based on the particularity of the ECC protocol, although the data sending end generates a shared key based on the first private key and the second public key, and the data receiving end generates a shared key based on the second private key and the first public key, as long as the two ends agree on the same target elliptic function curve (i.e., a, b, p are the same), initial coordinate points (i.e., G is the same) and preset value range (i.e., the password table length is the same), then the data sending end and the data receiving end can generate the same shared key. Thus, the data sending end can implement symmetric encryption of the target data to be sent based on the shared key, and the data receiving end can implement symmetric decryption of the target encrypted data based on the shared key.
[0299] In actual applications, data may be lost or damaged due to the influence of the network environment during transmission. In order to verify whether data errors occur, the data integrity of the target encrypted data can also be verified when the data receiving end receives the target encrypted data.
[0300] An embodiment of the present specification provides a data integrity verification mechanism. Before a data sending end sends data, summary information can be generated for the plaintext target data and the ciphertext target encrypted data, respectively, and the summary information can be attached to the data packet and sent to the data receiving end; the data receiving end can calculate the summary information for the received target encrypted data and the target data obtained after decryption, respectively, to achieve data integrity verification.
[0301] Furthermore, when incomplete data is detected, the anti-interference coding mechanism provided in the above embodiment can be used to correct data errors. If the plaintext data after error correction still fails to pass the integrity check, the data packet received this time can be discarded, and the data sending end can be requested to resend the target data in the data packet.
[0302] According to one or more optional embodiments of the present specification, after encrypting the target data based on the shared key and obtaining the target encrypted data, the following steps may also be included:
[0303] Determine first summary information corresponding to the target data, and generate second summary information corresponding to the target encrypted data;
[0304] Send the target encrypted data to the data receiving end, including:
[0305] The target encrypted data, the first summary information and the second summary information are sent to a data receiving end, wherein the second summary information is used to verify the data integrity of the target encrypted data, and the first summary information is used to verify the data integrity of the target data after error correction based on the check bit value.
[0306] In an optional embodiment of the present specification, determining the first summary information corresponding to the target data may include: acquiring first summary information pre-generated for the target data.
[0307] In another optional embodiment of the present specification, determining the first summary information corresponding to the target data may also include: generating the first summary information for the target data.
[0308] Specifically, the first summary information is a message digest corresponding to the target data, and the second summary information is a message digest corresponding to the target encrypted data.
[0309] Specifically, the target encrypted data can be understood as a combination of encrypted data blocks [C1, ..., CN] obtained by encryption with a shared key, wherein each encrypted data block can be encoded with a Hamming code for key data bits in the data before encryption.
[0310] Optionally, the method for generating summary information may include: generating a message digest by using a hash function.
[0311] Specifically, the hash function may include MD5, SHA series, etc. Figure 7 , taking the hash function SHA-256 as an example, the specific implementation process of the data integrity verification mechanism is further explained.
[0312] See also Figure 7 , Figure 7 A message digest processing flow chart provided by an embodiment of this specification is shown.
[0313] At the beginning, the plaintext data B carrying the Hamming code and the encrypted data block C composed of the ciphertext block [C1,...,CN] are obtained. Among them, the Hamming code is the code carried by the key data in the plaintext data.
[0314] The SHA-256 hash function is used to calculate the hash values corresponding to B and C respectively, and the first digest information Hash1 corresponding to B and the second digest information Hash2 corresponding to C are obtained.
[0315] The data sender and the data receiver can agree on the storage location of the hash value, and the storage location can be a fixed location or a dynamically changing location.
[0316] By appending Hash1 and Hash2 to the agreed positions of the data packet respectively, a data packet containing ciphertext block C, Hash1 and Hash2 can be sent.
[0317] By applying this embodiment, by determining the first summary information corresponding to the target data and generating the second summary information corresponding to the target encrypted data, the target encrypted data, the first summary information and the second summary information can be sent together to the data receiving end; the data receiving end can verify the data integrity of the ciphertext data based on the second summary information. When the verification values are inconsistent, data error correction can be performed on the decrypted plaintext data through the Hamming code, and the data consistency of the plaintext data can be verified based on the first summary information, thereby realizing the verification of data consistency and integrity, which can improve the quality of data transmission and ensure data accuracy.
[0318] See also Figure 8 , Figure 8 A flow chart of an end-to-end data processing method provided according to an embodiment of the present specification is shown. The method is applied to a data receiving end and specifically includes the following steps.
[0319] Step 802: Determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key.
[0320] Step 804: Determine the second private key and the second public key of the data receiving end according to the first protocol.
[0321] Step 806: Send the second public key to the data sending end, and receive the first public key sent by the data sending end, wherein the first public key is generated based on the first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol.
[0322] Step 808: According to the second protocol, determine the second calculation coefficient corresponding to the second private key, and generate a shared key according to the second calculation coefficient and the first public key.
[0323] Specifically, the second calculation coefficient is determined according to the second private key, and the second calculation coefficient represents the number of calculations on the first public key.
[0324] It should be noted that the specific implementation method of step 802 to step 808 is the same as the implementation method of the above-mentioned step 202 to step 208. The specific implementation method of step 802 to step 808 can be referred to step 202 to step 208, and will not be repeated in the embodiments of this specification.
[0325] Step 810: Receive target encrypted data sent by the data sender, and decrypt the target encrypted data based on the shared key to obtain target data, wherein the target encrypted data is obtained by the data sender generating a shared key based on the first private key and the second public key according to the second protocol, and encrypting the target data based on the shared key.
[0326] In actual applications, the data receiving end can receive the target encrypted data sent by the data sending end, and decrypt the target encrypted data based on the shared key to obtain the target data.
[0327] By applying this embodiment, by determining the second private key and the second public key of the data receiving end, the first public key of the data sending end can be exchanged based on the second public key, thereby generating a shared key between the two ends based on the second private key and the first public key. Since the public key is exchanged, even if the public key is obtained by an attacker, the attacker cannot crack the shared key based on the public key, thereby ensuring the security of the target encrypted data during the data transmission process; by decrypting the target encrypted data through the shared key, the encrypted data can be decrypted to obtain the plaintext data, thereby obtaining the target data while ensuring the security of the privacy data.
[0328] In an optional embodiment of the present specification, the target encrypted data may include an encrypted data block [C1, ..., CN] and an initial vector; decrypting the target encrypted data based on the shared key to obtain the target data may include:
[0329] Determine the symmetric key corresponding to the initial vector and the shared key;
[0330] According to the initial vector and the symmetric key, the target encrypted data is decrypted to obtain the target data.
[0331] Optionally, the initial vector may be obtained from a data packet corresponding to the target encrypted data.
[0332] Further, decrypting the target encrypted data according to the initial vector and the symmetric key to obtain the target data may include:
[0333] Obtain N encrypted data blocks, where N ≥ 1 and is a positive integer;
[0334] Decrypt the first encrypted data block using the symmetric key to obtain the first decrypted data block, and perform XOR processing on the first decrypted data block based on the initial vector to obtain the first plaintext data block;
[0335] The jth encrypted data block is decrypted by the symmetric key to obtain the jth decrypted data block, and the jth decrypted data block is XOR-ed based on the j-1th plaintext data block to obtain the jth plaintext data block, where 1≤j≤N and j is a positive integer.
[0336] The following combination Fig. 9 , further explains the process of shared key decryption. Fig. 9 A shared key decryption flow chart provided by an embodiment of this specification is shown.
[0337] At the beginning, the package data of the ciphertext block and the initial vector IV is obtained, and the ciphertext block [C1, ..., CN] and IV are extracted, where there are N ciphertext blocks in total, and N is a positive integer greater than or equal to 1.
[0338] Determine the shared key S (x, y) of the data receiving end; generate the symmetric key K (256 bits) corresponding to the shared key S (x, y) based on SHA-256 (S); call the AES-256-CBC decryption algorithm, decrypt the ciphertext block C1 with the symmetric key K to obtain the decrypted data, and perform an XOR operation (XOR, symbol ⊕) on the decrypted data and the initial vector IV to obtain the plaintext block B1.
[0339] Call the AES-256-CBC decryption algorithm, decrypt the ciphertext block C2 with the symmetric key K, obtain the decrypted data, perform an XOR operation (XOR, symbol ⊕) on the decrypted data and the plaintext block B1, and obtain the plaintext block B2. And so on, until the decrypted data corresponding to the ciphertext block CN is XORed with the plaintext block CN-1 to obtain the plaintext block BN.
[0340] Assemble the plaintext blocks [B1,…,BN] to get the original data.
[0341] Optionally, the specific method of AES decryption can be implemented by calling the underlying function of the openssl library.
[0342] In another optional embodiment of the present specification, the target encrypted data may include an encrypted data block [C1, ..., CN], an initial vector, first summary information, and second summary information; before decrypting the target encrypted data based on the shared key, the following may also be included:
[0343] Calculate the third summary information corresponding to the entire encrypted data block;
[0344] determining whether the third summary information is the same as the second summary information;
[0345] If they are the same, decrypt the target encrypted data based on the shared key to obtain the target data;
[0346] If they are different, the target encrypted data is decrypted based on the shared key to obtain the plaintext data, and data error correction is performed based on the check bit value in the plaintext data.
[0347] Furthermore, after performing data error correction according to the check bit value in the plaintext data, the following may also be included:
[0348] Calculating fourth summary information corresponding to the error-corrected plaintext data;
[0349] determining whether the fourth summary information is the same as the first summary information;
[0350] If yes, the corrected plaintext data is determined as the target data;
[0351] If not, discard the data.
[0352] Optionally, in the case of discarding the current data, a data acquisition request for the target data may also be sent to the data sending end.
[0353] The following combination Fig.10 , further explains the data integrity verification process and the data recovery process. Fig.10 A data integrity check and data recovery flow chart provided by an embodiment of this specification is shown.
[0354] At the beginning, the data receiving end receives the data packet sent by the data sending end through the communication link. The ciphertext block C, Hash1 and Hash2 are extracted from the data packet. Among them, Hash1 is the hash value generated by hashing the plaintext data after the Hamming code is inserted and the corresponding Hamming code. Hash2 is the hash value generated by hashing the encrypted ciphertext data block as a whole.
[0355] The data receiving end recalculates the hash value of the ciphertext data block in the received data packet as a whole, obtains Hash3, and determines whether Hash3 is the same as Hash2.
[0356] If they are the same, it means that the data is complete and subsequent data processing can continue.
[0357] If they are different, it means that the data is incomplete and the data may be abnormal, distorted or tampered with.
[0358] In the case of incomplete data, the AES-256-CBC algorithm is called to decrypt the ciphertext block C and obtain the decrypted data. The Hamming code error correction logic is called to correct the decrypted data and recalculate the hash value Hash4 for the corrected data. Determine whether Hash4 is the same as Hash1.
[0359] If they are the same, it means that the data recovery is successful and you can continue with subsequent data processing.
[0360] If they are different, it means that the data cannot be successfully recovered, the data can be discarded, and the data sender is notified to resend the data.
[0361] See also Fig.11 , Fig.11 A Hamming code error correction flow chart provided by an embodiment of this specification is shown.
[0362] At the beginning, the data with Hamming code is obtained, and the check digit in the data is recalculated. The recalculated check digit is compared with the received check digit to see if the check digit value is the same.
[0363] If there is no difference, it means that the data is error-free and the correct data bits can be output to obtain the original data.
[0364] If there is a discrepancy, it means that the data has been lost or damaged during transmission, and error correction is required using Hamming code.
[0365] If there is a difference, the error position is determined by checking the difference between the bits, and the error bit is flipped to correct the single-bit error. When the error correction is completed, the correct data bit is output.
[0366] It should be noted that the error-corrected data can be further verified by calculating the hash value to determine whether the data is the same as the original data, thereby ensuring data consistency.
[0367] The following combination Figure 12-13 , taking the application of the end-to-end data processing method provided in this specification in the end-to-end communication based on the BMC control end as an example, the data processing method is further described. Fig.12 An architecture diagram of a BMC-client communication encryption and decryption system provided by an embodiment of the present specification is shown. Fig.13 A flow chart of a data encryption and data decryption process provided by an embodiment of the present specification is shown.
[0368] See also Fig.12The communication encryption and decryption system includes a BMC control terminal and a client. The BMC control terminal and the client transmit data through a pre-built communication link. The BMC control terminal can be used as a data transmitter to send data to the client, or as a data receiver to receive data sent by the client.
[0369] Before establishing a communication connection between the BMC control end and the client, the parameter information, initial coordinate points and preset value range of the target elliptic function curve can be agreed upon based on the ECC protocol, so as to generate the same shared key S on each end through public key exchange.
[0370] When the BMC control end acts as the data transmitter and sends data to the client, the BMC control end determines the key data in the data, encodes the key data through Hamming code, and adds error correction insurance. Based on the shared key S, the data containing the Hamming code is encrypted using a symmetric encryption algorithm to generate encrypted ciphertext. The BMC control end generates information digests for the original data and ciphertext data respectively, and attaches the information digest to the end of the ciphertext data, and sends the data packet carrying the ciphertext data and the information digest to the client.
[0371] The client receives the data packet, extracts the encrypted ciphertext and summary information from it, recalculates the hash value corresponding to the encrypted ciphertext, and performs data integrity verification based on the hash value corresponding to the encrypted ciphertext in the data packet. If the verification passes, the original data can be directly obtained after decryption based on the shared key S. If the verification fails, the data is decrypted based on the shared key S, and the data is corrected by Hamming code, and the hash value is recalculated for the corrected data. The data consistency verification is performed based on the hash value corresponding to the plaintext data in the data packet. If the verification passes, the corrected data is determined as the original data; if the verification fails, the data received this time is discarded. If the data is discarded, the client can send a request to the BMC control end to retrieve the data packet this time.
[0372] When the client, as the data transmitter, sends data to the BMC control end, the client determines the key data in the data, encodes the key data through Hamming code, and adds error correction insurance. Based on the shared key S, the data containing the Hamming code is encrypted by a symmetric encryption algorithm to generate encrypted ciphertext. The client generates information digests for the original data and ciphertext data respectively, and attaches the information digest to the end of the ciphertext data, and sends the data packet carrying the ciphertext data and information digest to the BMC control end.
[0373] The BMC control end receives the data packet, extracts the encrypted ciphertext and summary information from it, recalculates the hash value corresponding to the encrypted ciphertext, and performs data integrity verification based on the hash value corresponding to the encrypted ciphertext in the data packet. If the verification passes, the original data can be directly obtained after decryption based on the shared key S. If the verification fails, the data is decrypted based on the shared key S, and the data is corrected by Hamming code, and the hash value is recalculated for the corrected data. The data consistency verification is performed based on the hash value corresponding to the plaintext data in the data packet. If the verification passes, the corrected data is determined as the original data; if the verification fails, the data received this time is discarded. If the data is discarded, the BMC control end can send a re-acquisition request for this data packet to the client.
[0374] See also Fig.13 , the data encryption process is applied to the data sending end A, specifically including:
[0375] The data transmitter A obtains the original data M, determines the important data in the original data M, and adds a Hamming code (E) to the important data to obtain the encoded data (M, E).
[0376] At the same time, the data sending end A can generate a temporary key pair (private key k_a, public key K_A) based on the ECC protocol agreed with the data receiving end B. The shared key S is calculated based on the private key k_a and the public key K_B sent by the data receiving end.
[0377] It should be noted that the specific method for generating the temporary key pair can refer to the specific implementation of step 202 above.
[0378] The data sender A generates the corresponding symmetric encryption key K based on the shared key S, and encrypts the encoded data (M, E) based on the symmetric encryption key K to obtain the ciphertext C.
[0379] It should be noted that the specific implementation of symmetric encryption can refer to the specific implementation of step 206 above.
[0380] For the original data M and the ciphertext C, the summary information H1 corresponding to the original data M and the summary information H2 corresponding to the ciphertext C can be generated respectively.
[0381] The data sending end A can send the temporary public key K_A and the ciphertext C, H1, and H2 to the data receiving end B through the communication link between the data sending end A and the data receiving end B.
[0382] The data decryption process is applied to the data receiving end B, and specifically includes:
[0383] The data receiving end B receives the ciphertext C, H1, H2 and temporary public key K_A and performs integrity verification through the hash function.
[0384] Specifically, the data receiving end B recalculates the summary information H3 corresponding to the ciphertext C, and verifies whether H3 is the same as H2.
[0385] The data receiving end B calculates the shared key S based on the temporary private key K_b of the data receiving end B and the temporary public key K_A of the data sending end. The symmetric decryption key K is generated based on the shared key S. The ciphertext C is decrypted based on the symmetric decryption key K to obtain the encoded data (M, E) encoded based on the Hamming code.
[0386] When H3 and H2 are the same, the data bits in the encoded data (M, E) can be directly output to obtain the original data M.
[0387] When H3 and H2 are different, the Hamming code error correction logic is called to determine the error position in the encoded data, flip the data bit at that position, correct the single-bit error, and obtain the restored plaintext data.
[0388] Calculate the summary information H4 of the restored plaintext data and determine whether H4 is the same as H1. If they are the same, the data recovery is successful, and the restored plaintext data is the original data M. If they are different, the data recovery fails, the data transmitted this time is discarded, and a request for re-acquisition of the data is sent to the data sender.
[0389] By applying this embodiment, through the ECC protocol, the data sending end and the data receiving end determine the same key generation rule, so that the data sending end and the data receiving end can generate a temporary key pair at their respective ends, and generate the same shared key based on the exchanged public key. Based on the particularity of ECC, the key length is shorter, but the security is higher, so the key generation efficiency can be improved and the privacy data security can be guaranteed. By inserting a Hamming code with a check bit value into the key data, forward error correction of the data can be achieved through the Hamming code. During the data transmission or storage process, single-bit errors can be accurately detected and corrected, thereby improving the reliability of the data transmission process and enhancing the anti-interference ability during the data transmission process.
[0390] In addition, by generating summary information for the original data and ciphertext data respectively, and sending the ciphertext data and the two summary information to the data receiving end, the data integrity check during the data transmission process can be realized. The data receiving end can verify the integrity of the ciphertext data. In the case of incompleteness, the Hamming code error correction logic is called to correct the key data, and the summary information can be regenerated and verified for the plaintext data after error correction, so as to verify whether the corrected data is correctly restored. Through two hash value checks, data accuracy can be guaranteed and data transmission reliability can be improved.
[0391] Corresponding to the above method embodiment, this specification also provides an end-to-end data processing device embodiment, Fig.14 FIG. 1 shows a schematic diagram of the structure of an end-to-end data processing device provided by an embodiment of the present specification, wherein the device is configured at the data sending end. Fig.14 As shown, the device comprises:
[0392] The first acquisition module 1402 is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key.
[0393] The first determination module 1404 is configured to determine a first private key and a first public key of the data sending end according to the first protocol.
[0394] The first receiving module 1406 is configured to send the first public key to the data receiving end, and receive the second public key sent by the data receiving end, wherein the second public key is generated based on the second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol.
[0395] The encryption module 1408 is configured to determine the first calculation coefficient corresponding to the first private key according to the second protocol, generate a shared key according to the first calculation coefficient and the second public key, and encrypt the target data based on the shared key to obtain the target encrypted data.
[0396] The sending module 1410 is configured to send the target encrypted data to a data receiving end, wherein the data receiving end is used to generate a shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
[0397] Optionally, the first determining module 1404 is further configured to:
[0398] Obtain parameter information, initial coordinate points and preset value range of the target elliptic function curve;
[0399] Determine a target integer within a preset value range as a first private key, wherein the target integer is any integer within the preset value range;
[0400] According to the parameter information and the initial coordinate point, a first coordinate point corresponding to the target integer on the target elliptic function curve is generated, and the first coordinate point is determined as the first public key.
[0401] Optionally, the encryption module 1408 is further configured to:
[0402] Determine the symmetric key corresponding to the initial vector and the shared key;
[0403] The target data is encrypted according to the initial vector and the symmetric key to obtain the target encrypted data.
[0404] Optionally, the encryption module 1408 is further configured to:
[0405] Split the target data into N data blocks, where N ≥ 1 and is a positive integer;
[0406] Based on the initial vector, perform XOR processing on the first data block, and encrypt the XOR processing result using the symmetric key to obtain the first encrypted data block;
[0407] Based on the i-th encrypted data block, perform XOR processing on the i+1-th data block, and encrypt the XOR processing result with the symmetric key to obtain the i+1-th encrypted data block, where 1≤i≤N-1 is a positive integer;
[0408] According to the 1st to Nth encrypted data blocks, target encrypted data is obtained.
[0409] Optionally, the data processing device further includes an update module configured to:
[0410] Determine the current communication index between the data sending end and the data receiving end;
[0411] When the current communication indicator is lower than a preset update threshold, a key update instruction is generated, wherein the key update instruction is used to instruct the data sending end and the data receiving end to perform key update.
[0412] Optionally, the update module is further configured to:
[0413] Obtain the accumulated usage time of the current shared key, the average communication flow rate between the data sender and the data receiver per unit time, and the number of communication anomalies within the accumulated usage time;
[0414] The current communication indicators are obtained based on the cumulative usage time, average communication traffic and number of communication anomalies.
[0415] Optionally, the data processing device further includes a verification module configured to:
[0416] Identify key data in the target data;
[0417] Determining at least one check bit of the key data based on the data bits of the key data;
[0418] At least one check digit is inserted into the key data, and a check digit value of each check digit is generated to obtain updated target data.
[0419] Optionally, the sending module 1410 is further configured to:
[0420] Determine first summary information corresponding to the target data, and generate second summary information corresponding to the target encrypted data;
[0421] The target encrypted data, the first summary information and the second summary information are sent to a data receiving end, wherein the second summary information is used to verify the data integrity of the target encrypted data, and the first summary information is used to verify the data integrity of the target data after error correction based on the check bit value.
[0422] By applying this embodiment, by determining the first private key and the first public key of the data sending end according to the first protocol, the second public key of the data receiving end can be exchanged based on the first public key, so that the data sending end can generate a shared key based on the first private key and the second public key according to the second protocol, and the data receiving end can generate the same shared key based on the second private key and the first public key according to the second protocol, thereby realizing end-to-end data encryption transmission; and, because the public key is exchanged, even if the attacker intercepts the public key from the key exchange process, the shared key cannot be cracked based on the public key, which can effectively ensure the security of the key and thus improve the security of the encrypted data; encrypting the target data by the shared key can improve the security of the end-to-end data transmission process and ensure the security of privacy data.
[0423] The above is a schematic scheme of a data processing device configured at a data sending end of this embodiment. It should be noted that the technical scheme of the data processing device configured at the data sending end and the technical scheme of the data processing method applied to the data sending end belong to the same concept, and the details not described in detail in the technical scheme of the data processing device configured at the data sending end can all be referred to the description of the technical scheme of the data processing method applied to the data sending end.
[0424] Corresponding to the above method embodiment, this specification also provides an end-to-end data processing device embodiment, Fig.15 FIG. 1 shows a schematic diagram of the structure of an end-to-end data processing device provided by an embodiment of the present specification, wherein the device is configured at a data receiving end. Fig.15 As shown, the device comprises:
[0425] The second acquisition module 1502 is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key.
[0426] The second determination module 1504 is configured to determine the second private key and the second public key of the data receiving end according to the first protocol.
[0427] The second receiving module 1506 is configured to send the second public key to the data sending end, and receive the first public key sent by the data sending end, wherein the first public key is generated based on the first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol.
[0428] The generating module 1508 is configured to determine the second calculation coefficient corresponding to the second private key according to the second protocol, and generate a shared key according to the second calculation coefficient and the first public key.
[0429] Decryption module 1510: is configured to receive target encrypted data sent by a data sender, and decrypt the target encrypted data based on a shared key to obtain target data, wherein the target encrypted data is obtained by the data sender generating a shared key based on a first private key and a second public key according to a second protocol, and encrypting the target data based on the shared key.
[0430] By applying this embodiment, by determining the second private key and the second public key of the data receiving end, the first public key of the data sending end can be exchanged based on the second public key, thereby generating a shared key between the two ends based on the second private key and the first public key. Since the public key is exchanged, even if the public key is obtained by an attacker, the attacker cannot crack the shared key based on the public key, thereby ensuring the security of the target encrypted data during the data transmission process; by decrypting the target encrypted data through the shared key, the encrypted data can be decrypted to obtain the plaintext data, thereby obtaining the target data while ensuring the security of the privacy data.
[0431] The above is a schematic scheme of a data processing device configured at a data receiving end of this embodiment. It should be noted that the technical scheme of the data processing device configured at the data receiving end and the technical scheme of the data processing method applied to the data receiving end belong to the same concept, and the details not described in detail in the technical scheme of the data processing device configured at the data receiving end can all be referred to the description of the technical scheme of the data processing method applied to the data receiving end.
[0432] Fig.16 The block diagram of a computing device 1600 according to one embodiment of the present specification is shown. The components of the computing device 1600 include but are not limited to a memory 1610 and a processor 1620. The processor 1620 is connected to the memory 1610 via a bus 1630, and the database 1650 is used to store data.
[0433] The computing device 1600 also includes an access device 1640 that enables the computing device 1600 to communicate via one or more networks 1660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0434] In one embodiment of the present specification, the above components of the computing device 1600 and Fig.16 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.16 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0435] The computing device 1600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1600 may also be a mobile or stationary server.
[0436] The processor 1620 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned end-to-end data processing method.
[0437] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned end-to-end data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned end-to-end data processing method.
[0438] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned end-to-end data processing method.
[0439] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned end-to-end data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned end-to-end data processing method.
[0440] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned end-to-end data processing method when executed by a processor.
[0441] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned end-to-end data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned end-to-end data processing method.
[0442] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0443] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0444] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0445] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0446] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An end-to-end data processing method, characterized in that: Applied to the data sending end, including: Determining a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; Determine a first private key and a first public key of the data sending end according to the first protocol; Sending the first public key to a data receiving end, and receiving a second public key sent by the data receiving end, wherein the second public key is generated based on a second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol; Determine, according to the second protocol, a first calculation coefficient corresponding to the first private key, and generate a shared key according to the first calculation coefficient and the second public key, wherein the first calculation coefficient represents the number of calculations of the second public key; Determine an initial vector and a symmetric key corresponding to the shared key, and encrypt the target data according to the initial vector and the symmetric key to obtain target encrypted data; The target encrypted data is sent to the data receiving end, wherein the data receiving end is used to generate the shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
2. The method according to claim 1, characterized in that The determining, according to the first protocol, a first private key and a first public key of the data sending end includes: Obtain parameter information, initial coordinate points and preset value range of the target elliptic function curve; Determine a target integer within the preset value range as the first private key, wherein the target integer is any integer within the preset value range; A first coordinate point corresponding to the target integer on the target elliptic function curve is generated according to the parameter information and the initial coordinate point, and the first coordinate point is determined as the first public key.
3. The method according to claim 1, characterized in that The step of encrypting the target data according to the initial vector and the symmetric key to obtain the target encrypted data includes: Splitting the target data to obtain N data blocks, where N ≥ 1 and is a positive integer; Based on the initial vector, performing XOR processing on the first data block, and encrypting the XOR processing result by using the symmetric key to obtain the first encrypted data block; Based on the i-th encrypted data block, perform XOR processing on the i+1-th data block, and encrypt the XOR processing result by the symmetric key to obtain the i+1-th encrypted data block, where 1≤i≤N-1 is a positive integer; According to the 1st to Nth encrypted data blocks, target encrypted data is obtained.
4. The method according to claim 1, characterized in that: Before determining the first private key and the first public key of the data sending end, the method further includes: Determining a current communication indicator between the data sending end and the data receiving end; In a case where the current communication indicator is lower than a preset update threshold, a key update instruction is generated, wherein the key update instruction is used to instruct the data sending end and the data receiving end to perform a key update.
5. The method according to claim 4, characterized in that The determining of the current communication index between the data sending end and the data receiving end includes: Obtaining the accumulated usage time of the current shared key, the average communication flow rate between the data sending end and the data receiving end per unit time, and the number of communication anomalies within the accumulated usage time; The current communication index is obtained according to the accumulated usage time, the average communication flow and the number of communication anomalies.
6. The method according to any one of claims 1 to 5, characterized in that: Before encrypting the target data based on the shared key to obtain the target encrypted data, the method further includes: determining key data in the target data; Determining at least one check bit of the key data according to the data bits of the key data; The at least one check bit is inserted into the key data, and a check bit value of each check bit is generated to obtain updated target data.
7. The method according to claim 6, characterized in that After encrypting the target data based on the shared key to obtain the target encrypted data, the method further includes: Determine first summary information corresponding to the target data, and generate second summary information corresponding to the target encrypted data; The step of sending the target encrypted data to the data receiving end comprises: The target encrypted data, the first summary information and the second summary information are sent to the data receiving end, wherein the second summary information is used to verify the data integrity of the target encrypted data, and the first summary information is used to verify the data integrity of the target data after error correction based on the check bit value.
8. An end-to-end data processing method, characterized in that: Applied to the data receiving end, including: Determining a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; Determining a second private key and a second public key of the data receiving end according to the first protocol; Sending the second public key to a data sending end, and receiving a first public key sent by the data sending end, wherein the first public key is generated based on a first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol; Determine, according to the second protocol, a second calculation coefficient corresponding to the second private key, and generate a shared key according to the second calculation coefficient and the first public key, wherein the second calculation coefficient represents the number of calculations of the first public key; Receive target encrypted data sent by the data sending end, determine an initial vector and a symmetric key corresponding to the shared key, decrypt the target encrypted data according to the initial vector and the symmetric key, and obtain target data, wherein the target encrypted data is obtained by the data sending end generating the shared key based on the first private key and the second public key according to the second protocol, and encrypting the target data based on the shared key.
9. An end-to-end data processing device, characterized in that: Configured at the data sending end, including: A first acquisition module is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; A first determining module is configured to determine a first private key and a first public key of the data sending end according to the first protocol; a first receiving module, configured to send the first public key to a data receiving end, and receive a second public key sent by the data receiving end, wherein the second public key is generated based on a second private key of the data receiving end, and the second public key and the second private key are determined according to the first protocol; an encryption module, configured to determine, according to the second protocol, a first calculation coefficient corresponding to the first private key, generate a shared key according to the first calculation coefficient and the second public key, wherein the first calculation coefficient represents the number of calculations of the second public key; determine an initial vector and a symmetric key corresponding to the shared key, and encrypt target data according to the initial vector and the symmetric key to obtain target encrypted data; The sending module is configured to send the target encrypted data to the data receiving end, wherein the data receiving end is used to generate the shared key based on the second private key and the first public key according to the second protocol, decrypt the target encrypted data based on the shared key, and obtain the target data.
10. An end-to-end data processing device, characterized in that: Configured at the data receiving end, including: A second acquisition module is configured to determine a preset key generation protocol, wherein the preset key generation protocol includes a first protocol for generating a private key and a public key and a second protocol for generating a shared key; A second determining module is configured to determine a second private key and a second public key of the data receiving end according to the first protocol; a second receiving module, configured to send the second public key to a data sending end, and receive a first public key sent by the data sending end, wherein the first public key is generated based on a first private key of the data sending end, and the first public key and the first private key are determined according to the first protocol; a generating module, configured to determine, according to the second protocol, a second calculation coefficient corresponding to the second private key, and generate a shared key according to the second calculation coefficient and the first public key, wherein the second calculation coefficient represents the number of calculations of the first public key; The decryption module is configured to receive the target encrypted data sent by the data sending end, determine the initial vector and the symmetric key corresponding to the shared key, and decrypt the target encrypted data according to the initial vector and the symmetric key to obtain target data, wherein the target encrypted data is obtained by the data sending end generating the shared key based on the first private key and the second public key according to the second protocol, and encrypting the target data based on the shared key.
11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the end-to-end data processing method according to any one of claims 1 to 8 are implemented.
12. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the end-to-end data processing method described in any one of claims 1 to 8.
13. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the end-to-end data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Computer-implemented systems and methods for performing computational tasks across a group operating in a trust-less or dealer-free manner
CN111566988A
Key encapsulation protocols
CN112715016A