Editing Prepare-and-Send Quantum Fully Homomorphic Encryption

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 40: Line 40:
*Server should be able to store entangled states, perform all Clifford and T gates.
*Server should be able to store entangled states, perform all Clifford and T gates.


==Knowledge Graph==
[[File:Prepare-and-Send Quantum Fully Homomorphic Encryption.png|center|Prepare-and-Send Quantum Fully Homomorphic Encryption]]
 
{{graph}}


==Properties ==
==Properties ==
Line 68: Line 66:
* <math>\tilde{x}^{[i]}</math>, resulting ciphertext one gets for an input <math>i^{th}</math> element of array x or <math>i^{th}</math> bit of key x after the Encrypting it with <math>i^{th}</math> of public key string, pk.
* <math>\tilde{x}^{[i]}</math>, resulting ciphertext one gets for an input <math>i^{th}</math> element of array x or <math>i^{th}</math> bit of key x after the Encrypting it with <math>i^{th}</math> of public key string, pk.


==Protocol Description==
== Pseudocode==
===Stage 1 Client’s Preparation===
===Stage 1 Client’s Preparation===
   
   
'''Key Generation (QFHE.KeyGen(1k,1L))'''
'''Key Generation (QFHE.KeyGen(1k,1L))'''
*Input: No. of T gates (L), Security Parameter (k),
*Input: No. of T gates (L), Security Parameter (k),
*Output: L+1 evaluation keys (encrypted Gadgets, classical HE evaluation key), L+1 public keys, L+1 secret keys
*Output: L+1 evaluation keys (encrypted Gadgets, classical HE evaluation key), L+1 public keys, L+1 secret keys
# For i = 0 to L
# For i = 0 to L
## Client executes <math>(pk_i, sk_i, evk_i) \leftarrow \text{HE.KeyGen}(1^{\kappa})</math> to obtain <math>L+1</math> independent classical homomorphic key sets.
##Client executes (pki,ski,evki) HE.KeyGen() to obtain L + 1 independent classical homomorphic key sets.
# She sets the public key to be the tuple <math>(pk_i)_{i = 0}^{L}</math>.
# She sets the public key to be the tuple ( .
# She sets the secret key to be the tuple <math>(sk_i)_{i = 0}^{L}</math>.
# She sets the secret key to be the tuple ( .
# For i = 0 to L-1
# For i = 0 to L 1
## Client runs the procedure <math>\text{QFHE.GenGadget}_{pk_{i+1}}(sk_i)</math> to create the gadget <math>\Gamma_{pk_{i+1}}(sk_i)</math>.  
##Client runs the procedure QFHE.GenGadgetpki+1(ski) to create the gadget Γpki+1(ski).
# Client sets the evaluation key to be the set of all gadgets created in the previous step (including their encrypted classical information), plus the tuple <math>(evk_i)_{i=0}^L</math>. The resulting evaluation key is the classical-quantum (CQ) state</br><math>\bigotimes_{i = 0}^{L-1}\Big(\Gamma _{pk_{i+1}}(sk_i)\otimes |evk_i\rangle \langle evk_i|)</math>
# Client sets the evaluation key to be the set of all gadgets created in the previous step (including their encrypted classical information), plus the tuple ( . The resulting evaluation key is the classical-quantum (CQ) state {missing math}
   
   
'''Encryption(QFHE.Enc())'''
'''Encryption(QFHE.Enc())'''
*Input: Quantum Input state density matrix (<math>\rho</math>) (say composed of n single qubit states, <math>\sigma</math>)
*Input: Quantum Input state density matrix (ρ) (say composed of n single qubit states, σ)
*Output: Encrypted pad keys:<math>\{\tilde{a}^{[0]}...\tilde{a}^{[n]}</math>,<math>\tilde{b}^{[i]}...\tilde{b}^{[n]}\}</math>; QOTP state: <math>X^{a^{[1]}}Z^{b^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}}\rho Z^{b^{[1]}}X^{a^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}}</math>
*Output: Encrypted pad keys: {[0]...[n], ˜b[i]...˜b[n]}; QOTP state: Xa[1]Zb[1].....⊗Xa[n]Zb[n]ρZb[1]Xa[1]..... ⊗ Xa[n]Zb[n]
 
