Method and apparatus for unintentional transmission based on optical quantum, and related device
By performing semi-homomorphic encryption and hash value calculation on the random number sequence, combined with out-of-order transmission using optical quantum coding, the confidentiality problem of combining quantum communication with the two-to-one OT protocol is solved, achieving confidentiality and security of unintentional transmission.
Patent Information
- Application Number
- CN202310477550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-04-27
AI Technical Summary
In the existing technology, how to combine quantum communication with the 2-to-1 OT protocol to improve the confidentiality of OT information has not yet been effectively solved.
By performing semi-homomorphic encryption on the first and second random number sequences, and calculating the hash value using the first and second hash functions, the information is encrypted, encoded, and then disordered. The information is then transmitted using photons, and the quantum no-cloning property is combined to achieve unintentional transmission.
It achieves confidentiality and security during unintentional transmission, ensuring that the decryption device can only obtain one piece of information and cannot obtain the other, thereby improving the confidentiality and security of OT information.
Smart Images

Figure CN116667994B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cryptography, specifically to a method and apparatus for inadvertent transmission based on photonic quantum, and related equipment. Background Technology
[0002] In the fields of computer science and information security, oblivious transfer (OT) is a cryptographic protocol used for interaction between a sender and a receiver. In this protocol, the sender can send multiple messages, but the receiver can only receive one of these messages, while the others remain unknown. Similarly, the sender cannot know which message the receiver has received. Therefore, neither the sender nor the receiver knows the specific information the other has received.
[0003] Quantum communication refers to the technology of transmitting information using the principles of quantum mechanics, such as the no-cloning property of quantum mechanics. In quantum communication, the information to be transmitted is encoded into qubits, which are transmitted through light or other media. Because qubits possess the physical properties of a single photon, such as no-cloning and no-interference properties, the goal of preventing information theft and communication eavesdropping is achieved.
[0004] Since quantum communication utilizes the no-cloning property of quantum mechanics to achieve confidentiality, further research is needed on how to combine quantum communication with the 2-to-1 OT protocol to improve the confidentiality of OT information. Summary of the Invention
[0005] This application provides a method and apparatus for unintentional transmission based on photonic quantum, and related equipment, in order to solve the problem of how to combine quantum communication with a two-to-one OT protocol to improve the confidentiality of OT information.
[0006] Firstly, this application discloses a method for inadvertent transmission based on photonic quantum principles, applied to an encryption device, comprising:
[0007] The first random number sequence and the second random number sequence are respectively subjected to semi-homomorphic encryption to obtain the first encrypted value sequence and the second encrypted value sequence;
[0008] The first encrypted value sequence and the second encrypted value sequence are respectively binary encoded to obtain a first binary sequence and a second binary sequence;
[0009] The hash values of the first binary sequence are calculated using the first hash function and the second hash function, respectively, to obtain the first hash value and the second hash value;
[0010] The hash values of the second binary sequence are calculated using the first hash function and the second hash function, respectively, to obtain the third hash value and the fourth hash value;
[0011] The first information transmitted unintentionally is encrypted using the second hash value to obtain the first ciphertext, and the second information transmitted unintentionally is encrypted using the fourth hash value to obtain the second ciphertext.
[0012] The sequence composed of the first encrypted value sequence and the second encrypted value sequence is scrambled to obtain a scrambled encrypted value sequence, and then the scrambled encrypted value sequence is encoded using photons to obtain a photon sequence.
[0013] The sequence formed by the first random number sequence and the second random number sequence is scrambled in the same order according to the scrambled position in the scrambled encrypted value sequence to obtain the scrambled random number sequence.
[0014] Send the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence to the decryption device.
[0015] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0016] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0017] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0018] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0019] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0020] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0021] Secondly, this application discloses a method for inadvertent transmission based on photonic quantum principles, applied to a decryption device, comprising:
[0022] Receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photon sequence, and a randomized sequence of random numbers from an encryption device;
[0023] The photonic quantum sequence is measured using a measurement basis to obtain a measurement product result, and then the measurement product result is decrypted using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product result.
[0024] The decryption product result is divided by the disordered random number sequence to obtain the decryption random number sequence;
[0025] The decrypted random number sequence is binary encoded to obtain the target binary sequence;
[0026] The hash value of the target binary sequence is calculated using the first hash function to obtain the first target hash value;
[0027] The first target hash value is verified using the first hash value, and if the verification is successful, the hash value of the target binary sequence is calculated using the second hash function to obtain the second target hash value;
[0028] The first ciphertext and the second ciphertext are decrypted using the second target hash value to decrypt one of the unintentionally transmitted first information and second information.
[0029] Thirdly, this application discloses a quantum-based inadvertent transmission device for use in encryption devices; the device includes:
[0030] An encryption unit is used to perform semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain a first encrypted value sequence and a second encrypted value sequence;
[0031] An encoding unit is used to perform binary encoding on the first encrypted value sequence and the second encrypted value sequence respectively to obtain a first binary sequence and a second binary sequence;
[0032] The calculation unit is used to calculate the hash value of the first binary sequence using a first hash function and a second hash function respectively, to obtain the first hash value and the second hash value;
[0033] The calculation unit is further configured to calculate the hash value of the second binary sequence using the first hash function and the second hash function respectively, to obtain the third hash value and the fourth hash value;
[0034] The encryption unit is further configured to encrypt the first information transmitted unintentionally using the second hash value to obtain the first ciphertext, and to encrypt the second information transmitted unintentionally using the fourth hash value to obtain the second ciphertext.
[0035] The scrambling unit is used to scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain a scrambled encrypted value sequence.
[0036] The encoding unit is used to encode the disordered encrypted value sequence using photons to obtain a photon sequence;
[0037] The scrambling unit is further configured to scramble the sequence composed of the first random number sequence and the second random number sequence in the same order according to the scrambled position in the scrambled encrypted value sequence to obtain the scrambled random number sequence.
[0038] The sending unit is configured to send the first hash function and the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photonic quantum sequence, and the random number pair sequence to the decryption device.
[0039] Fourthly, this application discloses a quantum-based inadvertent transmission device for use in decryption equipment; the device includes:
[0040] The receiving unit is configured to receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photonic quantum sequence, and a random number sequence after scrambling from an encryption device.
[0041] The measurement unit is used to measure the photonic quantum sequence using a measurement basis to obtain a measurement product result, and then to decrypt the measurement product result using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product result.
[0042] The calculation unit is used to perform integer division calculation on the decryption product result using the disordered random number sequence to obtain the decryption random number sequence;
[0043] An encoding unit is used to perform binary encoding on the decrypted random number sequence to obtain a target binary sequence;
[0044] The computing unit is further configured to use the first hash function to calculate the hash value of the target binary sequence, thereby obtaining the first target hash value;
[0045] The calculation unit is further configured to verify the first target hash value using the first hash value, and when the verification is successful, to calculate the hash value of the target binary sequence using the second hash function to obtain the second target hash value;
[0046] The decryption unit is used to decrypt the first ciphertext and the second ciphertext using the second target hash value, so as to decrypt one of the first information and the second information that were inadvertently transmitted.
[0047] Fifthly, an encryption device according to this application includes a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps of the method described in the first aspect above.
[0048] A sixth aspect is a decryption device according to this application, comprising a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps of the method described in the second aspect above.
[0049] A seventh aspect is a computer-readable storage medium of this application, wherein a computer program or instructions are stored on the computer-readable storage medium, and when the computer program or instructions are executed by a processor, they implement the steps of the method described in the first or second aspect above.
[0050] Eighthly, a computer program product of this application includes a computer program or instructions, wherein when the computer program or instructions are executed by a processor, they implement the steps of the method described in the first or second aspect above.
[0051] The beneficial effects of the technical solutions in aspects two through eight can be found in the technical effects of the technical solution in aspect one, and will not be repeated here. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below.
[0053] Figure 1 This is a schematic diagram of the architecture of an encryption / decryption system according to an embodiment of this application;
[0054] Figure 2 This is a schematic flowchart of an embodiment of the unintentional transmission method based on photonic quantum.
[0055] Figure 3 This is a block diagram of the functional units of an inadvertent transmission device based on photonic quantum computing, according to an embodiment of this application.
[0056] Figure 4 This is a functional unit block diagram of another inadvertent transmission device based on photonic quantum according to an embodiment of this application;
[0057] Figure 5 This is a schematic diagram of the structure of an encryption device according to an embodiment of this application;
[0058] Figure 6 This is a schematic diagram of the structure of a decryption device according to an embodiment of this application. Detailed Implementation
[0059] To help those skilled in the art better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the description of the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] It should be understood that the terms "first," "second," etc., used in the embodiments of this application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, software, product, or device that includes a series of steps or units is not limited to the listed steps or units, but also includes steps or units not listed, or other steps or units inherent to these processes, methods, products, or devices.
[0061] The term "embodiment" as used in the embodiments of this application means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0062] In the embodiments of this application, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone; A and B exist simultaneously; B exists alone. Among them, A and B can be singular or plural.
[0063] In this embodiment, the symbol " / " can indicate that the preceding and following objects are in an "or" relationship. Alternatively, the symbol " / " can also represent a division sign, i.e., performing a division operation. For example, A / B can mean A divided by B.
[0064] In the embodiments of this application, the symbols “*”, “·”, or “×” can represent multiplication, that is, performing multiplication operations. For example, A*B, A·B, or A×B can represent A multiplied by B.
[0065] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.
[0066] In this application's embodiments, "equal to" can be used with "greater than" and is applicable to technical solutions using the "greater than" condition, or it can be used with "less than" and is applicable to technical solutions using the "less than" condition. When "equal to" is used with "greater than," it is not used with "less than"; when "equal to" is used with "less than," it is not used with "greater than."
[0067] The technical solutions, beneficial effects, and related concepts involved in the embodiments of this application will be described in detail below.
[0068] I. Encryption and Decryption System
[0069] 1. Description
[0070] It should be noted that the embodiments of this application provide an encryption and decryption system, which may include an encryption device and a decryption device.
[0071] For example, such as Figure 1 As shown, the encryption / decryption system 10 includes an encryption device 110 and a decryption device 120. The encryption device 110 and the decryption device 120 can communicate with each other, such as through quantum communication.
[0072] It should be noted that, Figure 1 This is merely an illustrative example of the architecture of an encryption / decryption system and does not constitute a limitation on the network architecture of the optical quantum unintentional transmission system in this application.
[0073] The encryption and decryption devices of the embodiments of this application will be described in detail below.
[0074] 2. Encryption device
[0075] Encryption devices can be entities, software, hardware / software combinations, units, modules, or devices that have functions such as information encryption, communication, and processing.
[0076] In some possible implementations, the encryption device can be one of the following: terminal device, electronic device, handheld device, wearable device, in-vehicle device, in-vehicle terminal, augmented reality (AR) device, virtual reality (VR) device, Internet of Things (IoT) device, projection device, projector, user equipment (UE), terminal, mobile terminal, smartphone, smart screen, smart TV, smartwatch, laptop, smart speaker, camera, game controller, microphone, station (STA), access point (AP), mobile station (MS), personal digital assistant (PDA), personal computer (PC), session initiation protocol (SIP) telephone, wireless local loop (WLL) station, centralized controller, base station (BS), base transceiver station (BTS), site controller, switch, server, network device, etc.
[0077] It should be noted that the embodiments of this application do not impose any particular limitation on the specific structure of the execution subject of the inadvertent transmission based on photonic quantum computing. As long as it can be processed by running a computer program or instructions that record the methods provided in the embodiments of this application, and by performing the processing according to the methods provided in the embodiments of this application, it is acceptable. For example, the execution subject of the methods provided in the embodiments of this application can be an encryption device, or a processor / device / module / unit within the encryption device capable of calling and executing computer programs or instructions, etc., without specific limitations.
[0078] 3. Decryption device
[0079] Decryption equipment can be a physical entity, software, hardware / software combination, unit, module, or device that has functions such as information decryption, communication, and processing.
[0080] In some possible implementations, the decryption device can be one of the following: terminal device, electronic device, handheld device, wearable device, vehicle-mounted device, vehicle-mounted terminal, augmented reality device, virtual reality device, IoT device, projection device, projector, user equipment, terminal, mobile terminal, mobile phone, smart screen, smart TV, smartwatch, laptop, smart speaker, camera, game controller, microphone, site, access point, mobile station, personal digital assistant, personal computer, session initiation protocol telephone, wireless local loop station, centralized controller, base station, base station transceiver, site controller, switch, server, network equipment, etc.
[0081] It should be noted that the embodiments of this application do not impose any particular limitation on the specific structure of the execution subject of the inadvertent transmission based on photonic quantum computing. As long as it can be processed by running a computer program or instructions that record the methods provided in the embodiments of this application, and by performing the processing according to the methods provided in the embodiments of this application, it is acceptable. For example, the execution subject of the methods provided in the embodiments of this application can be a decryption device, or a processor / device / module / unit within the decryption device capable of calling and executing computer programs or instructions, etc., without specific limitations.
[0082] 4. Hardware architecture examples of encryption or decryption devices
[0083] In some possible implementations, the encryption or decryption device may include at least one of a processor, memory, communication components, input / output drivers, etc. Examples are given below.
[0084] ① Processor
[0085] In some possible implementations, the processor can be used to run or add an operating system, which can be any one or more computer operating systems that implement business processing through processes. Examples include Linux, Unix, Android, iOS, Windows, Zephyr, Real-Time Operating System (RTOS), DOS, Mac, ThreadX, embedded operating systems, and Nucleus Plus.
[0086] In some possible implementations, the processor can be viewed as a complete system-on-chip (SOC).
[0087] In some possible implementations, the processor may include one or more processing units. For example, a processing unit may include at least one of the following: a central processing unit (CPU), an application processor (AP), a microcontroller unit (MCU), a single-chip microcomputer (SCM), a microcontroller, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a digital signal processor (DSP), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a baseband processor, and a neural-network processing unit (NPU). The different processing units may be separate or integrated together.
[0088] In some possible implementations, a processing unit can be a single core or multiple cores.
[0089] In some possible implementations, a processing unit can run or load a multi-core subsystem. This multi-core subsystem can be an operating system with multi-core processing capabilities.
[0090] In some possible implementations, the processor may also include memory for storing computer programs or instructions.
[0091] For example, a processor can call programs stored in memory to run an operating system.
[0092] For example, the processor's memory can store or cache instructions that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from that memory, thereby avoiding repeated accesses, reducing processor wait time, and improving system efficiency.
[0093] For example, the memory in a processor can also store or cache data, and synchronize or transfer this data to other processors for execution. This memory in the processor can be a cache memory.
[0094] ② Memory
[0095] In some possible implementations, memory can be used to store computer programs or instructions.
[0096] In some possible implementations, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).
[0097] ③ Communication components
[0098] It should be noted that the communication component can be used to support communication between encryption devices and decryption devices.
[0099] In some possible implementations, the communication component can provide solutions for communication between encryption and decryption devices, including 2G / 3G / 4G / 5G.
[0100] In some possible implementations, the communication component can provide solutions for communication between encryption and decryption devices, including Bluetooth (BT), WLAN, WiFi networks, near field communication (NFC), ultra-wideband (UWB), infrared (IR), and quantum communication.
[0101] In some possible implementations, the communication component can provide at least one of the following communication methods used on encryption and decryption devices: Serial Peripheral Interface (SPI), Inter-Integrated Circuit (I2C) interface, Inter-Integrated Circuit Sound (I2S) interface, Pulse Code Modulation (PCM) interface, Universal Asynchronous Receiver / Transmitter (UART) interface, Mobile Industry Processor Interface (MIPI), General-Purpose Input / Output (GPIO) interface, Subscriber Identity Module (SIM) interface, and Universal Serial Bus (USB) interface.
[0102] In some possible implementations, at least some functional modules of the communication component may be located in the processor; or, at least some functional modules of the communication component may be located in the same device as some modules of the processor.
[0103] ④ Input / output drivers
[0104] In some possible implementations, input / output drivers can be used to handle various inputs / outputs from user-operated devices.
[0105] For example, input / output drivers can be operated to detect and process various user input or output events, etc.
[0106] II. An Inadvertent Transmission Method Based on Photons
[0107] 1. Description
[0108] Unintentional transmission (OT) is a protocol in cryptography and is widely used as a fundamental cryptographic primitive. Among them, 1-out-of-2 (outputting 1 from 2) unintentional transmission is a practically applicable OT protocol, also known as a two-out-of-one OT protocol, and is currently one of the more commonly used. In a two-out-of-one OT protocol, the sender possesses two pieces of information, information A and information B, while the receiver wants to know one of them. After the two-out-of-one OT protocol is executed, the receiver knows one piece of information but not the other, and the sender also does not know whether the receiver received information A or information B.
[0109] Quantum communication utilizes the no-cloning property of quantum mechanics to achieve secure communication. A single photon generated by a single-photon source is a photon. A photon can have polarization in the horizontal (|→>) or vertical (|↑>) direction, or in the diagonal (|↗>, |↘>) direction.
[0110] This application allows for the simple selection of either a "horizontal-vertical" (+) or "diagonal" (×) measurement method (referred to as a "measurement basis," which includes both horizontal-vertical (+) and diagonal (×) measurement bases) to measure photons generated by a single-photon source. When the measurement basis and the photon's polarization direction are aligned (i.e., the horizontal-vertical (+) measurement basis aligns with the horizontal-vertical polarization, and the diagonal (×) measurement basis aligns with the diagonal polarization), accurate results can be obtained. If there is a deviation between the measurement basis and the photon's polarization direction (e.g., a 45° deviation), only random results can be obtained.
[0111] Since quantum communication can utilize the non-cloning property of quantum mechanics to achieve confidentiality and security, this application proposes an inadvertent transmission method based on photonic quantum mechanics, aiming to combine quantum communication with a two-to-one OT protocol to improve the confidentiality and security of OT information transmission.
[0112] The following example illustrates the interaction between an encryption device and a decryption device. Figure 2 As shown, Figure 2 This is a flowchart illustrating an inadvertent transmission method based on photonic quantum computing, according to an embodiment of this application. The method may include the following steps:
[0113] S201. The encryption device performs semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain the first encrypted value sequence and the second encrypted value sequence.
[0114] S202. The encryption device performs binary encoding on the first encrypted value sequence and the second encrypted value sequence respectively to obtain the first binary sequence and the second binary sequence.
[0115] S203. The encryption device uses the first hash function and the second hash function to calculate the hash value of the first binary sequence, respectively, to obtain the first hash value and the second hash value.
[0116] S204. The encryption device uses the first hash function and the second hash function to calculate the hash value of the second binary sequence, respectively, to obtain the third hash value and the fourth hash value.
[0117] S205. The encryption device uses a second hash value to encrypt the first information transmitted unintentionally to obtain the first ciphertext, and uses a fourth hash value to encrypt the second information transmitted unintentionally to obtain the second ciphertext.
[0118] S206. The encryption device scrambles the sequence composed of the first encryption value sequence and the second encryption value sequence to obtain a scrambled encryption value sequence, and then uses photons to encode the scrambled encryption value sequence to obtain a photon sequence.
[0119] S207. The encryption device performs the same random number sequence on the sequence composed of the first random number sequence and the second random number sequence according to the random position order in the randomized encrypted value sequence, to obtain the randomized random number sequence.
[0120] S208. The encryption device sends the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence to the decryption device.
[0121] Correspondingly, the decryption device receives the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence.
[0122] S209. The decryption device uses a measurement basis to measure the photonic quantum sequence to obtain the measurement product result, and then uses the mask of the first ciphertext or the mask of the second ciphertext to decrypt the measurement product result to obtain the decrypted product result.
[0123] S210. The decryption device uses the disordered random number sequence to perform integer division calculation on the decryption product result to obtain the decryption random number sequence.
[0124] S211. The decryption device performs binary encoding on the decrypted random number sequence to obtain the target binary sequence.
[0125] S212. The decryption device uses the first hash function to calculate the hash value of the target binary sequence and obtains the first target hash value.
[0126] S213. The decryption device verifies the first target hash value using the first hash value, and when the verification is successful, it calculates the hash value of the target binary sequence using the second hash function to obtain the second target hash value.
[0127] S214. The decryption device uses the second target hash value to decrypt the first ciphertext or the second ciphertext to decrypt one of the first information or the second information that was inadvertently transmitted.
[0128] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0129] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0130] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0131] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0132] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0133] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0134] 2. Detailed Implementation Instructions
[0135] The following is about the above. Figure 2 The implementation methods involved will be explained in detail. It should be noted that the contents of the following sections can be combined and related to each other in order to realize the complete technical solution of this application.
[0136] 1) First random number sequence and second random number sequence
[0137] ① Description
[0138] It should be noted that, since the decryption device wants to know one of the two pieces of information that were inadvertently transmitted by the encryption device, and in order to ensure the confidentiality and security of the first piece of information A and the second piece of information B during the inadvertent transmission process, this application needs to encrypt the first piece of information A and the second piece of information B. In order to obtain the hash value required for encryption, this application introduces a first random number sequence and a second random number sequence.
[0139] In practice, the encryption device can generate a first random number sequence and a second random number sequence.
[0140] The first random number sequence can be understood as a sequence formed by a certain number of random numbers, the length of which is the total number of random numbers.
[0141] The second random number sequence can be understood as another sequence formed by a certain number of random numbers, the length of which is the total number of random numbers.
[0142] ② The length of the first random number sequence and the length of the second random number sequence
[0143] It should be noted that if the decryption device wants to obtain both the first information A and the second information B simultaneously, it must correctly guess the measurement basis corresponding to each random number in both the first and second random number sequences. Otherwise, if any measurement basis is incorrect, the calculated decoding result will be random, unpredictable, or erroneous. The probability that the decryption device can correctly guess the measurement basis corresponding to each random number in the first random number sequence can be determined by the length of the first random number sequence.
[0144] For example, when the length of the first random number sequence is L, its probability is 1 / 2. L If L is large, such as L = 64, then 1 / 2 L =1 / 2 64 This would be an extremely small probability, making it very difficult for the decryption device to guess the measurement basis corresponding to each random number in the first random number sequence, thus improving confidentiality.
[0145] Correspondingly, the probability that the decryption device can guess the measurement basis corresponding to each random number in the second random number sequence can also be determined by the length of the second random number sequence.
[0146] Based on this, the lengths of the first and second random number sequences in this application can be used to ensure that the probability of the decryption device simultaneously guessing the measurement basis corresponding to both the first and second random number sequences is sufficiently small. This effectively reduces the probability that the decryption device can simultaneously decrypt the first information A and the second information B, ensuring the realization of unintended transmission.
[0147] In some possible implementations, the length of the first random number sequence and the length of the second random number sequence can be the same or different, without any specific restrictions.
[0148] For example, the length of the first random number sequence is L, and the length of the second random number sequence is also L.
[0149] For example, the length of the first random number sequence is L, the length of the second random number sequence is M, and L > M.
[0150] It should be noted that, in the following description, the present application mainly takes the case where the length of the first random number sequence is the same as the length of the second random number sequence as an example, and the same technical solution can also be implemented according to the maximum value of the two lengths (for example, L>M) for different cases.
[0151] In some possible implementations, the length of the first random number sequence and the length of the second random number sequence may be determined through interaction between the encryption device and the decryption device.
[0152] In this way, the determination through interaction between the two parties ensures that both the encryption device and the decryption device have the capability to process.
[0153] (3) Random numbers in the first random number sequence and random numbers in the second random number sequence
[0154] In some possible implementations, the random numbers in the first random number sequence may be different from each other, or the same random number may exist, which is not specifically limited herein.
[0155] For example, taking different from each other as an example, the length of the first random number sequence is L, and a i represents the i-th (0≤i<L) random number in the first random number sequence, and a j represents the j-th (0≤j<L) random number in the first random number sequence. In this way, and i≠j, there is a i ≠a j .
[0156] For another example, taking the existence of the same random number as an example, the 1st random number a1 in the first random number sequence is equal to the 3rd random number a3.
[0157] In some possible implementations, the random numbers in the second random number sequence may be different from each other, or the same random number may exist, which is not specifically limited herein.
[0158] For example, taking different from each other as an example, the length of the second random number sequence is L, and b i represents the i-th (0≤i<L) random number in the second random number sequence, and b j represents the j-th (0≤j<L) random number in the second random number sequence. In this way, and i≠j, there is b i ≠b j .
[0159] In some possible implementations, the random numbers in the first random number sequence and the random numbers in the second random number sequence may be different from each other, or the same random number may exist.
[0160] For example, taking the lengths of the first random number sequence and the second random number sequence as being different from each other, both are L, and a i represents the i-th (0 ≤ i < L) random number in the first random number sequence, and b i represents the i-th (0 ≤ i < L) random number in the second random number sequence. Thus, for there is
[0161] where {a i} represents the set of all random numbers in the first random number sequence, that is, {a i} represents the first random number sequence; {b i} represents the set of all random numbers in the first random number sequence, that is, {b i} represents the second random number sequence.
[0162] 2) First encrypted value sequence and second encrypted value sequence
[0163] ① Description
[0164] It should be noted that, in order to improve confidentiality and security, the present application may encrypt the first random number sequence and the second random number sequence respectively, so as to obtain a first encrypted value sequence and a second encrypted value sequence.
[0165] The first encrypted value sequence can be understood as a sequence composed of encrypted values obtained by performing semi-homomorphic encryption on the random numbers in the first random number sequence.
[0166] The second encrypted value sequence can be understood as a sequence composed of encrypted values obtained by performing semi-homomorphic encryption on the random numbers in the second random number sequence.
[0167] ② Semi-homomorphic encryption
[0168] In some possible implementations, performing semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain the first encrypted value sequence and the second encrypted value sequence may include:
[0169] performing semi-homomorphic encryption on each random number in the first random number sequence to obtain a first encrypted value sequence;
[0170] performing semi-homomorphic encryption on each random number in the second random number sequence to obtain a second encrypted value sequence.
[0171] It should be noted that this application can utilize a partially homomorphic encryption (PHE) algorithm to encrypt the first random number sequence and the second random number sequence respectively. The partially homomorphic encryption algorithm can support either addition or multiplication, and may include multiplication and addition partially homomorphic encryption algorithms, as well as algorithms such as RSA, ElGamal, and Paillier.
[0172] The Paillier encryption algorithm, an extension of the RSA algorithm, can achieve additive semi-homomorphic encryption. Its principle is to convert plaintext into numbers, encrypt them, and then perform certain operations on the encrypted result to achieve semi-homomorphic encryption.
[0173] The following section of this application mainly describes the ElGamal encryption algorithm.
[0174] ◆ElGamal encryption algorithm
[0175] The ElGamal encryption algorithm is a multiplication-based semi-homomorphic encryption algorithm, also known as a multiplicative semi-homomorphic encryption algorithm. It utilizes the difficulty of solving the discrete logarithm problem to construct a public-private key asymmetric encryption system. An ElGamal encryption system can be defined by a quadruple (α, β, key, p), where p represents a chosen large prime number, key represents the private key, and 1 < key < p-1.
[0176] β=α key ;
[0177] For a plaintext x, choose a random integer k as the session key, and calculate c1 and c2 to obtain the ciphertext by encrypting the plaintext x:
[0178] c1=E1(k=E1(k,α=a k mod p;
[0179] c2=E2(x,k)=E2(x,k,β)=x·β k mod p.
[0180] Thus, using the private key key, ciphertext c1 and ciphertext c2 can be decrypted into plaintext x:
[0181]
[0182] For another plaintext x′, choose another random integer k′ as the session key, then calculate c1′ and c2′ to obtain the ciphertext obtained by encrypting the plaintext x′:
[0183] c1′=E1(k′)=E1(k′,α)=αk′ mod p;
[0184] c2′=E2(x′,k′)=E2(x′,k′,β)=x′·β k′ mod p.
[0185] Because the ElGamal encryption algorithm has multiplicative homomorphism, the product of ciphertexts can be equal to the ciphertext of the product of plaintexts, that is:
[0186] c1·c1′=E1(k)·E1(k′)=E1(k,α)·E1(k′,α)=α k ·α k′ mod p = α k+k′ mod p E1(k+k′);
[0187] c2·c2′=E2(x,k)·E2(x′,k′)=E2(x,k,β)·E2(x′,k′,β)=x·β k ·x′·β k′ mod p
[0188] =x·x′·β k+k′ mod p = E2(x·x′,k+k′);
[0189] For a product of ciphertexts, it is possible to decrypt only the product of plaintexts without decrypting the individual ciphertexts. For example, if only c1″ = c1·c1′ is disclosed, but not the individual c1 and c1′, then only the product of plaintexts x″ = x·x′ can be decrypted, but not the individual x or x′.
[0190] Similarly, the multiplication of ciphertext and plaintext is also a homomorphism, that is:
[0191] c2·x′=E2(x,k)·x′=E2(x,k,β)·x′=x·β k ·x′mod p=(x·x′)·β k mod p
[0192] =E2(x·x′,k)=E2(x·x′,k,β).
[0193] ③ How to perform semi-homomorphic encryption on the first random number sequence (optional)
[0194] In some possible implementations, each random number in the first random number sequence is semi-homomorphically encrypted to obtain a first encrypted value sequence, including:
[0195] Calculate the product of each random number in the first random number sequence with a first random number, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the first encrypted value sequence.
[0196] For example, this multiplicative semi-homomorphic encryption could include ElGamal encryption, etc.
[0197] It should be noted that the core inventive point of this application is the utilization of the no-cloning property of quantum mechanics and the characteristic that semi-homomorphic encryption can directly compute ciphertext (without decryption). In possible implementations, this application can use various encryption schemes with semi-homomorphic properties, but for the sake of explanation, this application will use the ElGamal encryption scheme with multiplicative semi-homomorphic properties for explanation. Other semi-homomorphic encryption schemes are similar and will not be elaborated further.
[0198] In addition, since each random number in the first random number sequence may have a large value that is not conducive to multiplicative semi-homomorphic encryption, this application can introduce a first random number so that the value of the random number can be reduced by multiplying the first random number with the random numbers in the first random number sequence.
[0199] For example, using the first random number sequence {a i Taking the ElGamal encryption system as an example, which uses a quadruple (α, β, key, p), for the first random number sequence {a i The i-th random number a in} i Select a first random number h i Calculate the i-th random number a i With the first random number h i The product of the two, and then choose a random integer k. i Used as a session key, it is encrypted using ElGamal to obtain an encrypted value.
[0200]
[0201] Thus, the first random number sequence {a} is processed sequentially. i For each random number in}, perform the same steps as described above to obtain the first encrypted value sequence.
[0202] In addition, different random numbers in the first random number sequence can be multiplied with the same value of the first random number, or they can be multiplied with different values of the first random number, without any specific restrictions.
[0203] For example, for the first random number sequence {a i The i-th random number a in} i Choose a first random number h i For the first random number sequence {a i The j-th random number a in} j Choose a first random number h jAmong them, h i =h j Or h i ≠h j .
[0204] ④ How to perform semi-homomorphic encryption on the second random number sequence (optional)
[0205] In some possible implementations, each random number in the second random number sequence is semi-homomorphically encrypted to obtain a second encrypted value sequence, including:
[0206] Calculate the product of each random number in the second random number sequence with a second random number, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the second encrypted value sequence.
[0207] For example, this multiplicative semi-homomorphic encryption could include ElGamal encryption, etc.
[0208] It should be noted that, consistent with the above description, since each random number in the second random number sequence may have a large value that is not conducive to multiplicative semi-homomorphic encryption, this application can introduce a second random number so as to reduce the value of the random number by multiplying the second random number with the random number.
[0209] For example, using the second random number sequence {b} i}, and taking the ElGamal encryption system as an example with a quadruple (α,β,key,p), for the second random number sequence {b i The i-th random number b in} i Choose a second random number h i ', calculate the i-th random number b' i With the second random number h i The product of k and k' is then used as the session key for ElGamal encryption to obtain an encrypted value.
[0210]
[0211] Thus, the second random number sequence {b} is processed sequentially. i Each random number in the sequence is encrypted to obtain the second encrypted value sequence.
[0212] In addition, different random numbers in the second random number sequence can be multiplied with the same value of the second random number, or they can be multiplied with different values of the second random number, without any specific restrictions.
[0213] 3) First binary sequence and second binary sequence
[0214] ① Description
[0215] It should be noted that in order to obtain the hash values required for encrypting the first information A and the second information B, this application needs to encode the first encrypted value sequence and the second encrypted value sequence into binary sequences to obtain the first binary sequence and the second binary sequence.
[0216] The first binary sequence can be understood as a sequence of binary strings obtained by binary encoding the encrypted values in the first encrypted value sequence.
[0217] The second binary sequence can be understood as a sequence of binary strings obtained by binary encoding the encrypted values in the second encrypted value sequence.
[0218] ② How to perform binary encoding on the first and second encrypted value sequences (optional)
[0219] In some possible implementations, binary encoding of the first encrypted value sequence and the second encrypted value sequence may include:
[0220] Each encrypted value in the first encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the first binary sequence.
[0221] Each encrypted value in the second encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the second binary sequence.
[0222] It should be noted that the binary strings encoded by different encrypted values can be of the same length or different lengths. However, the length of the binary string must ensure that there is enough space for the encrypted value.
[0223] In this context, the binary strings encoded by different encrypted values are of the same length, which can be understood as different encrypted values being encoded / represented using the same number of bits.
[0224] The length of the binary string encoded by different encryption values is different. This can be understood as different encryption values being encoded / represented using different numbers of bits.
[0225] For example, taking binary strings of length l as an example, for the first encrypted value sequence The i-th encrypted value in the first encrypted value sequence Encoded as an l-bit binary string Then, by concatenating the binary strings of each encrypted value in sequence, the first binary sequence is obtained as follows:
[0226]
[0227] For the second encrypted value sequence The i-th encrypted value in the second encrypted value sequence Encoded as an l-bit binary string Then, by concatenating the binary strings of each encrypted value in sequence, the second binary sequence is obtained as follows:
[0228]
[0229] In some possible implementations, the length of the binary string can be determined through interaction between the encryption and decryption devices.
[0230] In this way, through mutual interaction, it is ensured that both the encryption and decryption devices are capable of processing the data.
[0231] 4) First hash function H1 and second hash function H2
[0232] It should be noted that, since the decryption device wants to know one of the two pieces of information that were inadvertently transmitted by the encryption device, and in order to ensure the confidentiality and security of the first piece of information A and the second piece of information B during the inadvertent transmission, this application needs to encrypt the first piece of information A and the second piece of information B. In order to obtain the hash value required for encryption, this application introduces a first hash function H1 and a second hash function H2.
[0233] In this way, the encryption device can use the first hash function H1 and the second hash function H2 to calculate the hash value of the first binary sequence, obtaining the first hash value and the second hash value. The first hash value can be used for verification during decryption, and the second hash value can be used for encryption of the first information A.
[0234] For example, the first hash value h a for:
[0235]
[0236] Second hash value h a 'for:
[0237]
[0238] Correspondingly, the encryption device can use the first hash function H1 and the second hash function H2 to calculate the hash value of the second binary sequence, respectively, to obtain the third hash value and the fourth hash value. The third hash value can be used for verification during decryption, and the fourth hash value can be used for encryption of the second information B.
[0239] For example, the third hash value h b for:
[0240]
[0241] Fourth hash value h b 'for:
[0242]
[0243] In some possible implementations, the first hash function H1 and / or the second hash function H2 can both be regarded as one-way hash functions.
[0244] In some possible implementations, the first hash function H1 and / or the second hash function H2 may include MD5, SHA-1, SHA-256, etc.
[0245] 5) First ciphertext and second ciphertext
[0246] It should be noted that, in order to ensure the confidentiality and security of the first information A and the second information B during unintentional transmission, this application requires the encryption of the first information and the second information.
[0247] In practical implementation, the encryption device of this application can utilize the second hash value h a Encrypt the first information A to obtain the first ciphertext A', and use the fourth hash value h b The second information B is encrypted to obtain the second ciphertext B, thereby achieving the encryption of the OT information.
[0248] In some possible implementations, the first piece of information A can be combined with the second hash value h. a The second piece of information, B, is encrypted bit by bit and can be combined with the fourth hash value h. b Encryption is performed bit by bit.
[0249] For example, if the first information A and the second hash value h a If the first information A and the second hash value h have the same length, then the first information A and the second hash value h will be used together. a The first ciphertext A is obtained by bitwise XOR:
[0250]
[0251] Similarly, if the second information B and the fourth hash value h b If the two have the same length, then the second information B and h will be... b The second ciphertext B is obtained by bitwise XOR:
[0252]
[0253] 6) Mask of the first ciphertext and mask of the second ciphertext
[0254] It should be noted that, in order to decrypt the first ciphertext A′ and the second ciphertext B′, this application also needs to introduce a mask for the first ciphertext and a mask for the second ciphertext. The mask for the first ciphertext can be used to decrypt the first ciphertext A′, and the mask for the second ciphertext can be used to decrypt the second ciphertext B′.
[0255] In some possible implementations, since the hash value used by the first ciphertext A′ is determined based on the first encrypted value sequence, the mask of the first ciphertext can be determined based on the semi-homomorphic encryption algorithm used by the first encrypted value sequence.
[0256] For example, taking the quadruple (α,β,key,p) of the ElGamal encryption system, which is a semi-homomorphic encryption algorithm used in the first encrypted value sequence, as an example, the first encrypted value sequence... Encrypted value in for:
[0257]
[0258] Therefore, the mask of the first ciphertext a for:
[0259]
[0260] In some possible implementations, since the hash value used by the second ciphertext B′ is determined based on the second encrypted value sequence, the mask of the second ciphertext can be determined based on the semi-homomorphic encryption algorithm used by the second encrypted value sequence.
[0261] For example, taking the quadruple (α,β,key,p) of the ElGamal encryption system, which is a semi-homomorphic encryption algorithm used in the second encrypted value sequence, as an example, the second encrypted value sequence... Encrypted value in for:
[0262]
[0263] Therefore, the mask of the second ciphertext b for:
[0264]
[0265] 7) The encrypted value sequence after scrambling
[0266] ① Description
[0267] It should be noted that, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of the quantum code and selecting the corresponding measurement basis, which would cause the decryption device to decrypt multiple messages at the same time and lead to OT transmission failure, this application needs to scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence.
[0268] Specifically, the sequence formed by the first encrypted value sequence and the second encrypted value sequence may include a sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence, or an encrypted value pair sequence formed by the first encrypted value sequence and the second encrypted value sequence. The following describes the two cases respectively.
[0269] ② a sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence (optional)
[0270] The sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence may be understood as a sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence, and / or a sequence obtained by concatenating the second encrypted value sequence and the first encrypted value sequence.
[0271] For example, if the first encrypted value sequence is the second encrypted value sequence is and 0≤i<L, the sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence is:
[0272] or
[0273] ③ an encrypted value pair sequence formed by the first encrypted value sequence and the second encrypted value sequence (optional)
[0274] The encrypted value pair sequence formed by the first encrypted value sequence and the second encrypted value sequence may be understood as: an encrypted value pair sequence is obtained by forming an encrypted value pair from an i-th encrypted value in the first encrypted value sequence and an i-th encrypted value in the second encrypted sequence.
[0275] For example, if the first encrypted value sequence is the second encrypted number sequence is and 0≤i<L, the encrypted value pair sequence formed by the first encrypted value sequence and the second encrypted value sequence is:
[0276] or
[0277] where may represent an encrypted value and an encrypted value the encrypted value pair formed by the encrypted value pair may represent an i-th encrypted value pair in the encrypted value pair sequence
[0278] ④ pairwise shuffling (optional)
[0279] ◆ Description
[0280] In some possible implementations, shuffling the sequence formed by the first encrypted value sequence and the second encrypted value sequence to obtain a shuffled encrypted value sequence may include:
[0281] The two encrypted values in the encrypted value pair consisting of the first encrypted value sequence and the second encrypted value sequence are scrambled pairwise to obtain the scrambled encrypted value sequence.
[0282] It should be noted that, for the encrypted value pair sequence composed of the first encrypted value sequence and the second encrypted value sequence, the encryption device of this application can shuffle the two encrypted values in each encrypted value pair of the encrypted value pair sequence pairwise. In this way, shuffling the two values pairwise facilitates obtaining the shuffled encrypted value sequence.
[0283] For example, using a sequence of encrypted value pairs as... For example, by scrambling each pair of values, the resulting scrambled encrypted value sequence is as follows:
[0284]
[0285] Among them, (x i ,y i ) can represent the scrambled encrypted value sequence {(x) i ,y i The i-th encrypted value pair in )}.
[0286] ◆Target bit sequence (optional)
[0287] In some possible implementations, the two encrypted values in the encrypted value pair consisting of the first encrypted value sequence and the second encrypted value sequence are scrambled pairwise to obtain the scrambled encrypted value sequence, which may include:
[0288] Combine the i-th encrypted value in the first encrypted value sequence with the i-th encrypted value in the second encrypted sequence to form an encrypted value pair, thus obtaining the i-th encrypted value pair in the encrypted value pair sequence;
[0289] The two encrypted values in the i-th encrypted value pair of the encrypted value pair sequence are randomly shuffled pairwise according to the bit value order in the target bit sequence to obtain the shuffled encrypted value sequence.
[0290] It should be noted that, in order to achieve the pairwise scrambling of the two encrypted values in each encrypted value pair sequence, this application introduces a target bit sequence.
[0291] The target bit sequence can be a sequence of a certain number of bits, and its length can be equal to the length of the encrypted value pair sequence. Furthermore, there is a one-to-one correspondence between the bit values in the target bit sequence and the encrypted value pairs in the encrypted value pair sequence.
[0292] In this way, the bit value in the target bit sequence can indicate whether the two encrypted values in the encrypted value pair corresponding to that bit value have been swapped.
[0293] Specifically, if a bit in the target bit sequence is 0, it indicates that the two encrypted values in the corresponding encrypted value pair should not be interchanged; if a bit in the target bit sequence is 1, it indicates that the two encrypted values in the corresponding encrypted value pair should be interchanged; and vice versa.
[0294] For example, using a sequence of encrypted value pairs as... For example, the target bit sequence is {s} i}, s i ∈{0,1}, 0≤i <L,s i correspond If s i , and (x) i ,y i The relationship between the three is as follows:
[0295]
[0296]
[0297] Then when s i When = 0, Explanation s i corresponding In and Do not swap positions; when s i When = 1, then Explanation s i corresponding In and Swap the positions. Thus, when the target bit sequence {s} i When the bit values in} are in the order of "0111…0", the scrambled encrypted value sequence is {(x i ,y i )}:
[0298]
[0299] If s i , and (x) i ,y i The relationship between the three is as follows:
[0300]
[0301]
[0302] Then when s i When = 1, Explanation si corresponding In and Do not swap positions; when s i When = 0, Explanation s i corresponding In and Swap the positions. Thus, when the target bit sequence {s} i When the bit values in} are in the order of "0111…0", the resulting encrypted value sequence {(x) is scrambled. i ,y i )}for:
[0303]
[0304] In some possible implementations, the target bit sequence can be pre-configured or randomly generated by the encryption device.
[0305] ⑤ Random order (optional)
[0306] In some possible implementations, scrambling the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence may include:
[0307] The sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence is randomly shuffled to obtain a shuffled encrypted value sequence.
[0308] It should be noted that, for the sequence formed by concatenating the first and second encrypted value sequences, this application allows for arbitrary scrambling of all encrypted values in the sequence. This arbitrary scrambling enhances the randomness of the encrypted value sorting.
[0309] For example, the sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence is... For example, by arbitrarily scrambling the order, a scrambled encrypted value sequence {z} can be obtained. i}for:
[0310]
[0311] Among them, z i Represents the scrambled encrypted value sequence {z i The i-th encrypted value in}.
[0312] 8)Light quantum sequence
[0313] ① Description
[0314] It should be noted that, since this application requires the combination of quantum communication and the two-to-one OT protocol, this application needs to use photons to encode the disordered encrypted value sequence to obtain the photon sequence.
[0315] Among them, a photon sequence can be understood as a sequence composed of photons, and these photons have diagonal polarization or horizontal and vertical polarization.
[0316] In some possible implementations, different encrypted values in the scrambled encrypted value sequence can be encoded / represented using the same number of photons, or they can be encoded / represented using different numbers of photons.
[0317] For example, using the same quantum number representation, if 0 < a i ,b i <2 l Then the sequence of encrypted values after scrambling and The 'l' can be used to encode / represent.
[0318] ② How to use photons to encode the scrambled encrypted value sequence (optional)
[0319] In some possible implementations, the disordered encrypted value sequence is encoded using photons to obtain a photon sequence, which may include:
[0320] The encryption values belonging to the first encryption value sequence in the disordered encryption value sequence are encoded using photons with horizontal and vertical polarization, and the encryption values belonging to the second encryption value sequence in the disordered encryption value sequence are encoded using photons with diagonal polarization, thus obtaining a photon sequence.
[0321] As can be seen, this application can utilize photons with different polarization directions to encode encrypted values belonging to different encrypted value sequences in a disordered encrypted value sequence.
[0322] Thus, when the decryption device uses a horizontal (+) measurement base to measure the photonic quantum sequence, the first encrypted value sequence measured by the decryption device is correct, while the second encrypted value sequence measured by the decryption device is random, unpredictable, or erroneous. When the decryption device uses a diagonal (×) measurement base to measure the photonic quantum sequence, the first encrypted value sequence measured by the decryption device is random, unpredictable, or erroneous, while the second encrypted value sequence measured by the decryption device is correct.
[0323] Furthermore, when the decoding device wants to obtain the first information A, the decryption device can use the measurement base corresponding to the first information A (i.e., the measurement base in the horizontal and vertical directions (+)) to perform the measurement. When the decoding device wants to obtain the second information B, the decryption device can use the measurement base corresponding to the second information B (i.e., the measurement base in the diagonal (×) direction) to perform the measurement.
[0324] For example, the scrambled encrypted value sequence {(x i ,y i For example, if s i =0, then When using l photons with horizontal and vertical polarization to generate random numbers Encoding is performed, and random numbers are generated using l photons with diagonal polarization. During encoding, the photon sequence The i-th segment in for:
[0325]
[0326]
[0327] If s i =1, then When using l photons with horizontal and vertical polarization to generate random numbers Encoding is performed, and random numbers are generated using l photons with diagonal polarization. During encoding, the photon sequence The i-th segment in for:
[0328]
[0329]
[0330] It can be seen that the photon sequence The length is 2*L*l.
[0331] For example, the scrambled encrypted value sequence {z} i For example, when using l photons with horizontal and vertical polarization to generate random numbers... Encoding is performed, and random numbers are generated using l photons with diagonal polarization. During encoding, the photon sequence The i-th segment in for:
[0332]
[0333]
[0334] It can be seen that the photon sequence The length is 2*L*l.
[0335] In some possible implementations, the disordered encrypted value sequence is encoded using photons to obtain a photon sequence, which may include:
[0336] The encrypted values belonging to the first encrypted value sequence in the disordered encrypted value sequence are encoded using photons with diagonal polarization, and the encrypted values belonging to the second encrypted value sequence in the disordered encrypted value sequence are encoded using photons with horizontal and vertical polarization, thus obtaining a photon sequence.
[0337] As can be seen, this application can utilize photons with different polarization directions to encode encrypted values belonging to different encrypted value sequences in a disordered encrypted value sequence.
[0338] Thus, when the decryption device uses a horizontal (+) measurement base to measure the quantum sequence, the second encrypted value sequence measured by the decryption device is correct, while the first encrypted value sequence measured by the decryption device is random, unpredictable, or erroneous. When the decryption device uses a diagonal (×) measurement base to measure the quantum sequence, the second encrypted value sequence measured by the decryption device is also random, unpredictable, or erroneous, while the first encrypted value sequence measured by the decryption device is correct.
[0339] Furthermore, when the decoding device wants to obtain the first information A, the decryption device can use the measurement base corresponding to the first information A (i.e., the diagonal (×) measurement base) to perform the measurement. When the decoding device wants to obtain the second information B, the decryption device can use the measurement base corresponding to the second information B (i.e., the horizontal and vertical (+) measurement base) to perform the measurement.
[0340] 9) Random number sequence after scrambling
[0341] ① Description
[0342] It should be noted that, since the photonic quantum sequence is scrambled before photonic quantum encoding, and the photonic quantum sequence needs to be decrypted by measuring the measurement basis to obtain the decryption product result, in order to calculate the correct decryption random number from the decryption product result, this application needs to scramble the sequence composed of the first random number sequence and the second random number sequence in the same order of the scrambled positions in the scrambled encrypted value sequence to obtain the scrambled random number sequence.
[0343] In this way, this application can use the scrambled random number sequence to calculate the decryption random number sequence. When the decryption random number sequence is correctly decrypted, the decryption random number sequence is either the first encrypted value sequence or the second encrypted value sequence.
[0344] That is to say, the random numbers in the decryption random number sequence are used for decryption, but these random numbers are also semi-homomorphically encrypted.
[0345] Specifically, the sequence composed of the first random number sequence and the second random number sequence may include a sequence obtained by concatenating the first random number sequence and the second random number sequence, and / or a random number pair sequence composed of the first random number sequence and the second random number sequence. The following descriptions are made respectively.
[0346] ② A sequence obtained by concatenating the first random number sequence and the second random number sequence (optional)
[0347] The sequence obtained by concatenating the first random number sequence and the second random number sequence may be understood as a sequence obtained by concatenating the second random number sequence after the first random number sequence, or a sequence obtained by concatenating the first random number sequence after the second random number sequence.
[0348] For example, taking the first random number sequence {a i}, the second random number sequence {b i}, and 0≤i<L as an example, a sequence obtained by concatenating the first random number sequence {a i} and the second random number sequence {b i} is:
[0349] a0, a1, ..., a L-1 , b0, b1, ..., b L-1 or b0, b1, ..., b L-1 , a0, a1, ..., a L-1 .
[0350] ③ A random number pair sequence composed of the first random number sequence and the second random number sequence (optional)
[0351] The random number pair sequence composed of the first random number sequence and the second random number sequence may be understood as sequentially forming a random number pair by using the i-th random number in the first random number sequence and the i-th random number in the second random number sequence, to obtain the random number pair sequence.
[0352] For example, taking the first random number sequence {a i}, the second random number sequence {b i}, and 0≤i<L as an example, a random number pair sequence composed of the first random number sequence {a i} and the second random number sequence {b i} is:
[0353] {(a i , b i )} = (a0, b0), (a1, b1), ..., (a L-1 , bL-1 ) or {(a i ,b i )}=(b0,a0),(b1,a1),…,(b L-1 ,a L-1 );
[0354] Among them, (a i ,b i ) can represent a random number a i With encrypted value b i The resulting random number pairs can represent a sequence of random number pairs {(a i ,b i The i-th random number pair in )}.
[0355] Based on the above section "7) The Sequence of Encrypted Values After Scrambling," we know that if the sequence of encrypted values after scrambling is generated by scrambling each pair of values in a random order, then the sequence of random numbers after scrambling is also generated by scrambling each pair of values in a random order. If the sequence of encrypted values after scrambling is generated by arbitrarily scrambling, then the sequence of random numbers after scrambling is also generated by arbitrarily scrambling. These will be explained in detail below.
[0356] ④ Randomize pairs of items (optional)
[0357] It should be noted that when the scrambled encrypted value sequence is generated by scrambling each pair of random numbers, since the scrambled random number sequence needs to have the same scrambled position order as the scrambled encrypted value sequence, this application requires scrambling each pair of random numbers in the random number pair sequence.
[0358] For example, if the scrambled encrypted value sequence {(x i ,y i )}for:
[0359]
[0360] Then when the sequence of random number pairs is {(a i ,b i )}=(a0,b0),(a1,b1),…,(a L-1 ,b L-1 When ), the disordered random number sequence {(m) i ,n i )}for:
[0361] {(m i ,n i )}=(a0,b0),(b1,a1),(b2,a2),(b3,a3),…,(a L-1 ,a L-1 ).
[0362] ⑤ Random order (optional)
[0363] It should be noted that when the scrambled encrypted value sequence is generated in an arbitrary scrambled order, since the scrambled random number sequence needs to have the same scrambled position order as the scrambled encrypted value sequence, this application requires that all random numbers in the sequence concatenated from the first random number sequence and the second random number sequence be arbitrarily scrambled.
[0364] For example, if the scrambled encrypted value sequence {z} i}for:
[0365]
[0366] Then the sequence obtained by concatenating the first random number sequence and the second random number sequence is a0, a1, ..., a L-1 ,b0,b1,…,b L-1 At that time, the disordered random number sequence {m i}for:
[0367] {m i}=a0,b0,a L-1 ,a1,b L-1 ,…,b1,0≤i<2L.
[0368] 10) Measure the product result and decrypt the product result
[0369] It should be noted that, in order to find the hash value required to correctly decrypt the first ciphertext A′ or the second ciphertext B′, the decryption device of this application can use a measurement basis to measure the photonic quantum sequence to obtain the measurement product result, and then use the mask of the first ciphertext or the mask of the second ciphertext to decrypt the measurement product result to obtain the decrypted product result.
[0370] The measurement product can be understood as the overall product of the measurement results of each segment in the photonic quantum sequence.
[0371] The decryption product result can be understood as the overall product of the decryption results of each segment in the photonic quantum sequence, or the overall decryption result of the measurement product result.
[0372] In some possible implementations, the photonic quantum sequence is measured using a measurement basis to obtain a measurement product, and then the measurement product is decrypted using a mask of either the first or second ciphertext to obtain a decrypted product. This can include:
[0373] If the decryption device wants to obtain the first information, it uses the measurement basis corresponding to the first information to measure each segment in the photonic quantum sequence and obtains the measurement result of each segment.
[0374] If the decryption device wants to obtain the second information, it uses the measurement basis corresponding to the second information to measure each segment in the photonic quantum sequence and obtains the measurement result of each segment.
[0375] The measurement results of each segment are multiplied sequentially to obtain the measurement product result;
[0376] The measured product result is decrypted using either the mask of the first ciphertext or the mask of the second ciphertext to obtain the decrypted product result.
[0377] It should be noted that, as described in section "8) Photonic Quantum Sequence" above, the encryption device of this application selects a measurement basis (such as a horizontal or vertical measurement basis) corresponding to the first information (for encoding) and a measurement basis (such as a diagonal measurement basis) corresponding to the second information (for encoding) during the encryption process. Thus, when the decryption device wants to obtain the first information A, it can use the measurement basis corresponding to the first information for measurement. When the decryption device wants to obtain the second information B, it can use the measurement basis corresponding to the second information for measurement.
[0378] Secondly, because encryption devices can choose a measurement basis (either a horizontal / vertical basis or a diagonal basis) to measure each segment of the photonic quantum sequence, half of the resulting measurement-decryption product is correct, while the other half is random, unpredictable, or erroneous. However, the decryption device cannot distinguish which measurement results are correct and which are random, unpredictable, or erroneous. In other words, half of the measurement results are semi-homomorphically encrypted ciphertext, and the other half are random and unpredictable results.
[0379] Finally, since the ciphertext obtained by encrypting the first and second random number sequences uses semi-homomorphic encryption, and semi-homomorphic ciphertext can be multiplied (i.e., multiplicative homomorphic property), their product is still semi-homomorphic ciphertext. Therefore, the decryption device can use a mask to decrypt the product of the plaintext of the random numbers selected by the encryption device (i.e., the random numbers in the first and second random number sequences) (and the product of all random and unpredictable results).
[0380] In other words, the measurement product result is the product of the measurement results, while the decryption product result is the product of the decryption results (i.e., random numbers).
[0381] The following uses the photon sequence as an example. and Let's take an example to illustrate this.
[0382] Example 1:
[0383] Using photon sequences as For example, if the encryption device uses l photons with horizontal and vertical polarization to generate random numbers... Encoding is performed, and random numbers are generated using l photons with diagonal polarization. Encoding is performed, and when the decryption device wants to obtain the first information A, the decryption device uses a horizontal and vertical measurement basis pair of photonic quantum sequences. Measurements are performed. Among them, the i-th segment... The measurement result is (x i ′,y i When the measurement is successful, the measurement result is... The following conditions can be met:
[0384] (x i ′==x i )≠(y i ′==y i ).
[0385] because It must contain It is encoded using light quantum mechanics with horizontal and vertical polarization, and the decryption device uses a horizontal and vertical measurement base for decryption; therefore, the accurate measurement result must be... Right now Let another random, unpredictable, or erroneous measurement result be r. i ,Right now Because it is represented by l bits, the measurement result r i Also satisfies r i <2 l .
[0386] Secondly, the measurement results of each segment are multiplied sequentially to obtain the measurement product result C:
[0387]
[0388] Finally, using the mask of the first ciphertext. a Decrypting the measured product result C yields the decrypted product result D:
[0389]
[0390] Because r i <2 l a i <2 l , making
[0391]
[0392] So,
[0393]
[0394] Example 2:
[0395] Using photon sequences as For example, if the encryption device uses l photons with horizontal and vertical polarization to generate random numbers... Encoding is performed, and random numbers are generated using l photons with diagonal polarization. Encoding is performed so that when the decryption device wants to obtain the second information B, the decryption device can use a diagonal measurement basis pair of optical quantum sequences. Measurements are performed. Among them, the i-th segment... The measurement result is z i When the measurement is successful, the measurement result z i It can satisfy the following:
[0396] z i ′==x i .
[0397] because It uses light quantum codes with diagonal polarization, and the decryption device uses a diagonal measurement basis for measurement; therefore, the accurate measurement result must be... Let another random, unpredictable, or erroneous measurement result be q. i , and q i <2 l Therefore, the following exists:
[0398] Or z i '==q i .
[0399] Secondly, the measurement results of each segment are multiplied sequentially to obtain the measurement product result C′:
[0400]
[0401] Finally, using the mask of the second ciphertext. b Decrypting the measured product result C′ yields the decrypted product result D′:
[0402]
[0403] Because q i <2 l b i <2 l , making
[0404]
[0405] So,
[0406]
[0407] 11) Decrypting the random number sequence
[0408] ① Description
[0409] It should be noted that, in order to find the hash value required to correctly decrypt the first or second ciphertext, the decryption device of this application can use a scrambled random number sequence to perform an integer division calculation on the decryption product result to obtain a decryption random number sequence. The hash value required to decrypt the first or second ciphertext is then determined based on this decryption random number sequence. The random numbers in the decryption random number sequence are used for decryption, but these random numbers are also semi-homomorphically encrypted.
[0410] In other words, the decryption device can use the property of divisibility to determine whether the random numbers in the disordered random number sequence are factors of the decrypted product result.
[0411] Thus, when the decrypted random number sequence is correctly decrypted, the decrypted random number sequence will be either the first encrypted value sequence or the second encrypted value sequence.
[0412] Since the decryption random number sequence can be generated in a pairwise random order or in an arbitrary random order, this application will explain them separately below.
[0413] ② The decryption random number sequence obtained by pairwise randomization (optional)
[0414] In some possible implementations, the decrypted product result is divided by a random number sequence after being scrambled to obtain a decrypted random number sequence, which may include:
[0415] The modulo value is obtained by performing a modulo operation on the product of the two random numbers in the i-th random number pair of the scrambled random number sequence and the decrypted product result.
[0416] The modulus is used to select one of the measurement results of the two segments in the i-th segment pair of the photonic quantum sequence as a random number in the decryption random number sequence.
[0417] The process of selecting a random number from the measurement results of the two segments in the i-th segment pair of the photonic quantum sequence using the modulus value as a random number in the decryption random number sequence can include:
[0418] If the modulus is equal to 0, then the measurement result corresponding to the modulus in the measurement results of the two segments will be used as a random number in the decryption random number sequence;
[0419] If the modulus is not equal to 0, the measurement result corresponding to that modulus in the measurement results of the two segments will not be used as a random number in the decryption random number sequence.
[0420] It should be noted that the decryption device of this application can perform a modulo operation on the product of the two random numbers in the i-th random number pair of the disordered random number sequence and the decryption result to obtain two modulo values. Then, based on whether the two modulo values are equal to 0 (i.e. whether they are divisible), one of the two segments in the i-th segment pair of the photonic quantum sequence can be selected.
[0421] As can be seen, the decryption device of this application can perform integer division calculations by checking whether the modulus value obtained by the modulo operation is equal to 0.
[0422] For example, the randomized sequence of numbers after being shuffled in "Example 1" above is {(m i ,n i )}, light quantum sequence The i-th segment in The measurement result is (x i ′,y i Taking the product as an example, and decrypting it to the value of D, the decryption device first uses the i-th random number pair (m'). i ,n i The random number m in ) i and random number n i Perform modulo operations on the decrypted product result D to obtain the modulus value Dmodm. i and Dmodn i .
[0423] Then, using the modulus Dmodm i and Dmodn i From the measurement results (x) i ′,y i Choose one from the given list as the decryption random number w. i Among them, w i The following conditions must be met:
[0424]
[0425] Because the decryption device uses horizontal and vertical measuring bases for decryption, and It is encoded using light quantum mechanics with polarization in both horizontal and vertical directions, therefore when m i =a i And n i =b i At that time, under correct decryption, it exists y i ′=r i ,Dmodm i =Dmoda i =0, Dmodn i =Dmodr i ≠0. When m i=b i And n i =a i At that time, x exists under correct decryption. i ′=r i , Dmodn i =Dmoda i =0, Dmodm i =Dmodr i ≠0. Thus, from (x i ′,y i Choose one from ′), that is The final decrypted random number sequence {w i} is the first encrypted value sequence
[0426] ③ A sequence of random numbers obtained from arbitrary randomization (optional)
[0427] In some possible implementations, the decrypted product result is divided by a random number sequence after being scrambled to obtain a decrypted random number sequence, which may include:
[0428] The modulo value is obtained by performing a modulo operation on the i-th random number of the scrambled random number sequence and the decrypted product result.
[0429] The modulus is used to determine the measurement result of the i-th segment of the photonic quantum sequence as a random number in the decryption random number sequence.
[0430] The method of using the modulus to determine the measurement result of the i-th segment of the photonic quantum sequence as a random number in the decryption random number sequence can include:
[0431] If the modulus is equal to 0, then the measurement result corresponding to the modulus is used as a random number in the decryption random number sequence;
[0432] If the modulus is not equal to 0, the measurement result corresponding to the modulus will not be used as a random number in the decryption random number sequence.
[0433] It should be noted that this application can perform a modulo operation on the i-th random number of the disordered random number sequence and the decryption product result to obtain the modulus value, and then determine the decryption random number sequence from the measurement result of the i-th segment of the photon sequence based on whether the modulus value is equal to 0.
[0434] For example, take the scrambled random number sequence in "Example 2" above as {m i}, light quantum sequence The measurement result of the i-th segment is z. i Taking the product as an example, and decrypting the product as D′, the decryption device first uses the i-th random number m.i Perform a modulo operation on the decrypted product result D′ to obtain the modulus D′modm. i .
[0435] Then, using the modulus D′modm i Determine whether to include the measurement result z i ′ as the decryption random number w i Among them, w i The following conditions must be met:
[0436] w i =z i ′,D′modm i =0.
[0437] Because the decryption device uses a diagonal angle measurement base for decryption, and It is encoded using light quantum particles with diagonal polarization, therefore when m i =b i At that time, under correct decryption, it exists D′modm i =D′modb i =0. When m i =a i At that time, under correct decryption, it exists D′modm i =D′moda i ≠0. Thus, The final decrypted random number sequence {w i} is the second encrypted value sequence
[0438] 12) Verify whether the decrypted random number sequence is decoded correctly.
[0439] ① Description
[0440] It should be noted that, in order to find the hash value required to correctly decrypt the first or second ciphertext, this application first needs to verify whether the decryption random number sequence is correctly decoded. To do this, this application can first encode the decryption random number sequence into binary to obtain the target binary sequence, then calculate the hash value corresponding to the target binary sequence to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value is equal to the first hash value, it means the verification is successful and the decryption random number sequence is correctly decrypted; if the first target hash value is not equal to the first hash value, it means the verification fails and the decryption random number sequence is incorrectly decrypted.
[0441] ②Target binary sequence
[0442] It should be noted that in order to obtain the hash value required for decrypting the first and second ciphertexts, this application needs to encode the target binary sequence into binary sequences respectively.
[0443] The target binary sequence can be understood as a sequence of binary strings obtained by binary encoding the random numbers in the decrypted random number sequence.
[0444] In some possible implementations, the binary strings encoded by different random numbers can be of the same length or different lengths. However, the length of the binary string needs to ensure that there is enough space for the encrypted value.
[0445] The binary strings encoded by different random numbers have the same length, which can be understood as different random numbers being encoded / represented using the same number of bits.
[0446] The length of the binary string encoded by different random numbers is different. This can be understood as different random numbers being encoded / represented using different numbers of bits.
[0447] For example, taking binary strings of length l as an example, for decrypting a random number sequence {w} i} will decrypt the i-th random number w in the random number sequence. i Encoded as an l-bit binary string w i Il, then concatenate the binary strings of each random number in sequence to obtain the target binary sequence:
[0448] w0| l w1| l …| l w L-1 | l .
[0449] ③ First target hash value
[0450] It should be noted that the decryption device can use the first hash function H1 to calculate the hash value of the target binary sequence, obtain the first target hash value, and use the first hash value to verify the first target hash value.
[0451] If the first target hash value is equal to the first hash value, the verification is successful and the decrypted random number sequence is correctly decrypted; if the first target hash value is not equal to the first hash value, the verification fails and the decrypted random number sequence is not correctly decrypted.
[0452] For example, the first target hash value h w for:
[0453] h w =H1(w0| l w1|l …| l w L-1 | l )).
[0454] ④ Second target hash value
[0455] It should be noted that, if the verification is successful, the decryption device can use the second hash function H2 to calculate the hash value of the target binary sequence and obtain the second target hash value.
[0456] For example, the second target hash value h w′ for:
[0457] h w′ =H2(w0| l w1| l …| l w L-1 | l )).
[0458] Thus, the second target hash value is the hash value used when encrypting the first information A or the second information B. The second target hash value is then used to decrypt one item from the first information A or the second information B to obtain the information that the decryption device wants to know.
[0459] Additionally, if the decrypted random number sequence is correctly decrypted, and the decrypted random number sequence is the first encrypted value sequence... The decryption device can then use the second target hash value h w′ Decrypting the first ciphertext A′ and the second ciphertext B′ yields the first information A, but not the second information B.
[0460] If the decrypted random number sequence is correct, and the decrypted random number sequence is the second encrypted value sequence. The decryption device can then use the second target hash value h w′ Decrypting the first ciphertext A′ and the second ciphertext B′ yields the second information B, but it does not yield the first information A.
[0461] For example, if the encryption device combines the first information A and the second hash value h... a The first ciphertext A is obtained by bitwise XORing 'A'. The decryption device then uses the second target hash value h w′ Deciphering the first piece of information A:
[0462]
[0463] III. Exemplary Description of an Inadvertent Transmission Device Based on Optical Quantum
[0464] 1. Description
[0465] The above mainly describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the encryption device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should recognize that the methods, functions, modules, units, or steps described in conjunction with the embodiments provided herein can be implemented in hardware or a combination of hardware and computer software. Whether a method, function, module, unit, or step is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described methods, functions, modules, units, or steps for each specific application, but such implementation should not be considered beyond the scope of this application.
[0466] This application embodiment can divide the encryption device into functional units / modules according to the above method example. For example, each function can be divided into a separate functional unit / module, or two or more functions can be integrated into one functional unit / module. The integrated functional unit / module can be implemented in hardware or software. It should be noted that the division of functional units / modules in this application embodiment is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods.
[0467] When using integrated units, Figure 3 This is a functional unit block diagram of a quantum-based inadvertent transmission device according to an embodiment of this application. The quantum-based inadvertent transmission device 300 specifically includes: an encryption unit 310, an encoding unit 320, a calculation unit 330, a reordering unit 340, and a transmission unit 350.
[0468] It should be noted that the encryption unit 310 can be a module unit used for encrypting information / data, etc., and there are no specific restrictions on it.
[0469] The encoding unit 320 can be a module unit used to encode information / data, etc., and there are no specific restrictions on it.
[0470] The computing unit 330 can be a modular unit used for computing information / data, etc., without any specific limitations.
[0471] The out-of-order unit 340 can be a module unit for out-of-order information / data, etc., and there are no specific restrictions on it.
[0472] The transmitting unit 350 can be a module unit used for transmitting information / data, etc., and there are no specific restrictions on it.
[0473] In some possible implementations, the encryption unit 310, encoding unit 320, calculation unit 330, disordering unit 340 and sending unit 350 can be integrated into one unit or integrated into different units respectively.
[0474] For example, the encryption unit 310, the encoding unit 320, the calculation unit 330, the disordering unit 340, and the sending unit 350 can be integrated into the processing unit.
[0475] For example, the sending unit 350 can be integrated into the communication unit, and the encryption unit 310, encoding unit 320, calculation unit 330 and out-of-order unit 340 can be integrated into the processing unit.
[0476] It should be noted that the processing unit can be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processing unit can also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0477] In some possible implementations, the quantum-based inadvertent transmission device 300 may also include a storage unit for storing computer programs or instructions executed by the quantum-based inadvertent transmission device 300.
[0478] For example, the storage unit could be a memory.
[0479] In some possible implementations, the quantum-based inadvertent transmission device 300 can be a chip / chip module / processor / hardware, etc.
[0480] In specific implementation, the quantum-based inadvertent transmission device 300 is used to perform the steps described in the above method embodiments. A detailed explanation follows.
[0481] The encryption unit 310 is used to perform semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain the first encrypted value sequence and the second encrypted value sequence.
[0482] Encoding unit 320 is used to perform binary encoding on the first encrypted value sequence and the second encrypted value sequence respectively to obtain the first binary sequence and the second binary sequence;
[0483] The calculation unit 330 is used to calculate the hash value of the first binary sequence using the first hash function and the second hash function respectively, to obtain the first hash value and the second hash value;
[0484] The calculation unit 330 is also used to calculate the hash value of the second binary sequence using the first hash function and the second hash function respectively, to obtain the third hash value and the fourth hash value;
[0485] The encryption unit 310 is also used to encrypt the first information transmitted unintentionally using a second hash value to obtain a first ciphertext, and to encrypt the second information transmitted unintentionally using a fourth hash value to obtain a second ciphertext.
[0486] The scrambling unit 340 is used to scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence.
[0487] The encoding unit 320 is also used to encode the disordered encrypted value sequence using photons to obtain a photon sequence;
[0488] The scrambling unit 340 is also used to scramble the sequence composed of the first random number sequence and the second random number sequence in the same order according to the scrambled position order in the scrambled encrypted value sequence to obtain the scrambled random number sequence.
[0489] The sending unit 350 is used to send a first hash function and a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photonic quantum sequence, and a random number pair sequence to the decryption device.
[0490] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0491] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0492] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0493] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0494] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0495] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0496] It should be noted that the specific implementation of each operation performed by the quantum-based inadvertent transmission device 300 can be found in the corresponding description of the method embodiment shown above, and will not be repeated here.
[0497] 2. Other implementation methods
[0498] The following section will explain some of the implementation methods involved. For other content not covered, please refer to the above description for details, which will not be repeated here.
[0499] In some possible implementations, the encryption unit 310 is used to: perform semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain the first encrypted value sequence and the second encrypted value sequence.
[0500] Calculate the product of each random number in the first random number sequence and a first random integer, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the first encrypted value sequence;
[0501] Calculate the product of each random number in the second random number sequence and a second random integer, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the second encrypted value sequence.
[0502] It should be noted that, based on the content of "2) First encrypted value sequence and second encrypted value sequence" above, this will not be repeated here.
[0503] In some possible implementations, the encoding unit 320 is used to: Encode the first encrypted value sequence and the second encrypted value sequence into binary sequences to obtain the first binary sequence and the second binary sequence, respectively.
[0504] Each encrypted value in the first encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the first binary sequence.
[0505] Each encrypted value in the second encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the second binary sequence.
[0506] It should be noted that, based on the content of "3) First binary sequence and second binary sequence" above, this will not be repeated here.
[0507] In some possible implementations, the scrambling unit 340 is used to: scramble the sequence consisting of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence.
[0508] To obtain a scrambled encrypted value sequence, shuffle each pair of encrypted values in the encrypted value pair consisting of the first and second encrypted value sequences; or...
[0509] The sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence is randomly shuffled to obtain a shuffled encrypted value sequence.
[0510] It should be noted that, as can be seen from the content of "7) the scrambled encrypted value sequence" above, this will not be repeated here.
[0511] In some possible implementations, the scrambling unit 340 is used to: scramble the pairs of encrypted values in the encrypted value pair consisting of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence;
[0512] Combine the i-th encrypted value in the first encrypted value sequence with the i-th encrypted value in the second encrypted sequence to form an encrypted value pair, thus obtaining the i-th encrypted value pair in the encrypted value pair sequence;
[0513] The two encrypted values in the i-th encrypted value pair of the encrypted value pair sequence are randomly shuffled pairwise according to the bit value order in the target bit sequence to obtain the shuffled encrypted value sequence.
[0514] It should be noted that, as can be seen from the content of "7) the scrambled encrypted value sequence" above, this will not be repeated here.
[0515] In some possible implementations, in order to encode the disordered encrypted value sequence using photons to obtain a photon sequence, the encoding unit 320 is used for:
[0516] By using photons with horizontal and vertical polarization to encode the encrypted values belonging to the first encrypted value sequence in the disordered encrypted value sequence, and by using photons with diagonal polarization to encode the encrypted values belonging to the second encrypted value sequence in the disordered encrypted value sequence, a photon sequence is obtained; or,
[0517] The encrypted values belonging to the first encrypted value sequence in the disordered encrypted value sequence are encoded using photons with diagonal polarization, and the encrypted values belonging to the second encrypted value sequence in the disordered encrypted value sequence are encoded using photons with horizontal and vertical polarization, thus obtaining a photon sequence.
[0518] It should be noted that, based on the content in "8) Photon Sequence" above, this will not be repeated here.
[0519] IV. Another exemplary description of an inadvertent transmission device based on photons.
[0520] 1. Description
[0521] The above mainly describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the decryption device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should recognize that the methods, functions, modules, units, or steps described in conjunction with the embodiments provided herein can be implemented in hardware or a combination of hardware and computer software. Whether a method, function, module, unit, or step is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described methods, functions, modules, units, or steps for each specific application, but such implementation should not be considered beyond the scope of this application.
[0522] This application embodiment can divide the decryption device into functional units / modules according to the above method example. For example, each function can be divided into a separate functional unit / module, or two or more functions can be integrated into one functional unit / module. The integrated functional unit / module can be implemented in hardware or software. It should be noted that the division of functional units / modules in this application embodiment is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods.
[0523] When using integrated units, Figure 4 This is a functional unit block diagram of another inadvertent transmission device based on photons, according to an embodiment of this application. The inadvertent transmission device 400 based on photons specifically includes: a receiving unit 410, a measuring unit 420, a calculating unit 430, an encoding unit 440, and a decryption unit 450.
[0524] It should be noted that the receiving unit 410 can be a module unit used for receiving information / data, etc., and there are no specific limitations on it.
[0525] The measurement unit 420 can be a module unit for measuring information / data, etc., and there are no specific limitations on it.
[0526] The computing unit 430 can be a modular unit used for computing information / data, etc., without any specific limitations.
[0527] The encoding unit 440 can be a module unit used to encode information / data, etc., and there are no specific restrictions on it.
[0528] The decryption unit 450 can be a module unit used for decrypting information / data, etc., and there are no specific restrictions on it.
[0529] In some possible implementations, the receiving unit 410, the measuring unit 420, the calculating unit 430, the encoding unit 440, and the decrypting unit 450 can be integrated into one unit or integrated into different units respectively.
[0530] For example, the receiving unit 410, the measuring unit 420, the calculating unit 430, the encoding unit 440, and the decryption unit 450 can be integrated into the processing unit.
[0531] For example, the receiving unit 410 can be integrated into the communication unit, and the measurement unit 420, the calculation unit 430, the encoding unit 440 and the decryption unit 450 can be integrated into the processing unit.
[0532] It should be noted that the processing unit can be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processing unit can also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0533] In some possible implementations, the quantum-based inadvertent transmission device 400 may also include a storage unit for storing computer programs or instructions executed by the quantum-based inadvertent transmission device 400.
[0534] For example, the storage unit could be a memory.
[0535] In some possible implementations, the quantum-based inadvertent transmission device 400 can be a chip / chip module / processor / hardware, etc.
[0536] In specific implementation, the quantum-based inadvertent transmission device 400 is used to perform the steps described in the above method embodiments. A detailed explanation follows.
[0537] The receiving unit 410 is used to receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photonic quantum sequence, and a random number sequence after scrambling from an encryption device.
[0538] The measurement unit 420 is used to measure the photonic quantum sequence using a measurement basis to obtain the measurement product result, and then use the mask of the first ciphertext or the mask of the second ciphertext to decrypt the measurement product result to obtain the decrypted product result.
[0539] The calculation unit 430 is used to perform integer division calculation on the decrypted product result using the disordered random number sequence to obtain the decrypted random number sequence;
[0540] Encoding unit 440 is used to perform binary encoding on the decrypted random number sequence to obtain the target binary sequence;
[0541] The computing unit 430 is also used to calculate the hash value of the target binary sequence using the first hash function to obtain the first target hash value;
[0542] The calculation unit 430 is also used to verify the first target hash value using the first hash value, and when the verification is successful, to calculate the hash value of the target binary sequence using the second hash function to obtain the second target hash value;
[0543] The decryption unit 450 is used to decrypt the first ciphertext and the second ciphertext using the second target hash value, so as to decrypt one of the first information and the second information that were inadvertently transmitted.
[0544] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0545] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0546] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0547] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0548] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0549] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0550] It should be noted that the specific implementation of each operation performed by the quantum-based inadvertent transmission device 400 can be found in the corresponding description of the method embodiment shown above, and will not be repeated here.
[0551] 2. Other implementation methods
[0552] The following section will explain some of the implementation methods involved. For other content not covered, please refer to the above description for details, which will not be repeated here.
[0553] In some possible implementations, the measurement unit 420 is used to: measure the photonic quantum sequence using a measurement basis to obtain a measurement product, and then decrypt the measurement product using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product.
[0554] If the decryption device wants to obtain the first information, it uses the measurement basis corresponding to the first information to measure each segment in the photonic quantum sequence and obtains the measurement result of each segment.
[0555] If the decryption device wants to obtain the second information, it uses the measurement basis corresponding to the second information to measure each segment in the photonic quantum sequence and obtains the measurement result of each segment.
[0556] The measurement results of each segment are multiplied sequentially to obtain the measurement product result;
[0557] The measured product result is decrypted using either the mask of the first ciphertext or the mask of the second ciphertext to obtain the decrypted product result.
[0558] It should be noted that, based on the content of "10) Measuring the product result and decrypting the product result" above, there are no specific restrictions on this.
[0559] In some possible implementations, the computation unit 430 is used to perform integer division calculations on the decrypted product result using the scrambled random number sequence to obtain the decrypted random number sequence:
[0560] The modulo value is obtained by performing a modulo operation on the product of the two random numbers in the i-th random number pair of the scrambled random number sequence and the decrypted product result.
[0561] The modulus is used to select one of the measurement results of the two segments in the i-th segment pair of the photonic quantum sequence as a random number in the decryption random number sequence.
[0562] It should be noted that, based on the content in "11) Decrypting the random number sequence" above, there are no specific restrictions on this.
[0563] In some possible implementations, the computation unit 430 is used to perform integer division calculations on the decrypted product result using the scrambled random number sequence to obtain the decrypted random number sequence:
[0564] The modulo value is obtained by performing a modulo operation on the i-th random number of the scrambled random number sequence and the decrypted product result.
[0565] The modulus is used to determine the measurement result of the i-th segment of the photonic quantum sequence as a random number in the decryption random number sequence.
[0566] It should be noted that, based on the content in "11) Decrypting the random number sequence" above, there are no specific restrictions on this.
[0567] V. Exemplary Description of an Encryption Device
[0568] The following is a schematic diagram of the structure of an encryption device according to an embodiment of this application, such as... Figure 5 As shown. The encryption device 500 includes a processor 510, a memory 520, and at least one communication bus for connecting the processor 510 and the memory 520.
[0569] In some possible implementations, processor 510 may be one or more central processing units (CPUs). If processor 510 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Memory 520 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), and memory 520 is used to store computer programs or instructions.
[0570] In some possible implementations, the encryption device 500 also includes a communication interface for receiving and sending data.
[0571] In some possible implementations, the processor 510 in the encryption device 500 is used to execute a computer program or instruction 521 stored in the memory 520 to perform the following steps:
[0572] The first random number sequence and the second random number sequence are respectively subjected to semi-homomorphic encryption to obtain the first encrypted value sequence and the second encrypted value sequence;
[0573] The first encrypted value sequence and the second encrypted value sequence are respectively binary encoded to obtain the first binary sequence and the second binary sequence;
[0574] The hash values of the first binary sequence are calculated using the first hash function and the second hash function, respectively, to obtain the first hash value and the second hash value;
[0575] The hash values of the second binary sequence are calculated using the first and second hash functions, respectively, to obtain the third and fourth hash values.
[0576] The first message transmitted unintentionally is encrypted using the second hash value to obtain the first ciphertext, and the second message transmitted unintentionally is encrypted using the fourth hash value to obtain the second ciphertext.
[0577] The sequence composed of the first encrypted value sequence and the second encrypted value sequence is scrambled to obtain the scrambled encrypted value sequence. Then, the scrambled encrypted value sequence is encoded using photons to obtain the photon sequence.
[0578] The sequence composed of the first random number sequence and the second random number sequence is scrambled in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain the scrambled random number sequence.
[0579] Send the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence to the decryption device.
[0580] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0581] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0582] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0583] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0584] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0585] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0586] It should be noted that the specific implementation of each operation performed by the encryption device 500 can be found in the corresponding description of the method embodiment shown above, and will not be repeated here.
[0587] VI. Exemplary Description of a Decryption Device
[0588] The following is a schematic diagram of the structure of a decryption device according to an embodiment of this application, such as... Figure 6 As shown. The decryption device 600 includes a processor 610, a memory 620, and at least one communication bus for connecting the processor 610 and the memory 620.
[0589] In some possible implementations, processor 610 may be one or more central processing units (CPUs). If processor 610 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Memory 620 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), and memory 620 is used to store computer programs or instructions.
[0590] In some possible implementations, the decryption device 600 also includes a communication interface for receiving and sending data.
[0591] In some possible implementations, the processor 610 in the decryption device 600 is used to execute the computer program or instructions 621 stored in the memory 620 to perform the following steps:
[0592] Receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photon sequence, and a randomized sequence of random numbers from an encryption device;
[0593] The photonic quantum sequence is measured using a measurement basis to obtain the measurement product result. Then, the measurement product result is decrypted using a mask of the first ciphertext or a mask of the second ciphertext to obtain the decrypted product result.
[0594] The decrypted product result is divided by the random number sequence after being scrambled to obtain the decrypted random number sequence.
[0595] The decrypted random number sequence is binary encoded to obtain the target binary sequence;
[0596] The hash value of the target binary sequence is calculated using the first hash function to obtain the first target hash value;
[0597] The first target hash value is verified using the first hash value, and if the verification is successful, the hash value of the target binary sequence is calculated using the second hash function to obtain the second target hash value.
[0598] The first and second ciphertexts are decrypted using the second target hash value to decrypt one of the unintentionally transmitted first or second information.
[0599] As can be seen, the encryption device of this application possesses two pieces of information that are inadvertently transmitted, namely, the first piece of information and the second piece of information, while the decryption device wants to know one of the pieces of information. To this end, this application utilizes the no-cloning property of quantum mechanics and the property that semi-homomorphic encryption can directly (without decryption) compute the ciphertext, so as to achieve inadvertent transmission through quantum and semi-homomorphic encryption.
[0600] First, to ensure the confidentiality and security of the first and second information during unintentional transmission, this application requires encryption of both information. To obtain the hash values needed for encryption, this application introduces a first random number sequence, a second random number sequence, a first hash function, and a second hash function. Specifically, the first and second random number sequences are first encrypted and binary encoded sequentially. Then, the first and second hash functions are used to calculate a first hash value (used for verification during decryption), a second hash value (used for encryption of the first information), a third hash value (used for verification during decryption), and a fourth hash value (used for encryption of the second information). Finally, the second hash value is used to encrypt the first information to obtain the first ciphertext, and the fourth hash value is used to encrypt the second information to obtain the second ciphertext.
[0601] Secondly, since this application needs to combine quantum communication with the two-to-one OT protocol, in order to prevent the decryption device from guessing the order of quantum encoding to select the corresponding measurement basis, causing the decryption device to decrypt multiple messages at the same time and resulting in OT transmission failure, this application needs to first scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence, and then perform optical quantum encoding on each of the scrambled encrypted values to obtain an optical quantum sequence.
[0602] Furthermore, since the photonic quantum sequence is scrambled before photonic encoding, and the photonic quantum sequence needs to be decrypted by measuring the basis to obtain the decrypted product, in order to calculate the correct decrypted random number from the decrypted product, this application needs to scramble the sequence composed of the first and second random number sequences in the same order as the scrambled positions in the scrambled encrypted value sequence to obtain a scrambled random number sequence. In this way, this application can use the scrambled random number sequence to calculate the decrypted random number sequence. When the decrypted random number sequence is correctly decrypted, the decrypted random number sequence is either the first or the second encrypted value sequence.
[0603] Finally, to find the hash value required to correctly decrypt the first or second ciphertext, this application needs to verify whether the decryption random number sequence has been correctly decoded. To do this, this application can first encode the decryption random number sequence into binary, then calculate its corresponding hash value to obtain the first target hash value, and finally use the first hash value to verify the first target hash value. If the first target hash value equals the first hash value, it means the verification was successful and the decryption random number sequence was correctly decrypted; if the first target hash value does not equal the first hash value, it means the verification failed and the decryption random number sequence was not correctly decrypted.
[0604] Thus, if the verification is successful, this application can use the second hash function to calculate the hash value of the target binary sequence, obtaining the second target hash value. At this point, the second target hash value is the hash value used when encrypting the first or second information, and thus the second target hash value can be used to decrypt one item from the first or second information to obtain the information that the decryption device wants to know.
[0605] It should be noted that the specific implementation of each operation performed by the decryption device 600 can be found in the corresponding description of the method embodiment shown above, and will not be repeated here.
[0606] VII. Other Exemplary Descriptions
[0607] This application also provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processor, implement the steps described in the above embodiments.
[0608] This application also provides a computer program product, including a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the steps described in the above embodiments. For example, the computer program product may be a software installation package.
[0609] In addition, computer program products should be understood as software products that primarily implement the technical solutions of this application through computer programs or instructions.
[0610] It should be noted that, for the sake of simplicity, the above embodiments are all described as a series of actions. Those skilled in the art should understand that this application is not limited to the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.
[0611] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0612] Those skilled in the art should understand that the functions of the methods, steps, or related modules / units described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product, or by a processor executing computer program instructions. The computer program product includes at least one computer program instruction, which can be composed of corresponding software modules. These software modules can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, portable hard disk, read-only optical disc (CD-ROM), or any other form of storage medium well known in the art. The computer program instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer program instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media, or semiconductor media (e.g., SSDs).
[0613] The modules / units included in the various devices or products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of software modules / units and hardware modules / units. For example, for devices or products where the application is applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits; or, some of their modules / units can be implemented using software programs that run on a processor integrated within the chip, while other (if any) modules / units can be implemented using hardware methods such as circuits. The same principle applies to devices or products where the application is applied to or integrated into a chip module, or devices or products where the application is applied to or integrated into a terminal.
[0614] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific implementations of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made based on the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A method for unintentional transmission based on photons, characterized in that, Applied to encryption devices, including: The first random number sequence and the second random number sequence are respectively subjected to semi-homomorphic encryption to obtain the first encrypted value sequence and the second encrypted value sequence; The first encrypted value sequence and the second encrypted value sequence are respectively binary encoded to obtain a first binary sequence and a second binary sequence; The hash values of the first binary sequence are calculated using the first hash function and the second hash function, respectively, to obtain the first hash value and the second hash value; The hash values of the second binary sequence are calculated using the first hash function and the second hash function, respectively, to obtain the third hash value and the fourth hash value; The first information transmitted unintentionally is encrypted using the second hash value to obtain the first ciphertext, and the second information transmitted unintentionally is encrypted using the fourth hash value to obtain the second ciphertext. The sequence composed of the first encrypted value sequence and the second encrypted value sequence is scrambled to obtain a scrambled encrypted value sequence, and then the scrambled encrypted value sequence is encoded using photons to obtain a photon sequence. The sequence formed by the first random number sequence and the second random number sequence is scrambled in the same order according to the scrambled position in the scrambled encrypted value sequence to obtain the scrambled random number sequence. The decryption device is sent the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence. The mask of the first ciphertext is determined according to the semi-homomorphic encryption algorithm used for the first encrypted value sequence, and the mask of the second ciphertext is determined according to the semi-homomorphic encryption algorithm used for the second encrypted value sequence.
2. The method according to claim 1, characterized in that, The step of performing semi-homomorphic encryption on the first random number sequence and the second random number sequence to obtain the first encrypted value sequence and the second encrypted value sequence includes: Calculate the product of each random number in the first random number sequence and a first random integer, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the first encrypted value sequence; Calculate the product of each random number in the second random number sequence and a second random integer, and then perform multiplicative semi-homomorphic encryption on the resulting random numbers to obtain the second encrypted value sequence.
3. The method according to claim 1, characterized in that, The step of binary encoding the first encrypted value sequence and the second encrypted value sequence to obtain a first binary sequence and a second binary sequence includes: Each encrypted value in the first encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the first binary sequence. Each encrypted value in the second encrypted value sequence is encoded into a binary string and then concatenated sequentially to obtain the second binary sequence.
4. The method according to claim 1, characterized in that, The step of scrambling the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence includes: The two encrypted values in the encrypted value pair formed by the first encrypted value sequence and the second encrypted value sequence are scrambled pairwise to obtain a scrambled encrypted value sequence; or, The sequence obtained by concatenating the first encrypted value sequence and the second encrypted value sequence is randomly shuffled to obtain a shuffled encrypted value sequence.
5. The method according to claim 4, characterized in that, The step of scrambling the pairs of encrypted values in the encrypted value pair formed by the first encrypted value sequence and the second encrypted value sequence to obtain the scrambled encrypted value sequence includes: The first encrypted value sequence contains the first... i The encrypted value and the first encrypted value sequence in the second encrypted value sequence i The encrypted values are combined to form an encrypted value pair, resulting in the first encrypted value pair sequence. i A pair of encrypted values, i It is an integer; The encrypted value pair sequence is processed sequentially according to the bit value order in the target bit sequence. i The two encrypted values in a pair of encrypted values are randomly ordered to obtain a randomized sequence of encrypted values.
6. The method according to claim 1, characterized in that, The process of encoding the disordered encrypted value sequence using photons to obtain a photon sequence includes: Encoding the encrypted values belonging to the first encrypted value sequence in the disordered encrypted value sequence using photons with horizontal and vertical polarization, and encoding the encrypted values belonging to the second encrypted value sequence in the disordered encrypted value sequence using photons with diagonal polarization, to obtain a photon sequence; or, Encode the encrypted values belonging to the first encrypted value sequence in the disordered encrypted value sequence using photons with diagonal polarization, and encode the encrypted values belonging to the second encrypted value sequence in the disordered encrypted value sequence using photons with horizontal and vertical polarization, to obtain a photon sequence.
7. A method for unintentional transmission based on photons, characterized in that, Applied to decryption devices, including: Receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photon sequence, and a randomized sequence of random numbers from an encryption device; The photonic quantum sequence is measured using a measurement basis to obtain a measurement product result, and then the measurement product result is decrypted using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product result. The decryption product result is divided by the disordered random number sequence to obtain the decryption random number sequence; The decrypted random number sequence is binary encoded to obtain the target binary sequence; The hash value of the target binary sequence is calculated using the first hash function to obtain the first target hash value; The first target hash value is verified using the first hash value, and if the verification is successful, the hash value of the target binary sequence is calculated using the second hash function to obtain the second target hash value; The first ciphertext and the second ciphertext are decrypted using the second target hash value to decrypt one of the first and second messages that were inadvertently transmitted.
8. The method according to claim 7, characterized in that, The process of measuring the photonic quantum sequence using a measurement basis to obtain a measurement product, and then decrypting the measurement product using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product, includes: If the decryption device wants to obtain the first information, it uses the measurement basis corresponding to the first information to measure each segment in the photonic quantum sequence and obtains the measurement result of each segment. If the decryption device wants to obtain the second information, it uses the measurement basis corresponding to the second information to measure each segment in the photonic quantum sequence to obtain the measurement result of each segment; The measurement results of each segment are multiplied sequentially to obtain the measurement product result; The measurement product result is decrypted using the mask of the first ciphertext or the mask of the second ciphertext to obtain the decrypted product result.
9. The method according to claim 7, characterized in that, The step of dividing the decryption product result by the disordered random number sequence to obtain the decryption random number sequence includes: Using the first random number sequence after scrambling i The modulo operation is performed between the two random numbers in the random number pair and the decryption product result to obtain the modulo value; Using the modulus value from the first of the photon sequences i One of the two segments in a segment pair is selected as a random number in the decryption random number sequence.
10. The method according to claim 7, characterized in that, The step of dividing the decryption product result by the disordered random number sequence to obtain the decryption random number sequence includes: Using the first random number sequence after scrambling i The modulo value is obtained by multiplying a random number with the decryption result and performing a modulo operation. Using the modulus value, the first photon sequence is determined. i The measurement results of each segment are used as a random number in the decryption random number sequence.
11. A device for inadvertent transmission based on photons, characterized in that, Applied to encryption devices; the device includes: An encryption unit is used to perform semi-homomorphic encryption on the first random number sequence and the second random number sequence respectively to obtain a first encrypted value sequence and a second encrypted value sequence; An encoding unit is used to perform binary encoding on the first encrypted value sequence and the second encrypted value sequence respectively to obtain a first binary sequence and a second binary sequence; The calculation unit is used to calculate the hash value of the first binary sequence using a first hash function and a second hash function respectively, to obtain the first hash value and the second hash value; The calculation unit is further configured to calculate the hash value of the second binary sequence using the first hash function and the second hash function respectively, to obtain the third hash value and the fourth hash value; The encryption unit is further configured to encrypt the first information transmitted unintentionally using the second hash value to obtain the first ciphertext, and to encrypt the second information transmitted unintentionally using the fourth hash value to obtain the second ciphertext. The scrambling unit is used to scramble the sequence composed of the first encrypted value sequence and the second encrypted value sequence to obtain a scrambled encrypted value sequence. The encoding unit is used to encode the disordered encrypted value sequence using photons to obtain a photon sequence; The scrambling unit is further configured to scramble the sequence composed of the first random number sequence and the second random number sequence in the same order according to the scrambled position in the scrambled encrypted value sequence to obtain the scrambled random number sequence. The sending unit is configured to send the first hash function, the second hash function, the first hash value, the third hash value, the first ciphertext, the second ciphertext, the mask of the first ciphertext, the mask of the second ciphertext, the photon sequence, and the disordered random number sequence to the decryption device. The mask of the first ciphertext is determined according to the semi-homomorphic encryption algorithm used for the first encrypted value sequence, and the mask of the second ciphertext is determined according to the semi-homomorphic encryption algorithm used for the second encrypted value sequence.
12. A device for inadvertent transmission based on photons, characterized in that, Applied to decryption devices; the device includes: The receiving unit is configured to receive a first hash function, a second hash function, a first hash value, a third hash value, a first ciphertext, a second ciphertext, a mask of the first ciphertext, a mask of the second ciphertext, a photonic quantum sequence, and a random number sequence after scrambling from an encryption device. The measurement unit is used to measure the photonic quantum sequence using a measurement basis to obtain a measurement product result, and then to decrypt the measurement product result using a mask of the first ciphertext or a mask of the second ciphertext to obtain a decrypted product result. The calculation unit is used to perform integer division calculation on the decryption product result using the disordered random number sequence to obtain the decryption random number sequence; An encoding unit is used to perform binary encoding on the decrypted random number sequence to obtain a target binary sequence; The computing unit is further configured to use the first hash function to calculate the hash value of the target binary sequence, thereby obtaining the first target hash value; The calculation unit is further configured to verify the first target hash value using the first hash value, and when the verification is successful, to calculate the hash value of the target binary sequence using the second hash function to obtain the second target hash value; The decryption unit is used to decrypt the first ciphertext and the second ciphertext using the second target hash value, so as to decrypt one of the first information and the second information that were inadvertently transmitted.
13. An encryption device, comprising a processor, a memory, and a computer program or instructions stored in the memory, characterized in that, The processor executes the computer program or instructions to implement the steps of the method as described in any one of claims 1-6.
14. A decryption device, comprising a processor, a memory, and a computer program or instructions stored in the memory, characterized in that, The processor executes the computer program or instructions to implement the steps of the method as described in any one of claims 7-10.
15. A computer-readable storage medium, characterized in that, It stores a computer program or instructions that, when executed, implement the steps of the method as described in any one of claims 1-6 or 7-10.
Citation Information
Patent Citations
Privacy intersection method and system and readable storage medium
CN115967491A
Communication-efficient secret shuffle protocol for encrypted data based on homomorphic encryption and oblivious transfer
US20210344489A1
