Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Oblivious Transfer (OT), also known as casual Transfer, is a privacy-preserving two-party communication protocol that enables two communicating parties to communicate data in a selective obfuscation manner. The sender may have a plurality of data. One or more of the plurality of data can be obtained by the recipient via an inadvertent transmission. In this process, the sender does not know which data the receiver receives; and the receiver cannot obtain any data other than the data it receives.
The random seed may be a random number used to generate the random number. The random seed may be a true random number. In practical application, the random seed is used as an initial condition, and a random number generation algorithm is utilized to perform multiple iterations, so that a plurality of corresponding random numbers can be generated. The same random number generation algorithm is executed by different implementation bodies based on the same random seed, and the same random number can be obtained. The random number generation algorithm may include a squaring Method (Midsquare Method), a Linear congruence Method (Linear Congruential Method), and the like.
Please refer to fig. 1. This specification provides embodiments of a data transmission system. The data transmission system may include a sender, a receiver, and a Third Party (TTP). The sender can be equipment such as a server, a mobile phone, a tablet computer or a personal computer; alternatively, the system may be a system including a plurality of devices, for example, a server cluster including a plurality of servers. The receiver can be a server, a mobile phone, a tablet computer, a personal computer or other equipment; alternatively, the system may be a system including a plurality of devices, for example, a server cluster including a plurality of servers. The third party may be a server; alternatively, it may be a server cluster including a plurality of servers.
The sender may be a sender of service data in an inadvertent transmission process, the receiver may be a receiver of the service data in the inadvertent transmission process, and the sender may hold a plurality of service data for the receiver to select. The third party may be configured to issue a random number to the sender and/or the receiver, so that the sender and the receiver can perform an inadvertent transmission. The process of inadvertent transmission between the sender and the receiver is as follows.
The third party and the sender may agree on a first random seed. The sender may generate a plurality of first random numbers according to the first random seed; a plurality of service data held by the mobile terminal can be encrypted according to the plurality of first random numbers and the offset; the encrypted plurality of ciphertext data may be transmitted to a recipient. The receiver may receive the plurality of ciphertext data; the target position can be masked by using the offset to obtain a confusion position; the obfuscated location may be sent to a third party. And the target position is the position of the service data to be selected by the receiver in the plurality of service data. A third party may receive the obfuscated location; a second random number may be generated from the first random seed and the obfuscated position; the second random number may be transmitted to a receiving side. The receiving side may receive the second random number; the ciphertext data located at the target position in the plurality of ciphertext data may be decrypted according to the second random number, so as to obtain the service data to be selected. Thus, the receiving is convenient to select and obtain the service data corresponding to the target position. In this process, the sender does not know which service data the receiver selects, and the receiver cannot obtain any service data other than the service data selected by the receiver.
The present specification also provides an embodiment of a data transmission method. By this embodiment, an inadvertent transmission between the sender and the receiver is enabled. Referring to fig. 2, the embodiment may include the following steps.
Step S101: the sender generates a plurality of first random numbers according to the first random seeds.
In some embodiments, the sender may hold a plurality of service data for selection by the receiver, and each service data may have a position in the plurality of service data. In one scenario example, the sender holds d0、d1、...、dN-1The number N of traffic data is equal to,d0、d1、dN-1the positions in the N service data are respectively 0, 1 and N-1, and the bit number of each service data is K.
In some embodiments, the first random seed may be a random seed agreed between the third party and the sender. The sender may generate a plurality of first random numbers according to the first random seed, and each first random number may have a position in the plurality of first random numbers. The number of the first random numbers may be the same as or different from the number of the service data, and the number of bits of the first random numbers may also be the same as or different from the number of bits of the service data, depending on the encryption scheme used by the sender in the subsequent step S113. In some embodiments, the sender may perform multiple iterations with the random number generation algorithm using the first random seed as an initial condition, so as to generate a corresponding plurality of first random numbers. In other embodiments, the sender may generate a random number sequence by a random number generation algorithm with the first random seed as an input; the random number sequence may be split into a plurality of first random numbers. Continuing with the previous scenario example, the number of bits of the random number sequence may be N × K. The sender may split the random number sequence into s0、s1、...、sN-1Wait for N first random numbers, s0、s1、sN-1The positions in the N first random numbers are respectively 0, 1 and N-1, and the bit number of each first random number is K.
Step S103: and the sender encrypts a plurality of service data held by the sender according to the plurality of first random numbers and the offset.
In some embodiments, the sender and the receiver may both hold the offset. In some embodiments, the sender and the receiver may agree on a second random seed. The sender may locally generate an offset according to the second random seed, and the receiver may also locally generate an offset according to the second random seed. In other embodiments, the sender may randomly generate an offset; the offset may be sent to the recipient. The receiver may receive the offset. In other embodiments, the receiver may randomly generate an offset; the offset may be sent to the sender. The sender may receive the offset.
The offset is used for covering the target position, and a third party is prevented from obtaining a clear target position in a subsequent process. The offset may be a random number. The offset may specifically be a positive integer, and the size of the offset is smaller than or equal to the number of the service data. The target position is the position of the service data to be selected by the receiver in the plurality of service data. The target position may be a positive integer, and the size of the target position is smaller than or equal to the number of the service data. Continuing with the previous scenario example, the offset may be a random number r between 0 and N-1, and the target position may be a positive integer p between 0 and N-1.
In some embodiments, the sender may add the offset to a position of each first random number in the plurality of first random numbers, respectively; each addition result and the number of the service data can be subjected to modular operation respectively; the traffic data may be encrypted using the first random number located at each operation result among the plurality of first random numbers, respectively. The modulo operation is used to cyclically shift the first random number by the offset number of positions. Thus, the sender can obtain the first random number which is separated from each first random number (hereinafter, referred to as the original first random number) by the offset, and can encrypt the service data at the corresponding position by using the obtained first random number. The traffic data at the respective locations can be understood as: the position of the service data in the plurality of service data is equal to the position of the original first random number in the plurality of first random numbers.
Continuing with the previous scenario example, the sender may add the offset r to the position 0, 1,. and/or N-1 of each first random number in the plurality of first random numbers, respectively, to obtain an addition result 0+ r, 1+ r,. and/or N-1+ r; for each addition result and said service data separatelyPerforming modulus operation on the quantity N to obtain operation results of (0+ r)% N, (1+ r)% N, · and (N-1+ r)% N; a first random number s at each operation result of the plurality of first random numbers may be obtained(0+r)%N、s(1+r)%N、...、s(N-1+r)%N(ii) a Can use s(0+r)%N、s(1+r)%N、...、s(N-1+r)%NFor service data d0、d1、...、dN-1Encrypting to obtain ciphertext data s(0+r)%NXORd0、s(1+r)%NXORd1、...、s(N-1+r)%NXORdN-1. % represents a modulo operation and XOR represents an XOR operation. It should be noted that, the encryption of the service data by the exclusive or operation is only an example, and in practical applications, the service data may be encrypted by other methods, such as an AES encryption method.
Step S105: the sender sends the encrypted ciphertext data to the receiver.
Step S107: and the receiving party receives a plurality of ciphertext data, and the offset is used for masking the target position to obtain the confusion position.
In some embodiments, by masking the target location using the offset, a third party may be prevented from obtaining an unambiguous target location in subsequent processes. The recipient may add an offset to the target location; a modulo operation may be performed on the addition result and the number of the service data; the result of the operation may be used as a confusion location. Continuing with the previous scenario example, the recipient may calculate c ═ r + p)% N as the alias position, c denotes the alias position, r denotes the offset, p denotes the target position, and% denotes the modulo operation.
Step S109: the receiving party sends the confusion position to a third party.
Step S111: and the third party receives the confusion position and generates a second random number according to the first random seed and the confusion position.
In some embodiments, the second random number may be equal to a first random number of the plurality of first random numbers that is located at the obfuscated location. Continuation of preceding scene examplesThe N first random numbers s0、s1、...、sN-1The first random number at the confusion position c may be scAnd thus the second random number may be associated with scAre equal.
In some embodiments, the third party may generate the second random number from the first random seed and the obfuscated location in any manner. In some embodiments, the third party may generate the plurality of first random numbers from the first random seed; the first random number located at the confusion position may be selected from the plurality of first random numbers as the second random number. In some embodiments, the third party may further directly generate, as the second random number, a first random number located at the obfuscated position from among the plurality of first random numbers according to the first random seed and the obfuscated position.
Step S113: and the third party sends the second random number to a receiving party.
Step S115: and the receiver receives the second random number, and decrypts the ciphertext data positioned at the target position in the plurality of ciphertext data according to the second random number to obtain the service data to be selected.
In some embodiments, the plurality of ciphertext data is obtained by encrypting the plurality of service data. The arrangement order of the plurality of ciphertext data and the arrangement order of the plurality of service data may be maintained consistent. For example, if the position of a certain service data in the plurality of service data is j. Then, the position of the ciphertext data corresponding to the service data in the plurality of ciphertext data is also j. Therefore, the receiver can decrypt the ciphertext data located at the target position in the plurality of ciphertext data according to the second random number, so as to obtain the service data to be selected. And obtaining the service data corresponding to the target position. Continuing the preceding example of a scenario, the plurality of ciphertext data
s(0+r)%NXORd0、s(1+r)%NXORd1、...、s(N-1+r)%NXORdN-1The ciphertext data at the target position p may beIs s is(p+r)%NXORdp. In view of sc=s(p+r)%NThe receiving party may be based on a second random number scFor ciphertext data s(p+r)%NXORdpDecrypting to obtain the final service data d to be selectedp。
Of course, the arrangement order of the plurality of ciphertext data and the arrangement order of the plurality of service data may be different. The receiving side may attempt to decrypt the plurality of ciphertext data based on the second random number, but only one ciphertext data is successfully decrypted. The receiver may use the successfully decrypted service data as the service data corresponding to the target location.
In some embodiments, the number of bits of the first random number and the number of bits of the second random number may be equal to the number of bits of the service data. Thus, the service data can be encrypted by the first random number having the same number of bits as the service data in step S103, and the ciphertext data can be decrypted by the second random number having the same number of bits as the service data in step S115.
In some embodiments, the number of bits of the first random number and the number of bits of the second random number may both be equal to a preset safety threshold. The security threshold may be, for example, 128 bits, 256 bits, or the like. Thus, the service data may be encrypted according to a first random number having a number of bits equal to the security threshold in step S103, and the ciphertext data may be decrypted according to a second random number having a number of bits equal to the security threshold in step S115.
In some embodiments, the number of bits of the traffic data may be greater than the safety threshold. The number of bits of the first random number and the number of bits of the second random number may both be equal to the security threshold. The sender may generate a plurality of third random numbers according to the plurality of first random numbers, and a bit number of the third random numbers may be equal to a bit number of the service data. The sender may specifically generate a corresponding third random number according to each first random number. The sender may encrypt the plurality of service data according to the plurality of third random numbers and the offset, and a specific encryption process may refer to a related description in step S103. Accordingly, the receiver may generate a fourth random number according to the second random number, and a bit number of the fourth random number may be equal to a bit number of the service data. The fourth random number may be equal to a third random number of the plurality of third random numbers that is located at the obfuscated location. The receiving side may decrypt the ciphertext data located at the target position in the plurality of ciphertext data according to the fourth random number, and a specific decryption process may refer to related description in step S115.
In this way, in step S103, the service data may be encrypted according to the third random number whose bit number is greater than the security threshold, and in step S115, the ciphertext data may be decrypted according to the fourth random number whose bit number is greater than the security threshold. On the other hand, the third party transmits the second random number to the receiving party instead of transmitting the fourth random number to the receiving party, and the number of bits of the second random number is smaller than that of the fourth random number, so that the communication traffic between the third party and the receiving party is reduced.
In the data transmission method, the sender and the receiver in the embodiments of the present description can implement the inadvertent transmission. Because the business data held by the sender only needs to be encrypted once, the calculation amount is reduced, and the efficiency is improved.
The present specification also provides another embodiment of a data transmission method. The embodiment takes a sender as an execution subject. The sender may hold a plurality of service data.
Referring to fig. 3, the embodiment may include the following steps.
Step S21: a plurality of first random numbers is generated from the first random seed.
Step S23: and encrypting a plurality of service data held by the self according to the plurality of first random numbers and the offset.
The offset may be obtained by: generating an offset according to the second random seed; or, randomly generating an offset; alternatively, an offset from the receiving side is received.
Step S25: and sending the encrypted plurality of ciphertext data to a receiving party.
In some embodiments, the number of bits of the first random number may be equal to the number of bits of the service data. Thus, the service data can be encrypted according to the first random number having the same number of bits as the service data in step S23.
In some embodiments, the number of bits of the first random number may be equal to a preset safety threshold. Thus, in step S23, the traffic data may be encrypted according to the first random number having the number of bits equal to the security threshold.
In some embodiments, the number of bits of the traffic data may be greater than the safety threshold. The number of bits of the first random number may be equal to the safety threshold. The sender may generate a plurality of second random numbers from the plurality of first random numbers; the plurality of traffic data may be encrypted according to the plurality of second random numbers and the offset. The number of bits of the second random number may be equal to the number of bits of the service data. Thus, in step S23, the traffic data may be encrypted according to the second random number having the bit number greater than the security threshold. The description of the second random number may refer to the description of the third random number in the embodiment corresponding to fig. 2.
In the data transmission method, the sender and the receiver in the embodiments of the present description can implement the inadvertent transmission. Because the business data held by the sender only needs to be encrypted once, the calculation amount is reduced, and the efficiency is improved.
The present specification also provides another embodiment of a data transmission method. The embodiment takes a receiving party as an execution subject.
Referring to fig. 4, the embodiment may include the following steps.
Step S31: and receiving a plurality of ciphertext data sent by the sender.
The plurality of ciphertext data may be obtained by encrypting a plurality of service data.
Step S33: and covering the target position by using the offset to obtain a confusion position.
The offset may be obtained by: generating an offset according to the random seed; or, randomly generating an offset; alternatively, an offset from the sender is received.
Step S35: sending the obfuscated location to a third party.
Step S37: and receiving the first random number sent by the third party.
The first random number may be generated according to the confusion location. For the description of the first random number, reference may be made to the description of the second random number in the embodiment corresponding to fig. 2.
Step S39: and decrypting the ciphertext data positioned at the target position in the plurality of ciphertext data according to the first random number to obtain the service data to be selected.
In some embodiments, the number of bits of the first random number may be equal to the number of bits of the service data. Thus, in step S39, the ciphertext data may be decrypted based on the first random number having the same number of bits as the service data.
In some embodiments, the number of bits of the first random number may be equal to a preset safety threshold. Thus, the ciphertext data may be decrypted in step S39 according to the first random number having the number of bits equal to the security threshold.
In some embodiments, the number of bits of the traffic data may be greater than the safety threshold. The number of bits of the first random number may be equal to the safety threshold. The receiving party may generate a second random number from the first random number; ciphertext data located at the target position in the plurality of ciphertext data may be decrypted according to the second random number. The number of bits of the second random number may be equal to the number of bits of the service data. Thus, the ciphertext data may be decrypted in step S39 according to the second random number having the bit number greater than the security threshold. For the description of the second random number, reference may be made to the description of the fourth random number in the embodiment corresponding to fig. 2.
In the data transmission method, the sender and the receiver in the embodiments of the present description can implement the inadvertent transmission. Because the business data held by the sender only needs to be encrypted once, the calculation amount is reduced, and the efficiency is improved.
The present specification also provides another embodiment of a data transmission method. This embodiment takes a third party as an execution subject.
Referring to fig. 5, the embodiment may include the following steps.
Step S41: receiving the confusion position sent by the receiving party.
The confusion position can be obtained by masking a target position, wherein the target position is a position of the service data to be selected by the receiver in the plurality of service data held by the sender.
Step S43: and generating a random number according to a random seed and the confusion position.
For the description of the random seed, reference may be made to the description of the first random seed in the embodiment corresponding to fig. 2. For the description of the random number, reference may be made to the description of the second random number in the embodiment corresponding to fig. 2.
Step S45: and sending the random number to a receiving party.
In some embodiments, the number of bits of the random number may be equal to the number of bits of the traffic data, or may be equal to a security threshold.
In the data transmission method, the sender and the receiver in the embodiments of the present description can implement the inadvertent transmission. Because the business data held by the sender only needs to be encrypted once, the calculation amount is reduced, and the efficiency is improved.
The present specification also provides an embodiment of a data transmission apparatus, which is applied to a sender holding multiple service data. Referring to fig. 6, the apparatus may include the following elements.
A generating unit 51 for generating a plurality of first random numbers according to the first random seed;
an encrypting unit 53, configured to encrypt a plurality of service data owned by itself according to the plurality of first random numbers and the offset;
a transmitting unit 55, configured to transmit the plurality of encrypted ciphertext data to the receiving side.
The present specification also provides an embodiment of a data transmission apparatus, which is applied to a receiving party. Referring to fig. 7, the apparatus may include the following elements.
A first receiving unit 61, configured to receive a plurality of ciphertext data sent by a sending party; the plurality of ciphertext data are obtained by encrypting a plurality of service data;
a masking unit 63, configured to mask the target position with the offset to obtain a confusion position; the target position is the position of the service data to be selected by the receiver in the plurality of service data;
a transmitting unit 65 for transmitting the confusion location to a third party;
a second receiving unit 67, configured to receive the first random number sent by the third party; the first random number is generated according to an obfuscated position;
a decryption unit 69, configured to decrypt, according to the first random number, ciphertext data located at the target position in the plurality of ciphertext data, to obtain service data to be selected.
The present specification also provides an embodiment of a data transmission apparatus, which is applied to a third party. Referring to fig. 8, the apparatus may include the following elements.
A receiving unit 71, configured to receive the confusion position sent by the receiving party; the confusion position is obtained by covering a target position, wherein the target position is the position of the service data to be selected by the receiver in the service data held by the sender;
a generating unit 73 for generating a random number according to a random seed and the confusion position;
a sending unit 75, configured to send the random number to a receiving side.
An embodiment of an electronic device of the present description is described below. Fig. 9 is a schematic diagram of a hardware structure of an electronic device in this embodiment. As shown in fig. 9, the electronic device may include one or more processors (only one of which is shown), memory, and a transmission module. Of course, it is understood by those skilled in the art that the hardware structure shown in fig. 9 is only an illustration, and does not limit the hardware structure of the electronic device. In practice the electronic device may also comprise more or fewer component elements than shown in fig. 9; or have a different configuration than that shown in fig. 9.
The memory may comprise high speed random access memory; alternatively, non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory may also be included. Of course, the memory may also comprise a remotely located network memory. The remotely located network storage may be connected to the electronic device through a network such as the internet, an intranet, a local area network, a mobile communications network, or the like. The memory may be used for storing program instructions or modules of application software, such as the program instructions or modules of the embodiment corresponding to fig. 3 in this specification; and/or, the program instructions or modules of the embodiments corresponding to fig. 4 in this specification; and/or program instructions or modules of the embodiments corresponding to fig. 5 in this specification.
The processor may be implemented in any suitable way. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The processor may read and execute the program instructions or modules in the memory.
The transmission module may be used for data transmission via a network, for example via a network such as the internet, an intranet, a local area network, a mobile communication network, etc.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and the same or similar parts in each embodiment may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, as for the device embodiment and the electronic apparatus embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment. In addition, it is understood that one skilled in the art, after reading this specification document, may conceive of any combination of some or all of the embodiments listed in this specification without the need for inventive faculty, which combinations are also within the scope of the disclosure and protection of this specification.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardbyscript Description Language (vhr Description Language), and the like, which are currently used by Hardware compiler-software (Hardware Description Language-software). It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the present specification may be essentially or partially implemented in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.