# For i=1 to n
# For i=1 to n
## Client chooses pad keys a,b <math>\epsilon_R\{0,1\}</math>
## Client chooses pad keys a,b  
## She quantum one time pads the single qubit by applying $X^aZ^b$ on the single qubit state. <math>X^aZ^b\sigma Z^bX^a\leftarrow\sigma</math>
## She quantum one time pads the single qubit by applying XaZb on the single qubit state. XaZbσZbXa ← σ
## She encrypts the pad keys using one bit for each of a and b from the public key string <math>pk_0</math> using HE.Enc. (<math>\tilde{a}^{[i]},\tilde{b}^{[i]}</math>)=(HE.Enc<math>_{pk_0^{[i]}}(a^{[i]}</math>),HE.Enc<math>_{pk_0^{[i]}}(b^{[i]}))\leftarrow</math> (a,b)
## She encrypts the pad keys using one bit for each of a and b from the public key string pk0 using HE.Enc. (˜  )=(HE.Enc ),HE.Enc  
## She apprehends encrypted pad keys to the one time padded quantum state to obtain CQ state,  
## She apprehends encrypted pad keys to the one time padded quantum state to obtain CQ state,
<math>\sum_{a,b\epsilon\{0,1\}}\frac{1}{4}\rho(HE.Enc_{pk_0^{[i]}}(a^{[i]}),HE.Enc_{pk_0^{[i]}}(b^{[i]}))\otimes X^aZ^b\sigma Z^bX^a</math>
# Client sends encryptions (˜a[i],˜b[i]) and the quantum one time padded (QOTP) state Xa[1]Zb[1] ..... ⊗ Xa[n]Zb[n]ρZb[1]Xa[1] ..... ⊗ Xa[n]Zb[n], for all i to the Server with the evaluation keys and public keys.
#Client sends encryptions (<math>\tilde{a}^{[i]},\tilde{b}^{[i]}</math>) and the quantum one time padded (QOTP) state<math> X^{a^{[1]}}Z^{b^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}}\rho Z^{b^{[1]}}X^{a^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}} \forall i</math>,  to the Server with the evaluation keys and public keys.
'''Gadget Construction (QFHE.GenGadgetpki+1(ski))'''
'''Gadget Construction (<math>\text{QFHE.GenGadget}_{pk_{i+1}}(sk_i)</math>)'''
# Generate 4m EPR pairs (  
# Generate <math>4m</math> EPR pairs (<math>|\phi\rangle=\frac{1}{\sqrt{2}}(00+11))</math>, <math>\{(a_1,b_1),...,(a_{4m},b_{4m})\}</math>
# Choose 2m pairs using sk
# Choose <math>2m</math> pairs <math>\epsilon \{a_1, a_2,....,a_{4m}\}</math> using sk
## If (sk = 0) then {(a1,a2),(a2,a3),...,(a4m−1,a4m)} ii. If (sk = 1) then {(a1,a3),(a2,a4),...,(a4m−2,a4m)}
## If <math>(sk=0)</math> then <math>\{(a_1,a_2),(a_2,a_3),...,(a_{4m-1},a_{4m})\}</math>
# For j=1 to 2m,
## If <math>(sk=1)</math> then <math>\{(a_1,a_3),(a_2,a_4),...,(a_{4m-2},a_{4m})\}</math>
## Choose p[j]  
# For j=1 to 2m,  
## Perform Bell Measurement on jth pair with an extra (P†)p operation, get outcomes (x[j],z[j])
## Choose p[j] <math>\epsilon_R \{0,1\}</math>
## Thus, new EPR pairs are{missing math}<br/>If (sk = 0) then {(b1,b2),(b2,b3),...,(b4m−1,b4m)}<br/>If (sk = 1) then {(b1,b3),(b2,b4),...,(b4m−2,b4m)}<br/>Denote the 2m entangled pairs be denoted by {(s1,t1),(s2,t2),...,(s2m,t2m)}, such that<br/>
## Perform Bell Measurement on <math>j^{th}</math> pair with an extra <math>(P^\dagger)^p</math> operation, get outcomes (x[j],z[j])
###The classical information of gadget be g(sk)= ({(s1,t1),(s2,t2),...,(s2m,t2m),p,sk}.<br/>
## Thus, new EPR pairs are
###The quantum state of gadget can be written as {missing math}  
### If <math>(sk=0)</math> then <math>\{(b_1,b_2),(b_2,b_3),...,(b_{4m-1},b_{4m})\}</math>
# Encrypt (x[j],z[j]), p[j] for all j and sk using pki+1. Resulting Gadget is the classical-quantum (CQ) state,{missing math}
### If <math>(sk=1)</math> then <math>\{(b_1,b_3),(b_2,b_4),...,(b_{4m-2},b_{4m})\}</math>
## Denote the <math>2m</math> entangled pairs be denoted by <math>\{(s_1,t_1),(s_2,t_2),...,(s_{2m},t_{2m})\}</math>, such that
## The classical information of gadget be g(sk)<math>=(\{(s_1,t_1),(s_2,t_2),...,(s_{2m},t_{2m}),p,sk\}</math>.
## The quantum state of gadget can be written as <math>\gamma_{x,z}(g(sk))=\pi_{j=1}^mX^{x[i]}Z^{z[i]}(P^\dagger){p[i]}|\phi\rangle\langle\phi|_{s_jt_j}(P^\dagger){p[i]}Z^{z[i]}X^{x[i]}</math>
# Encrypt (x[j],z[j]), p[j] for all j and sk using <math>pk_{i+1}</math>. Resulting Gadget is the classical-quantum (CQ) state,
<math>\Gamma_{pk_{i+1}}(sk_i)=\rho(HE.Enc_{pk_{i+1}}(g(sk))\otimes \frac{1}{2^{2m}}\sum_{x,z\epsilon\{0,1\}^m}\rho(HE.Enc_{pk_{i+1}}(x,z)\otimes \gamma_{x,z}(g(sk))</math>


=== Stage 2 Server’s Computation===
=== Stage 2 Server’s Computation===
'''Circuit's Evaluation (QFHE.Eval())'''
'''Circuit Evaluation (QFHE.Eval())'''
*'''Input:''' public key tuple <math>(pk_i)_{i = 0}^{L}</math>, Evaluation key tuple, Encrypted Pad key (<math>\{\tilde{a}^{[0]}...\tilde{a}^{[n]}</math>, <math>\tilde{b}^{[i]}...\tilde{b}^{[n]}\}</math>), QOTP Input State (<math> X^{a^{[1]}}Z^{b^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}}\rho Z^{b^{[1]}}X^{a^{[1]}}\otimes.....\otimes X^{a^{[n]}}Z^{b^{[n]}}</math>)</br>
*Input: public key tuple ( , Evaluation key tuple, Encrypted Pad key ({[0]...[n], ˜b[i]...˜b[n]}), QOTP Input State (Xa[1]Zb[1] ..... ⊗ Xa[n]Zb[n]ρZb[1]Xa[1] ..... ⊗ Xa[n]Zb[n])
*'''Output:''' QOTP Circuit Output State (<math> X^{a'^{[1]}}Z^{b'^{[1]}}\otimes.....\otimes X^{a'^{[k]}}Z^{b'^{[k]}}\rho' Z^{b'^{[1]}}X^{a'^{[1]}}\otimes.....\otimes X^{a'^{[k]}}Z^{b'^{[k]}}</math>), Corresponding Encrypted Pad key (<math>\tilde{a'},\tilde{b'}</math>)=(HE.Eval<math>_{evk_L}^\text{C}(\tilde{a}</math>),HE.Eval<math>_{evk_L}^\text{C}(\tilde{b}</math>))</br></br>
*Output: QOTP Circuit Output State (Xa0[1]Zb0[1].....⊗Xa0[k]Zb0[k]ρ0Zb0[1]Xa0[1].....⊗Xa0[k]Zb0[k]), Corresponding Encrypted Pad key (a˜0,b˜0)=(HE.EvalCevkL(),HE.EvalCevkL(˜b))
Let the Circuit be denoted by C and the gates be <math>c_i</math>
Let the Circuit be denoted by C and the gates be ci
# For all i, <math>c_i</math> gate is applied on qubit m and the <math>m_{th}</math> bits of pad key <math>(\tilde {a}^{[m]},\tilde{b}^{[m]})</math> are updated to <math>(\tilde {a}'^{[m]},\tilde{b}'^{[m]})</math> as follows.  
# For all i, ci gate is applied on qubit m and the mth bits of pad key (˜a[m],˜b[m]) are updated to
## If <math>c_i=\{P,H,CNOT\}</math>, a Clifford gate then <math>c_iX^{a^{[m]}}Z^{b^{[m]}}\psi=X^{a'^{[m]}}Z^{b'^{[m]}}c_i\psi</math>)
(a˜0[m],˜b0[m]) as follows.
### if <math>c_i=</math>H then: <math>(\tilde {a}^{[m]},\tilde{b}^{[m]})\rightarrow (\tilde{b}^{[m]},\tilde{a}^{[m]})</math> (Hadamard tranforms X gate into Z and Z into X)
## If ci = {P,H,CNOT}, a Clifford gate then (ciXa[m]Zb[m]ψ = Xa0[m]Zb0[m]ciψ)
### if <math>c_i=</math>P then: <math>(\tilde {a}^{[m]},\tilde{b}^{[m]})\rightarrow (\tilde{a}^{[m]},\tilde{a}^{[m]}\oplus\tilde{b}^{[m]})</math>
### if ci =H then{missing math} (Hadamard tranforms X gate into Z and Z into X)
### if <math>c_i=</math>CNOT with m as target bit and n as control bit then: <math>(\tilde {a}^{[m]},\tilde{b}^{[m]};\tilde {a}^{[n]},\tilde{b}^{[n]})\rightarrow (\tilde {a}^{[m]},\tilde{b}^{[m]}\oplus \tilde {b}^{[n]};\tilde{a}^{[m]}\oplus \tilde {a}^{[n]},\tilde{b}^{[n]})</math>
### if ci =P then<br/>{missing math}  
## If <math>c_i=T_j</math> gate then: <math> (T_jX^{a^{[m]}}Z^{b^{[m]}}\psi=P^{a^{[m]}}X^{a^{[m]}}Z^{b^{[m]}}T_j\psi)</math>
###if ci =CNOT with m as target bit and n as control bit then (CNOT)<br/>([m],˜b[m];˜a[n],˜b[n]) ([m],˜b[m] ⊕˜b[n];˜a[m] ⊕a˜[n],˜b[n])
###'''Generate Measurement''' M<math>\leftarrow</math> QFHE.GenMeasurement(<math>\tilde {a}^{[m]},\Gamma_{pk_{j+1}}(sk_j),evk_j)</math>
## If ci = Tj gate then (TjXa[m]Zb[m]ψ = Pa[m]Xa[m]Zb[m]Tjψ)
###'''Gadget Correction'''<math>(X^{a'^{[m]}}Z^{b'^{[m]}}T_j)\psi\leftarrow</math> QFHE.Measurement(M, <math>P^{a^{[m]}}X^{a^{[m]}}Z^{b^{[m]}}T_j\psi)</math>
### Generate Measurement<br/>M← QFHE.GenMeasurement(˜a[m],Γpkj+1(skj),evkj)<br/>
### Server gets measurement outcome x',z'
### Gadget Correction<br/>(Xa0[m]Zb0[m]Tj)ψ ← QFHE.Measurement(M, Pa[m]Xa[m]Zb[m]Tjψ);<br/> Server gets measurement outcome x’,z’
###'''Recryption''' Server recrypts one-pad key using pk<math>_{k+1}</math> (<math>\tilde {a''}^{[m]},\tilde{b''}^{[m]})\leftarrow</math> QFHE.Rec<math>_{pk_{k+1}}(\tilde {a}^{[m]},\tilde{b}^{[m]})</math>
### Recryption Server recrypts one-pad key using pkk+1<br/>QFHE.Recpkk+1([m],˜b[m]).<br/>
### Server updates the recrypted key using x,z and x',z'. (<math>\tilde {a'}^{[m]},\tilde{b'}^{[m]})\leftarrow (\tilde {a''}^{[m]},\tilde{b''}^{[m]}</math>)
##Server updates the recrypted key using x,z and x’,z’.
## Server sends the updated encryption and QOTP output state to Client.
## Server sends the updated encryption and QOTP output state to Client.
 
===Stage 3 Client’s Correction===
===Stage 3 Client’s Correction===
'''Decryption (QFHE.Dec())
'''Decryption (QFHE.Dec())
*'''Input:''' QOTP Circuit Output State (<math> X^{a'^{[1]}}Z^{b'^{[1]}}\otimes.....\otimes X^{a'^{[k]}}Z^{b'^{[k]}}\rho' Z^{b'^{[1]}}X^{a'^{[1]}}\otimes.....\otimes X^{a'^{[k]}}Z^{b'^{[k]}}</math>), Corresponding Encrypted Pad key (<math>\tilde{a'},\tilde{b'}</math>)
*Input: QOTP Circuit Output State (Xa0[1]Zb0[1] ..... ⊗ Xa0[k]Zb0[k]ρ0Zb0[1]Xa0[1] ..... ⊗Xa0[k]Zb0[k]), Corresponding Encrypted Pad key (a˜0,b˜0)
*'''Output:''' Final outcome of the computation C<math>\rho</math>C<math>^\dagger=\rho'</math>
*Output: Final outcome of the computation CρC† = ρ0 (a) Client uses skL to restore the pad key from sent encryption. (a0[i],b0[i])=(HE.Dec [i](a0[i]),HE.Dec [i](b0[i]))
# Client uses <math>sk_L</math> to restore the pad key from sent encryption: (<math>{a'}^{[i]},{b'}^{[i]}</math>)=(HE.Dec<math>_{sk_L^{[i]}}(a'^{[i]}</math>),HE.Dec<math>_{pk_L^{[i]}}(b'^{[i]}))</math>
# Client uses skL to restore the pad key from sen encryption
# Client uses pad key and operates <math>X^{a'^{[i]}}Z^{b'^{[i]}}</math> on single qubits i separately just like encryption.  
# Client uses pad key and operates Xa Zb on single qubits i separately just like encryption.<br/>Let single qubit representation of the output state be Xa0[i]Zb0[i]σ0Zb0[i]Xa0[i], then operation of Pauli X,Z gates as above yields σ0
##Let single qubit representation of the output state be <math>X^{a'^{[i]}}Z^{b'^{[i]}}\sigma' Z^{b'^{[i]}}X^{a'^{[i]}}</math>, then operation of Pauli X,Z gates as above yields <math>\sigma'</math>
# Client repeats this for all single qubits and hence gets the quantum state ρ0, final outcome of the computation.
# Client repeats this for all single qubits and hence gets the quantum state <math>\rho'</math>, final outcome of the computation.


==Further Information==
==Further Information==


<div style='text-align: right;'>''*contributed by Shraddha Singh''</div>
<div style='text-align: right;'>''*contributed by Shraddha Singh''</div>
Please note that all contributions to Quantum Protocol Zoo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Quantum Protocol Zoo:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Template used on this page: