Oblivious transmission method based on SM2 and SM4 cryptographic algorithms
By introducing test and transmission cycles into inadvertent transmission methods and dynamically adjusting the processing methods, the problem of the inability to allocate appropriate data processing methods according to the data processing volume in the prior art is solved, and the processing efficiency and privacy of the system are improved.
Patent Information
- Application Number
- CN202411886077.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The prior art cannot allocate appropriate data processing methods based on the data processing volume, resulting in the system's operating performance and processing efficiency being unable to be guaranteed.
By generating a test cycle and a continuous transmission cycle, the processing test method and the inadvertent transmission method are executed within the test cycle, the processing allocation method and the inadvertent transmission method are executed within the transmission cycle, and the processing method is dynamically adjusted to adapt to the data processing volume.
The dynamic allocation of processing methods is realized based on the data processing volume, which improves the processing efficiency and operational performance of the information sender when performing inadvertent transmission tasks, taking into account privacy and system performance.
Smart Images

Figure CN119341728B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of oblivious transmission and relates to data processing technology, in particular to an oblivious transmission method based on SM2 and SM4 cryptographic algorithms. Background Art
[0002] With the continuous development of technologies such as big data, cloud computing, and artificial intelligence, data security and privacy protection issues have become increasingly prominent; as an effective privacy protection technology, the Oblivious Transfer Protocol will play an increasingly important role in the future information society; at the same time, with the continuous advancement of technology and the continuous expansion of application scenarios, the Oblivious Transfer Protocol will also continue to improve and develop, providing a more comprehensive and effective solution for data security and privacy protection.
[0003] The invention patent with announcement number CN115292378A discloses a hidden query system and method based on a trusted execution environment and oblivious transfer. The hidden query system combines the trusted execution environment and the oblivious transfer protocol to realize an anonymous query system under privacy protection conditions, while protecting the privacy of the querying user, ensuring the auditability of the query operation; however, the oblivious transfer protocol involves complex encryption and verification processes with high computational complexity, which may affect the performance and efficiency of the system. Therefore, the traditional oblivious transfer method uses a single data processing method and cannot allocate a suitable data processing method according to the data processing volume, resulting in the system's operating performance and processing efficiency cannot be guaranteed.
[0004] In view of the above technical problems, this application proposes a solution. Summary of the invention
[0005] The purpose of the present invention is to provide an oblivious transmission method based on SM2 and SM4 cryptographic algorithms, which is used to solve the problem that the prior art cannot allocate a suitable data processing method according to the data processing amount;
[0006] The technical problem to be solved by the present invention is: how to provide an oblivious transmission method based on SM2 and SM4 cryptographic algorithms that can allocate appropriate data processing methods according to the data processing volume.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] Based on the oblivious transmission method of SM2 and SM4 cryptographic algorithms, a test cycle and a continuous transmission cycle are generated, a processing test method and an oblivious transmission method are executed in the test cycle, and a processing allocation method and an oblivious transmission method are executed in the transmission cycle;
[0009] The specific process of processing the test method includes the following steps:
[0010] Step K1: When the oblivious transmission is performed during the test period, the information sender is marked as a test object, and a number of oblivious transmission tasks are assigned to the test object during the test period;
[0011] Step K2: obtaining the number of memory bytes of the batch message sent by the test object when performing the oblivious transmission task and marking it as the sending value, randomly assigning a processing mode to the test object and marking it as the allocation mode, and the processing modes include parallel processing and serial processing;
[0012] Step K3: Execute the oblivious transfer method in a distribution manner;
[0013] Step K4: Obtaining efficiency data XL, calculation data JS and communication data TX of the test object when performing the inadvertent transmission task;
[0014] Step K5: by numerically calculating the efficiency data XL, the calculation data JS and the communication data TX, the processing coefficient CL when the test object performs the oblivious transmission task is obtained; the processing coefficient CL, the allocation method and the transmission value constitute a test data set of the oblivious transmission task;
[0015] Step K6: Loop through Step K2-Step K5 until all oblivious transmission tasks are processed, then retrieve the test data sets of all oblivious transmission tasks, divide the transmission range into several transmission intervals using the maximum and minimum transmission values as the transmission range, and mark the priority of the transmission intervals.
[0016] Further, in step K4, the efficiency data XL is the ratio of the sending value to the duration of the test object performing the oblivious transmission processing. The process of obtaining the calculation data JS includes: obtaining the resource occupancy value ZY of the test object during the oblivious transmission processing in real time through the formula ZY=(currently used CPU / memory / disk and other resources) / (total CPU / memory / disk and other resources)×100%, and marking the maximum value of the resource occupancy value ZY during the oblivious transmission processing as the calculation data JS; the process of obtaining the communication data TX includes: the maximum value of the network channel utilization of the test object during the oblivious transmission process.
[0017] Further, in step K6, the specific process of marking the priority mode of the sending interval includes: marking the test data set whose sending value is in the sending interval as the matching data set of the sending interval, calculating the average value of the processing coefficient CL of all matching data sets whose allocation mode is parallel processing and marking it as the parallel priority value of the sending interval, calculating the average value of the processing coefficient CL of all matching data sets whose allocation mode is serial processing and marking it as the serial priority value of the sending interval, comparing the parallel priority value with the serial priority value and marking the priority mode of the sending interval according to the comparison result.
[0018] Furthermore, the specific process of comparing the parallel priority value with the serial priority value includes: if the parallel priority value is less than the serial priority value, serial processing is marked as the priority mode for sending the interval; if the parallel priority value is greater than or equal to the serial priority value, parallel processing is marked as the priority mode for sending the interval.
[0019] Furthermore, the specific process of the oblivious transmission method includes the following steps:
[0020] Step P1: mark the number of messages to be sent by the information sender as n;
[0021] Step P2: The information sender generates n pairs of temporary SM2 public keys and sends the public keys to the information receiver;
[0022] Step P3: The information receiver chooses to view the kth message;
[0023] Step P4: The information receiver generates an sm4 encryption key sm4key, encrypts sm4key using the kth public key, and sends the encrypted sm4key to the information sender;
[0024] Step P5: The information sender encrypts the message twice;
[0025] Step P6: The information receiver uses the initially generated sm4key to decrypt the kth message to obtain the plaintext message.
[0026] Furthermore, in step P5, the specific process of the information sender performing secondary encryption on the message includes: the information sender uses n private keys to solve the encrypted sm4key respectively, encrypts the jth message with the decrypted jth k respectively, and sends the encrypted n messages to the information receiver.
[0027] Furthermore, the specific process of processing the allocation method includes:
[0028] Step S1: When an oblivious transmission is performed during a transmission period, the message sender is marked as an execution object;
[0029] Step S2: Obtain the number of memory bytes of the batch message sent by the execution object when executing the oblivious transfer task and mark it as the execution value. If the execution value is within the sending range, execute step S3; if the execution value is outside the sending range, execute step S4;
[0030] Step S3: Retrieve the priority mode of the sending interval corresponding to the execution value, and execute the oblivious transmission method in the priority mode;
[0031] Step S4: Execute steps K2 to K5, and update the sending range, sending interval and priority mode according to the test data set generated in step K5.
[0032] The present invention has the following beneficial effects:
[0033] The processing test method can be used to collect statistics on the test data set when the test object performs the oblivious transmission task. The transmission value in the test data set can reflect the data processing volume of the oblivious transmission task. The processing coefficient can reflect the degree of computing resources and communication resources occupied by the test object when performing the oblivious transmission task. Then, a suitable priority method is allocated to each transmission interval, so that the information sender can take into account privacy, processing efficiency and operation performance when performing the oblivious transmission task.
[0034] Through the oblivious transmission scheme based on the SM2 cryptographic algorithm, the security of the SM2 public key cryptographic algorithm is used to enable the sender to send part of the information in the message set to the receiver, and the sender cannot know which message the receiver has selected. This scheme protects the privacy of the receiver's choice through the encryption and decryption process of the SM2 algorithm, while ensuring the security of data transmission;
[0035] The processing allocation method can provide the message sender with the most optimized data processing method, so that the message sender can directly use the priority method to process the inadvertently transmitted data. At the same time, the coverage of the test data set can be monitored and counted. When the execution value does not fall within the sending range, random allocation is used for inadvertent transmission processing. At the same time, the original sending range, sending interval and priority method are updated according to the processing results, and the applicability of the sending interval and priority method is dynamically improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A schematic diagram of a process for processing a test method of the present invention;
[0038] Figure 2 is a flow chart of the inadvertent transmission method of the present invention;
[0039] Figure 3 The figure is a flow chart of the processing allocation method of the present invention. DETAILED DESCRIPTION
[0040] The technical scheme of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Oblivious transfer is an important cryptographic protocol that allows a sender to send a batch of messages to a receiver, and the receiver chooses one of them to receive, while the sender has no idea which message the receiver chooses. This technology is widely used in secure multi-party computing, bit commitment, zero-knowledge proof, and electronic payment. It aims to protect the privacy of both communicating parties and ensure the privacy and correctness of data transmission. The oblivious transfer protocol is a basic component in cryptography. It has a profound technical background and is built on the basis of public key cryptography, providing strong support for the development and application of modern cryptography.
[0042] The oblivious transmission method based on SM2 and SM4 cryptographic algorithms generates a test cycle and a continuous transmission cycle, executes a processing test method and an oblivious transmission method in the test cycle, and executes a processing allocation method and an oblivious transmission method in the transmission cycle.
[0043] like Figure 1 As shown, the specific process of processing the test method includes the following steps:
[0044] Step K1: When the oblivious transmission is performed during the test period, the information sender is marked as a test object, and a number of oblivious transmission tasks are assigned to the test object during the test period;
[0045] Step K2: obtaining the number of memory bytes of the batch message sent by the test object when performing the oblivious transmission task and marking it as the sending value, randomly assigning a processing mode to the test object and marking it as the allocation mode, and the processing modes include parallel processing and serial processing;
[0046] Step K3: Execute the oblivious transfer method in a distribution manner;
[0047] Step K4: obtaining the efficiency data XL, calculation data JS and communication data TX of the test object when performing the oblivious transmission task, the efficiency data XL is the ratio of the transmission value to the duration of the oblivious transmission processing of the test object, the process of obtaining the calculation data JS includes: obtaining the resource occupancy value ZY of the test object in the oblivious transmission processing process in real time through the formula ZY=(currently used CPU / memory / disk and other resources) / (total CPU / memory / disk and other resources)×100%, marking the maximum value of the resource occupancy value ZY in the oblivious transmission processing process as the calculation data JS; the process of obtaining the communication data TX includes: the maximum value of the network channel utilization rate of the test object in the oblivious transmission process;
[0048] Step K5: Obtain the processing coefficient CL when the test object performs the oblivious transmission task by the formula CL=w1×XL-w2×JS-w3×TX, where w1, w2 and w3 are all proportional coefficients, and w1>w2>w3>1; the processing coefficient CL, the allocation method and the sending value constitute the test data set of the oblivious transmission task;
[0049] Step K6: loop through steps K2 to K5 until all oblivious transmission tasks are processed, then retrieve the test data sets of all oblivious transmission tasks, form a transmission range by the maximum and minimum transmission values, divide the transmission range into a number of transmission intervals, mark the test data sets whose transmission values are in the transmission interval as matching data sets of the transmission interval, calculate the average value of the processing coefficients CL of all matching data sets whose allocation mode is parallel processing and mark them as the parallel priority value of the transmission interval, calculate the average value of the processing coefficients CL of all matching data sets whose allocation mode is serial processing and mark them as the serial priority value of the transmission interval, compare the parallel priority value with the serial priority value: if the parallel priority value is less than the serial priority value, mark the serial processing as the priority mode of the transmission interval; if the parallel priority value is greater than or equal to the serial priority value, mark the parallel processing as the priority mode of the transmission interval;
[0050] The test data set of the test object when performing the oblivious transmission task is statistically analyzed. The sending value in the test data set can reflect the data processing volume of the oblivious transmission task, and the processing coefficient can reflect the degree of computing resource and communication resource occupancy of the test object when performing the oblivious transmission task. Then, a suitable priority method is allocated to each sending interval, so that the information sender can take into account privacy, processing efficiency and operating performance when performing the oblivious transmission task.
[0051] like Figure 2 As shown, the specific process of the oblivious transmission method includes the following steps:
[0052] Step P1: mark the number of messages to be sent by the information sender as n;
[0053] Step P2: The information sender generates n pairs of temporary SM2 public keys and sends the public keys to the information receiver;
[0054] Step P3: The information receiver chooses to view the kth message;
[0055] Step P4: The information receiver generates an SM4 encryption key sm4key, encrypts sm4key using the kth public key (SM2 asymmetric encryption), and sends the encrypted sm4key to the information sender;
[0056] Step P5: The information sender uses n private keys to solve the encrypted (SM2 asymmetric encryption) sm4key, and uses the decrypted j-th k to encrypt (SM4 symmetric encryption) the j-th message, and sends the encrypted n messages to the information receiver;
[0057] Step P6: The information receiver uses the initially generated sm4key to decrypt (SM4 symmetric encryption) the kth message to obtain the plaintext message; through the oblivious transmission scheme based on the SM2 cryptographic algorithm and the security of the SM2 public key cryptographic algorithm, the sender can send part of the information in the message set to the receiver, and the sender cannot know which message the receiver has specifically selected. This scheme protects the privacy choice of the receiver through the encryption and decryption process of the SM2 algorithm, while ensuring the security of data transmission;
[0058] At the same time, the standard SM2 encrypted ciphertext is divided into three parts, namely C1, C2, and C3; C1 is a random factor to ensure that the ciphertext is different each time it is encrypted; C2 is the real ciphertext; C3 is the SM3 hash value calculated from the plaintext, which is used to verify whether the decrypted result is correct; there are two combination orders of C1, C2, and C3: C1C2C3 and C1C3C2; in this application, a C1C2 encryption mode is designed, that is, the plaintext hash is not saved, and the decryptor is not allowed to know whether the decryption is successful; the sender does not know which information the receiver has selected, thereby protecting the receiver's privacy.
[0059] The business background of oblivious transfer mainly stems from the urgent need for privacy protection in modern communications and data processing. In many fields, such as e-commerce, financial transactions, and medical data sharing, all parties need to exchange and process data without leaking sensitive information. Oblivious transfer technology was born in such a context, allowing data senders and data receivers to transmit data securely without exposing their respective privacy, thus meeting the needs of these fields for privacy protection and data security.
[0060] like Figure 3 As shown, the specific process of processing the allocation method includes:
[0061] Step S1: When an oblivious transmission is performed during a transmission period, the message sender is marked as an execution object;
[0062] Step S2: Obtain the number of memory bytes of the batch message sent by the execution object when executing the oblivious transfer task and mark it as the execution value. If the execution value is within the sending range, execute step S3; if the execution value is outside the sending range, execute step S4;
[0063] Step S3: Retrieve the priority mode of the sending interval corresponding to the execution value, and execute the oblivious transmission method in the priority mode;
[0064] Step S4: Execute steps K2 to K5 in the processing test method, and update the sending range, sending interval and priority mode according to the test data set generated in step K5.
[0065] Provide the most optimized data processing method for the message sender, so that the message sender can directly use the priority method to process the inadvertently transmitted data. At the same time, monitor and count the coverage of the test data set. When the execution value does not fall within the sending range, adopt random allocation to process the inadvertent transmission. At the same time, update the original sending range, sending interval and priority method according to the processing results, and dynamically improve the applicability of the sending interval and priority method.
[0066] The oblivious transmission method based on SM2 and SM4 cryptographic algorithms generates test cycles and continuous transmission cycles when working. When oblivious transmission is performed within the test cycle, the information sender is marked as a test object. Several oblivious transmission tasks are allocated to the test object within the test cycle. The processing coefficient CL when the test object performs the oblivious transmission task, the processing coefficient CL, the allocation method and the sending value constitute the test data set of the oblivious transmission task; the maximum and minimum values of the sending value constitute the sending range, the sending range is divided into several sending intervals, and the priority method of the sending interval is marked; when oblivious transmission is performed within the transmission cycle, the message sender is marked as an execution object, and the oblivious transmission task is executed in combination with the execution value of the execution object and the priority method of the sending interval.
[0067] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
[0068] The above formulas are obtained by collecting a large amount of data for software simulation and selecting a formula close to the real value. The coefficients in the formula are set by technicians in this field according to the actual situation; for example: formula CL=w1×XL-w2×JS-w3×TX; technicians in this field collect multiple groups of sample data and set corresponding processing coefficients for each group of sample data; substitute the set processing coefficients and the collected sample data into the formula, any three formulas constitute a three-variable linear equation group, screen the calculated coefficients and take the average, and obtain the values of w1, w2 and w3 as 5.28, 3.61 and 2.92 respectively;
[0069] The size of the coefficient is to quantify each parameter to obtain a specific value for subsequent comparison. The size of the coefficient depends on the amount of sample data and the initial setting of the corresponding processing coefficient for each group of sample data by technical personnel in this field; as long as it does not affect the proportional relationship between the parameter and the quantized value, such as the processing coefficient is proportional to the value of the efficiency data.
[0070] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0071] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. An oblivious transmission method based on SM2 and SM4 cryptographic algorithms, characterized in that: Generate a test cycle and a continuous transmission cycle, execute a processing test method and an oblivious transmission method in the test cycle, and execute a processing allocation method and an oblivious transmission method in the transmission cycle; The specific process of processing the test method includes the following steps: Step K1: When the oblivious transmission is performed during the test period, the information sender is marked as a test object, and a number of oblivious transmission tasks are assigned to the test object during the test period; Step K2: obtaining the number of memory bytes of the batch message sent by the test object when performing the oblivious transmission task and marking it as the sending value, randomly assigning a processing mode to the test object and marking it as the allocation mode, and the processing modes include parallel processing and serial processing; Step K3: Execute the oblivious transfer method in a distribution manner; Step K4: Obtaining efficiency data XL, calculation data JS and communication data TX of the test object when performing the inadvertent transmission task; Step K5: by numerically calculating the efficiency data XL, the calculation data JS and the communication data TX, the processing coefficient CL when the test object performs the oblivious transmission task is obtained; the processing coefficient CL, the allocation method and the transmission value constitute a test data set of the oblivious transmission task; Step K6: loop through steps K2 to K5 until all oblivious transmission tasks are processed, then retrieve the test data sets of all oblivious transmission tasks, divide the transmission range into several transmission intervals by using the maximum and minimum transmission values, and mark the priority of the transmission intervals; In step K4, the efficiency data XL is the ratio of the transmission value to the duration of the oblivious transmission process of the test object, the calculation data JS is the maximum value of the resource occupancy value ZY of the test object during the oblivious transmission process; the communication data TX is the maximum value of the network channel utilization rate of the test object during the oblivious transmission process; In step K6, the specific process of marking the priority mode of the sending interval includes: marking the test data set whose sending value is in the sending interval as the matching data set of the sending interval, calculating the average value of the processing coefficients CL of all matching data sets whose allocation mode is parallel processing and marking it as the parallel priority value of the sending interval, calculating the average value of the processing coefficients CL of all matching data sets whose allocation mode is serial processing and marking it as the serial priority value of the sending interval, comparing the parallel priority value with the serial priority value and marking the priority mode of the sending interval according to the comparison result; The specific process of comparing the parallel priority value with the serial priority value includes: if the parallel priority value is less than the serial priority value, serial processing is marked as the priority mode for sending the interval; if the parallel priority value is greater than or equal to the serial priority value, parallel processing is marked as the priority mode for sending the interval.
2. The oblivious transmission method based on SM2 and SM4 cryptographic algorithms according to claim 1, characterized in that: The specific process of the oblivious transfer method includes the following steps: Step P1: mark the number of messages to be sent by the information sender as n; Step P2: The information sender generates n pairs of temporary SM2 public keys and sends the public keys to the information receiver; Step P3: The information receiver chooses to view the kth message; Step P4: The information receiver generates an sm4 encryption key sm4key, encrypts sm4key using the kth public key, and sends the encrypted sm4key to the information sender; Step P5: The information sender encrypts the message twice; Step P6: The information receiver uses the initially generated sm4key to decrypt the kth message to obtain the plaintext message.
3. The oblivious transmission method based on SM2 and SM4 cryptographic algorithms according to claim 2, characterized in that: In step P5, the specific process of the information sender performing secondary encryption on the message includes: the information sender uses n private keys to decrypt the encrypted sm4key respectively, encrypts the jth message with the decrypted jth k respectively, and sends the encrypted n messages to the information receiver.
4. The oblivious transmission method based on SM2 and SM4 cryptographic algorithms according to claim 3, characterized in that: The specific process of handling the allocation method includes: Step S1: When an oblivious transmission is performed during a transmission period, the message sender is marked as an execution object; Step S2: Obtain the number of memory bytes of the batch message sent by the execution object when executing the oblivious transfer task and mark it as the execution value. If the execution value is within the sending range, execute step S3; if the execution value is outside the sending range, execute step S4; Step S3: Retrieve the priority mode of the sending interval corresponding to the execution value, and execute the oblivious transmission method in the priority mode; Step S4: Execute steps K2 to K5, and update the sending range, sending interval and priority mode according to the test data set generated in step K5.
Citation Information
Patent Citations
Hidden query system based on trusted execution environment and casual transmission
CN115292378A
Function test method and device for privacy computing platform based on block chain assistance
CN115658477A
Flexible content selection processes using secure multi-party computation
US20230171091A1
Cited By
Password processing method and system based on SM2 algorithm and SM4 algorithm
CN122457240A
A cryptographic processing method and system based on SM2 and SM4 algorithms
CN122457240B