Encryption and decryption method and system with continuous-variable quantum neural network

Abstract

A method and a system for encryption and decryption based on continuous-variable quantum neural network CVQNN. The method includes: updating a weight of the CVQNN with a training sample; triggering, by a sender, a legal measurement bases synchronization between the sender and the CVQNN; converting, by the sender, the information to be sent into a quadratic plaintext according to the synchronized measurement bases, and sending the quadratic plaintext to the CVQNN; encrypting, by the CVQNN, a received quadratic plaintext, and sending an encrypted quadratic plaintext to a receiver; after receiving the encrypted quadratic plaintext, sending by the receiver the encrypted quadratic plaintext to the CVQNN for decryption to obtain decrypted information. The embodiments implement data encryption and decryption by introducing CVQNN model and synchronization measurement technology. The embodiments provide advantages of high reliability, high security and easy realization.

Claims

1. An encryption and decryption method based on a continuous-variable quantum neural network (CVQNN), comprising: updating, by the CVQNN, a weight of the CVQNN with a training sample; triggering, by a sender, a legal measurement bases synchronization (LMB) between the sender and the CVQNN; converting, by the sender, information to be sent into a quadratic plaintext according to the LMB, and sending the quadratic plaintext to the CVQNN; encrypting, by the CVQNN, a received quadratic plaintext, and sending an encrypted quadratic plaintext to a receiver; and after receiving the encrypted quadratic plaintext, sending, by the receiver, the encrypted quadratic plaintext to the CVQNN for decryption to obtain decrypted information.

2. The method according to claim 1, wherein the updating, by the CVQNN, of the weight of the CVQNN with a training sample, comprises: repeatedly updating, by the CVQNN, the weight of the CVQNN according to the training sample until a loss value of the CVQNN loss function is less than a preset threshold.

3. The method according to claim 2, wherein the repeatedly updating, by the CVQNN, of the weight of the CVQNN according to the training sample until a loss value of the CVQNN loss function is less than a preset threshold, comprises: repeatedly updating, by the CVQNN, the weight of the CVQNN according to the training sample using Adam optimization algorithm, until the loss value of the CVQNN loss function is less than the preset threshold.

4. The method according to claim 1, wherein the triggering, by the sender, of the legal measurement bases synchronization between the sender and the CVQNN, comprises: generating, by the sender, a quantum state according to first measurement bases set and selected randomly, and sending a generated quantum state to the CVQNN; measuring, by the CVQNN, a received quantum state by using second measurement bases set and selected randomly, to obtain a first serial number, and sending the first serial number to the sender; determining, by the sender, synchronized measurement bases according to a received first serial number, and then sending the synchronized measurement bases to the CVQNN.

5. The method according to claim 1, wherein before the converting, by the sender, of the information to be sent into a quadratic plaintext according to the synchronized measurement bases, and sending the quadratic plaintext to the CVQNN, the method further comprises: sending, by the sender, the information to be sent to the CVQNN; if the CVQNN determines that the information to be sent is quantum state information, then sending the quantum information back to the sender; and if the CVQNN determines that the information to be sent is bit information, converting the bit information into the quantum state information through a displacement gate in vacuum state, and sending a converted quantum information to the sender.

6. The method according to claim 1, wherein the encrypting, by the CVQNN, of the received quadratic plaintext, and sending the encrypted quadratic plaintext to the receiver, comprises: calculating an expected value for an outputted data of the CVQNN according to the received quadratic plaintext; calculating a value of a first error correction function according to the expected value; combining a first hidden output of the CVQNN with the value of the first error correction function to obtain the encrypted quadratic plaintext; and sending the encrypted quadratic plaintext to the receiver through a communication channel.

7. The method according to claim 1, wherein after receiving the encrypted quadratic plaintext, the sending by the receiver the encrypted quadratic plaintext to the CVQNN for decryption to obtain decrypted information, comprises: parsing, by the receiver, the encrypted quadratic plaintext to obtain values of the second hidden output and the second error correction function of the CVQNN; sending, by the receiver, the second hidden output to the CVQNN, and receiving an output result returned by the CVQNN; and determining, by the receiver, the quadratic plaintext according to the output result and the value of the second correction function, and determining the decrypted information according to the quadratic plaintext.

8. The method according to claim 7, wherein after the sending by the receiver of the encrypted quadratic plaintext to the CVQNN again for decryption to obtain decrypted information, the method further comprises: sending, by the receiver, the determined quadratic plaintext to the CVQNN again, and receiving a third hidden output returned by the CVQNN; determining, by the receiver, that the information to be sent has not been maliciously modified, if the third hidden output is the same as the second hidden output; and determining, by the receiver, that the information to be sent has been modified, if the third hidden output is different from the second hidden output.

9. An encryption and decryption system based on a continuous-variable quantum neural network (CVQNN), comprising: a sender, the CVQNN, and a receiver, wherein: the CVQNN is configured to update a weight of the CVQNN with a training sample; the sender is configured to trigger measurement bases synchronization between the sender and the CVQNN; the sender is configured to convert the information to be sent into a quadratic plaintext according to synchronized measurement bases, and send the quadratic plaintext to the CVQNN; the CVQNN is configured to encrypt a received quadratic plaintext and send an encrypted quadratic plaintext to the receiver; and the receiver is configured to send, after receiving the encrypted quadratic plaintext, the encrypted quadratic plaintext to the CVQNN for decryption to obtain decrypted information.

10. The system according to claim 9, wherein the CVQNN is further configured to: repeatedly update the weight of the CVQNN according to the training sample until a loss value of the CVQNN loss function is less than a preset threshold.

11. The system according to claim 10, wherein the CVQNN is further configured to: repeatedly update the weight of the CVQNN according to the training sample using Adam optimization algorithm, until the loss value of the CVQNN loss function is less than the preset threshold.

12. The system according to claim 9, wherein the sender is further configured to: generate a quantum state according to a first measurement bases set selected randomly, and send a generated quantum state to the CVQNN; and wherein the CVQNN is further configured to measure the received quantum state using a second measurement bases set selected randomly to obtain a first serial number, and sending the first serial number to the sender; and the sender is further configured to determine the synchronized measurement bases according to a received first serial number, and then send the synchronized measurement bases to the CVQNN.

13. The system according to claim 9, wherein the sender is further configured to: send the information to be sent to the CVQNN; and wherein the CVQNN is further configured to send quantum state information back to the sender if the CVQNN determines that the information to be sent is the quantum state information; convert, if the CVQNN determines that the information to be sent is bit information, the bit information into the quantum state information through a displacement gate in vacuum state, and send a converted quantum information to the sender.

14. The system according to claim 9, wherein the CVQNN is further configured to: calculate an expected value for an outputted data of the CVQNN according to the received quadratic plaintext; calculate a value of a first error correction function according to the expected value; combine a first hidden output of the CVQNN with the value of the first error correction function to obtain the encrypted quadratic plaintext; and send the encrypted quadratic plaintext to the receiver through a communication channel.

15. The system according to claim 9, wherein the receiver is further configured to: parse the encrypted quadratic plaintext to obtain values of a second hidden output and a second error correction function of the CVQNN; send the second hidden output to the CVQNN, and receive an output result returned by the CVQNN; and determine the quadratic plaintext according to the output result and the value of the second error correction function, and determining the decrypted information according to the quadratic plaintext.

16. The system according to claim 15, wherein the receiver is further configured to: send the determined quadratic plaintext to the CVQNN again, and receiving a third hidden output returned by the CVQNN; determine that the information to be sent has not been maliciously modified if the third hidden output is the same as the second hidden output; and determine that the information to be sent has been modified if the third hidden output is different from the second hidden output.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) To describe the technical solutions in embodiments of the present disclosure more clearly, the following briefly introduces the accompanying drawings needed for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description illustrate merely some embodiments of the present disclosure, and persons of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative effort.

(2) FIG. 1 is a schematic diagram of the general scheme for the present invention method;

(3) FIG. 2 is a schematic diagram of the generalized CVQNN model for the present invention method;

(4) FIG. 3 is a schematic diagram of the specific neuron layers for the present invention method;

(5) FIG. 4 is a schematic diagram of the multilayer CVQNN for the method according to the present disclosure;

(6) FIG. 5 is a schematic diagram of the specific encryption process based on the CVQNN for the method according to the present disclosure;

(7) FIG. 6 is a schematic diagram of the specific decryption process based on the CVQNN for the method according to the present disclosure; and

(8) FIG. 7 shows the probability of the attacker eavesdropping on cipher for the method according to the present disclosure, in case of the introduction of legal measurement bases (LMB).

DETAILED DESCRIPTION OF EMBODIMENTS

(9) To make the objectives, technical solutions, and advantages of embodiments of the present disclosure clearer, the following clearly and comprehensively describes the technical solutions in embodiments of the present disclosure with reference to the accompanying drawings in embodiments of the present disclosure. Apparently, the described embodiments are merely a part rather than all embodiments of the present disclosure. All other embodiments obtained by persons of ordinary skill in the art based on embodiments of the present disclosure without creative effort shall fall within the protection scope of the present disclosure.

(10) In continuous-variable quantum models, information is usually carried by bosons, denoted as qumodes. The quantum state preparation, unitary operation and quantum state measurement can be realized by quantifying the continuous orthogonal amplitude of magnetic field. Hence, it is easier to implement CVQNN than DVQNN in quantum physical devices.

(11) A generalized CVQNN model is shown in FIG. 2, which demonstrates that CVQNN can have multiple layers, and the size of a rear layer can be reduced by trading out quantum states or measuring quantum states. The output quantum state may subject to a quantum measuring device to obtain desired information carried by the quantum state.

(12) A generalized CVQNN model can fix unitary operations of each layer, and these unitary operations can have a computation form y=φ(wx+b) of the classical neural network, where W is weight matrix, x is input data vector, b is bias vector and φ is nonlinear function. Hence, the specific composition of each neural layer can be obtained as shown in FIG. 3, which is denoted as the equation l:=(φ∘D∘R.sub.2 ∘S∘R.sub.1, where both R.sub.1 and R.sub.2 are single-mode gates R(φ)=exp(iϕâ.sup.†â), S is a squeeze operation, and

(13) S ( z ) = exp ( r 2 ( e - i ϕ a ^ 2 - e i ϕ a ^ 2 ) ) ,
D is displacement operation, and
D(r)=exp(r(e.sup.iϕâ.sup.†−e.sub.−iϕâ)), where â and â.sup.† denote an annihilation operator and a generation operator respectively.

(14) The mathematical isomorphism between neurons proves that CVQNN can be used to encrypt and decrypt data. Let U.sub.R.sub.2U.sub.SU.sub.R.sub.1=U, and U.sub.i{i=R.sub.1.sub.,S,R.sub.2.sub.} represents Gaussian operations, the mathematical express of CVQNN can be seen as:

(15) y ^ 1 = φ ( .Math. j = 1 n U 1 , j x ^ j + α 1 ) ,
where U.sub.1,j{j=1, 2, . . . , n} denotes unitary operations between ŷ.sub.1 and {circumflex over (x)}.sub.j, and α.sub.1 denotes an inner parameter of a displacement gate. By the above expression, the mathematical expression of CVQNN can further be described as:
ŷ.sub.i=φ(Σ.sub.j=1.sup.nU.sub.i,j{circumflex over (x)}.sub.j+α.sub.i)(i=2, . . . m).

(16) According to the above description, a general equation of CVQNN is:
y=φ(U{circumflex over (x)}+α),
where

(17) y ^ = [ y ^ 1 y ^ 2 .Math. y ^ m ] , α = [ α 1 α 2 .Math. α n ] , U = [ U 1 , 1 U 1 , 2 .Math. U 1 , n U 2 , 1 U 2 , 2 .Math. U 2 , n .Math. .Math. .Math. .Math. U m , 1 U m , 2 .Math. U m , n ]

(18) Since all quantum operations are unitary operations, by means of a series of inverse unitary operation, the initial input information of the network can be obtained easily:
{circumflex over (x)}=V(U.sup.−1(ŷ−ϕ(α)))

(19) Here, it is proved mathematically that QNN can be utilized in the design of cryptosystem, which contains multiple key parameters to ensure the security of information.

(20) Therefore, the present invention proposes a data transmission method based on CVQNN, the principle of which is shown in FIG. 4. h.sub.(i) denotes the output of a middle layer, which is used for certification of quantum information. In the process of message certification (shown in the dashed block of FIG. 6), the middle outputs h.sub.(i)′ and h.sub.(i) are compared: if custom characterh.sub.(i)′|h.sub.(i)custom character=0, it means that the information is not been changed during the transmission, i.e., the process of message certification can be completed successfully. In addition, the dashed block in FIG. 4 denotes the preprocessing for information. The proposed cryptosystem with the combination of ANN and quantum computing presented a novel encryption and decryption scheme. The security analysis and performance analysis prove that QNN can be used for data encryption processing, with higher security and faster processing speed.

(21) The encryption and decryption method based on the CVQNN provided by the present disclosure is shown in FIG. 1 and includes the following steps:

(22) S1. The CVQNN uses training samples to update its own weights.

(23) In an embodiment, the step S1 may include: the CVQNN repeatedly updates its weights according to the training sample until a loss value of the CVQNN loss function is less than a preset threshold.

(24) In an embodiment, the step that CVQNN repeatedly updates its weights according to the training sample until the loss value of the CVQNN loss function is less than the preset threshold, includes:

(25) the CVQNN repeatedly updates the weight of the CVQNN according to the training sample using the Adam optimization algorithm, until the loss value of the CVQNN loss function is less than the preset threshold.

(26) S2. The sender triggers the measurement base synchronization between the sender and the CVQNN.

(27) In an embodiment, the measurement bases synchronization between the sender and the CVQNN is performed by the following steps that:

(28) the sender generates quantum states according to a first measurement bases set selected randomly, and sends the generated quantum states to the CVQNN;

(29) the CVQNN measures the received quantum state by using a second measurement bases set selected randomly, to obtain a first serial number, and sends the first serial number to the sender;

(30) the sender determines synchronized measurement bases according to the received first serial number, and then sends the synchronized measurement bases to the CVQNN.

(31) S3. The sender converts the information to be sent into a quadratic plaintext according to the synchronized measurement bases, and sends the quadratic plaintext to the CVQNN.

(32) In an embodiment, before the step S3, it further includes that:

(33) the sender sends the information to be sent to the CVQNN;

(34) if the CVQNN determines that the information to be sent is quantum information, then the CVQNN sends the quantum information back to the sender; if the CVQNN determines that the information to be sent is bit information, and then the bit information is converted into quantum state information through a displacement gate in vacuum states i.e.,

(35) M .Math. 0 .Math. .Math. D x ^ ,
and the converted quantum state information is sent to the sender.

(36) S4. The CVQNN encrypts the received quadratic plaintext and sends the encrypted quadratic plaintext to the receiver.

(37) In this embodiment, the step S4 includes:

(38) calculating an expected value of the output data of the CVQNN according to the received quadratic plaintext;

(39) calculating an value of a first error correction function according to the expected value;

(40) combining a first hidden output of the CVQNN with the value of the first error correction function to obtain an encrypted quadratic plaintext;

(41) sending the encrypted quadratic plaintext to the receiver through a communication channel.

(42) According to input dimension of the neural network, quantum information {circumflex over (x)}, {circumflex over (x)} can be decomposed into plaintext information {circumflex over (x)}:={{circumflex over (x)}.sub.(1), {circumflex over (x)}.sub.(2), . . . , {circumflex over (x)}.sub.(n)}. A schematic diagram of a specific encryption progress based on CVQNN is shown in FIG. 5. As shown in FIG. 5, information {circumflex over (x)}.sub.(i) is inputted into the CVQNN to be processed to obtain a cipher ŷ.sub.(i) and the CVQNN can be regarded as a black box. The expected value of ŷ.sub.(i) is denoted as custom characterφ.sub.x|ŷ.sub.(i)|φ.sub.x custom character where φ.sub.x is the output of quantum circuit of a given input D(x)|0custom character. Hence, the encrypted quadratic plaintext or cipher block C(h.sub.(i), E.sub.(i)) sent to the receiver can be formed by the first error function E.sub.(i)={circumflex over (x)}.sub.(i)−custom characterφ.sub.x|ŷ.sub.(i)|φ.sub.xcustom character and the first hidden output of CVQNN.

(43) S5. After receiving the encrypted quadratic plaintext, the receiver sends the encrypted quadratic plaintext to the CVQNN for decryption to obtain decrypted information.

(44) In an embodiment, the step S5 includes that:

(45) the receiver parses the encrypted quadratic plaintext to obtain the values of the second hidden output and the second error correction function of the CVQNN;

(46) the receiver sends the second hidden output to the CVQNN, and receives an output result returned by the CVQNN; and

(47) the receiver determines the quadratic plaintext according to the output result and the value of the second correction function, and determines the decrypted information according to the quadratic plaintext.

(48) In an embodiment, after the step S5, the method further includes that:

(49) the receiver sends the determined quadratic plaintext to the CVQNN again, and receives a third hidden output returned by the CVQNN;

(50) the receiver determines that the information to be sent has not been maliciously modified, if the third hidden output is the same as the second hidden output;

(51) the receiver determines that the information to be sent has been modified, if the third hidden output is different from the second hidden output.

(52) Furthermore, if the third hidden output is the same as the second hidden output, it means that the quantum state information has not been modified. The reason of being modified may be natural noise or attacks. If the influence of natural noise is eliminated, it can prove that there is an attacker in the communication process, and thus the communicator can choose terminating the communication.

(53) FIG. 6 is a schematic diagram of the specific decryption process based on CVQNN for the method according to the present disclosure. As shown in FIG. 6, the encrypted quadratic plain (cipher block) C(h.sub.(i), E.sub.(i)) is parsed out to obtain the second hidden output h.sub.(i) and E.sub.(i). h.sub.(i) is inputted into the identical CVQNN to acquire the output result ŷ.sub.(i)′=ŷ.sub.(i), then plain {circumflex over (x)}.sub.(i) is obtained from ŷ.sub.(i)′ by the calculation of E.sub.(i)+custom characterφ.sub.x|ŷ.sub.(i)′|φ.sub.xcustom character. {circumflex over (x)}.sub.(i) could be inputted into the CVQNN again to obtain the third hidden output h.sub.(i)′. If custom character(h.sub.(i)|h.sub.(i)′custom character=δ(h.sub.(i)′−h.sub.(i)=0, that is, the result is 0, it means that the quantum information is not changed, and hence the communication can be continued.

(54) FIG. 7 is a probability schematic of an attacker eavesdropping on the cipher for the method according to the present disclosure, in the case of the introduction of LMB. As shown in FIG. 7, before sending data, the sender may perform a process of synchronizing LMB with CVQNN. The idea of the progress of synchronizing LMB is similar to BB84 protocol where entanglement quantum states unaffected by the environment or an attacker are chosen to be measured by using several pairs of entanglement quantum states, and a one-to-one correspondence between the measured values and LMB is ensured. The whole process can ensure that LMB can be synchronized at both sides of the communicators, and that the choice of the legal measurement bases cannot be known by attackers. Every time a piece of data generated from the sender under a fixed legal measurement bases is sent, assuming that an attacker has captured cipher, but the attacker cannot use a corresponding legal measurement bases to measure the cipher accurately because he does not have the corresponding legal measurement bases, as a result, it is difficult to obtain true information. In the case of two or three groups of legal measurement bases, the probability of eavesdropping on cipher is almost zero for the attacker, as long as the number of cipher block reaches six to ten groups.

(55) In addition, the cryptosystem can prevent the message replaying from attackers. Due to quantum non-cloning theorem, attackers only can prepare new quantum states as fake information to send to the receiver. In this case, it is necessary for information authentication formed by the cryptosystem. Suppose that there is a powerful attacker, who can generate data C′(h′.sub.(i), E′.sub.(i)) that matches the cipher block by some means, and passes one information authentication at one time. It requires the classical computer to have huge enough computing power, such as Q(2.sup.2n) operations, to pass the whole information authentication for n-bit plaintext. It requires huge resources and computing power for attackers, that is, not only a large amount of quantum sources to generate fake cipher is required, but also the correlation between the combination of cipher can only be computed by brute force, and the probability of passing the authentication by an attacker at one time is only

(56) 1 2 2 n + 2 n + 1 .

(57) In addition, the attacker may intercept the quantum plaintext and the corresponding cipher to construct a similar cryptosystem, and then use the simulated cryptosystem to decrypt the obtained cipher, so that the attacker does not need to know how to choose the LMB, but can get true information. Researches show that if the weight (key) of the neural network is kept static or little changed in a relatively small range, then the neural network could be simulated. It is a non-negligible attack for key sharing realized based on neural network synchronization technology. Considering this, it can increase the difficulty of simulating the cryptosystem for an attacker by maintaining the range of weights in a relatively large range. Mimicking the TCP congestion mechanism can achieve the above goal. Set a parameter α and compare it with the value of loss function β. The comparison result is used to control the learning rate. When α<β, the learning rate could be increased by multiplying by a factor greater than 1, otherwise, it can be reduced by multiplying a factor less than 1. By means of such a mechanism, the attacker cannot simulate a cryptosystem due to the dynamic property of the cryptosystem. Moreover, each set of cipher blocks is encrypted by a set of keys, so the total key length should be an extension of each set of keys. Therefore, even if an attacker intercepts a large amount of information and simulates a neural network system to decrypt the data, it is almost impossible to completely recover the plaintext due to the combination of extended keys. As a result, it is impossible to crack the algorithm and cipher in the neural network system by brute force and hence the cryptosystem in this solution is able to prevent the attack from attackers.

(58) In addition, the invention can also resist chosen-plaintext attack. The chosen-plaintext attack means that the attacker pretends to be the sender, then sends information to the receiver and crack the transmitted information by capturing packets. In the chosen-plaintext attack, the attacker can guess part or all of the keys, which is a non-negligible attack for the cryptographic algorithms based on mathematical theory. However, the method of the present disclosure actually contains multiple keys, such as neural network structure, neural network training algorithm, and weight parameters of the neural network. Thus, it is impossible for an attacker to obtain keys by the chosen-plaintext, unless he is very clear about the neural network system. Let κ be a channel composed of plaintext, cipher blocks and keys, i.e., κ={(T.sub.p,T.sub.c),K.sub.p}, where T.sub.p, T.sub.c and K.sub.p denote the plaintext, cipher and key, respectively. The probability of getting K.sub.p by an attacker using blocks (T.sub.p, T.sub.c) is very low in case of the keys consisting of multiple keys and private keys. Especially, the probability for quantum information is lower, due to the fact that under the same conditions, quantum cipher ambiguity is higher than classical cipher ambiguity and legal measurement bases is introduced. According to the analysis, when the number of the groups of legal measurement bases is 2, and the number of cipher blocks is 10, then the success probability of eavesdropping on the correct cipher is 0, that is, the success probability of the chosen-plaintext attack is 0, i.e., p(K.sub.p|(T.sub.p, T.sub.c))=0. The mutual information between (T.sub.p, T.sub.c) and K.sub.p can be denoted as follows:

(59) I ( ( T p , T c ) , K p ) = .Math. p ( ( T p , T c ) , K p ) log p ( K p | ( T p , T c ) ) p ( K p ) = 0 ,
where I((T.sub.p, T.sub.c)K.sub.p,)=0 indicates that κ is perfect and confidential. Hence the scheme can resist the chosen-plaintext attack.

(60) The reasons why the quantum neural network can accelerate data processing are listed as follows:

(61) 1) Due to the superposition of quantum states, in case of the same amount of bits, non-orthogonal quantum states can carry more information than classical bits, that is, the .Math. classical bits can carry .Math. bits of data, while the .Math. quantum bits can carry 2.Math. or even more bits of information;

(62) 2) There is not the process of key agreement in the whole communication, which can save the time of communication;

(63) 3) There is a high key utilization rate. In the quantum “one-time pad” algorithm, it is necessary to generate a set of new keys to encrypt data every time, which takes lots of time. The number of neurons is defined as n, the average operand required by one neuron is denoted as m, and the total input of neuron network is denoted as I. Therefore, the minimum key utilization rate can be denoted as

(64) μ = I m n .
Due to the learning process in neuron network, the times of updating weight will decrease as the times of encryption increases (it is considered that there is a certain correlation between plaintext blocks, so there also is a certain correlation between the updated weights), which means the speed of encrypting data can become faster and faster. The minimum key utilization rate μ begins to increase with the decreasing of the value of mn.

(65) In conclusion, the proposed method not only guarantees the high security of information, but also can improve the key utilization rate and accelerate the efficiency of encryption and decryption.