## Abstract

In [1], the authors propose a protocol to encrypt quantum images. Below we show that the protocol is incorrect.

## The main idea

The key idea of [1] is to apply a self-inverse operation to a quantum state \(|I\rangle \) encoding a quantum image and a key state \(|K\rangle \) which can be interpreted as a quantum image of the same format as well. The output of the proposed encryption operation is a quantum state \(|X\rangle \) which again corresponds to a quantum image of the same format.

## Discussion of the encryption operation

In Eq. (9) of [1], the authors define the NEQR model for a quantum image *I* of size \(2^n\times 2^n\) as follows:

The indices *i* and *j* encode the *x* and *y* coordinates of a pixel with color value \(c_{i,j}\). The key *K* for the encryption is represented in the same way (see also Eqs. (22) and (23) of [1]) as

For clarity, we use Roman indices *i*, *j* for the image state \(|I\rangle \) and Greek indices \(\mu ,\nu \) for the key state \(|K\rangle \).

The encryption operation is said to be given by Eq. (24) of [1] which we repeat literally here:

Note that the second line of (3) includes the eight qubits specifying the “color” values \(k^7_{i,j}\ldots k^0_{i,j}\) of the pixed at position (*i*, *j*) in the key state \(|K\rangle \), while those qubits are missing from the first and last line.

In the following, we discuss two possible interpretations of the proposed encryption operation. The first is based on the quantum circuit for the encryption algorithm given in Figure 4 of [1] (reproduced here in Fig. 1), while the second is based on the explanation given by the authors around Eq. (24):

”...each entry \(|x_{i,j}^7,x_{i,j}^6,\ldots ,x_{i,j}^0\rangle \otimes |i\rangle |j\rangle \) is computed according to Eq. (24) for each pair of indices \(|i\rangle \), \(|j\rangle \).”

### Encryption following Fig. 4

Looking at the quantum circuit for the encryption algorithm given in Figure 4 of [1], one finds that the qubits related to the pixel positions, denoted \(|X_u\rangle \) and \(|Y_i\rangle \) in the figure, do not enter any operation. Furthermore, the qubits related to the pixel positions of the key state \(|K\rangle \) are not shown at all. The qubits related to the color values in the key state \(|K\rangle \) are drawn in magenta. The horizontal lines depicting them are not connected to any output. Related, the number of qubits of the right hand side of the first line of Eq. (24) is different from the left hand side of the first line.

When we apply the eight CNOT gates of Eq. (24) (also shown in the figure) to the tensor product of the image \(|I\rangle \) and the key \(|K\rangle \), we obtain

Note that the state on the right of the tensor product sign in (4) depends on both the indices *i*, *j* and \(\mu ,\nu \), i.e., the state is in general entangled with respect to the bipartition indicated by the tensor product sign.

When we discard the qubits of the key state \(|K\rangle \), the state corresponding to the encrypted image will be a mixed state, i.e., a state involving some randomness. An alternative description is to perform a measurement of the qubits related to the key state \(|K\rangle \) with respect to the computational bases. This will yield a random, uniformly distributed pixel position \((\mu _0,\nu _0)\) with corresponding color value \(k_{\mu _0,\nu _0}\). (As the CNOT gates do not depend on the variables \(\mu ,\nu \), it is actually sufficient to consider the color value \(k_{\mu _0,\nu _0}\).) Then, the state of the encrypted image will be

Note that all pixels will be modified in the very same way. More severely, the random value \(k_{\mu _0,\nu _0}\) is unknown and cannot be deterministically reproduced in the decryption step.

The state in eq. (5) is clearly different from the state

which one would obtain taking the uniform superposition of the states on the right hand side of Eq. (24) for all values of *i*, *j*.

### Encryption conditioned on the pixel position

As already mentioned, the authors add the explanation that the encrypted image should be computed “for each pair of indices \(|i\rangle , |j\rangle \).” Recall that the pixel indices *i*, *j* in the original image and the pixel indices \(\mu ,\nu \) in the image used as key are independent of each other.

One attempt in that direction could be to condition the CNOT operations on the indices *i*, *j* and \(\mu ,\nu \) being equal. In this case, the state of the whole systems reads

While the summand in (7) somehow resembles the desired state (6), the pixel position *i*, *j* occurs in the qubits related to the key \(|K\rangle \) as well. Ignoring those register would be equivalent to measuring the pixel position. Moreover, the whole state is a superposition of the states (7) and (8), again different from the intended result.

## Concluding remarks

More generally, the authors aim at a reversible quantum operation \(U_{\text {enc}}\) that acts on a quantum image \(|I\rangle \) and a key \(|K\rangle \) in order to produce an encoded quantum image \(|X(K)\rangle \) of the same format as the original image. At the same time, the encoded image \(|X\rangle \) should not be entangled with the rest of the output of the operation, i.e.,

In the proposed encryption protocol, the modification of the image \(|I\rangle \) is controlled by the basis states of the Hilbert space related to the key \(|K\rangle \). In general, the key \(|K\rangle \) is a superposition with respect to that basis, and hence any nontrivial encoding operation necessarily creates entanglement between the Hilbert space of the key and the Hilbert space of the image. Ignoring the key after the encryption operation (partial trace) results in a mixed state of the output, and decryption is not possible in general.

## Reference

Abd-El-AttyAhmed, B., Abd El-Latif, A.A., Venegas-Andraca, S.E.: An encryption protocol for NEQR images based on one-particle quantum walks on a circle. Quantum Information Processing

**18**, 272 (2019). https://doi.org/10.1007/s11128-019-2386-3

## Acknowledgements

The ‘International Centre for Theory of Quantum Technologies’ project (contract no. 2018/MAB/5) is carried out within the International Research Agendas Programme of the Foundation for Polish Science co-financed by the European Union from the funds of the Smart Growth Operational Programme, axis IV: Increasing the research potential (Measure 4.3).

### Open Access

This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## Funding

Open Access funding enabled and organized by Projekt DEAL.

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This comment refers to the article available online at https://doi.org/10.1007/s11128-019-2386-3.

## Rights and permissions

This article is published under an open access license. Please check the 'Copyright Information' section either on this page or in the PDF for details of this license and what re-use is permitted. If your intended use exceeds what is permitted by the license or if you are unable to locate the licence and re-use information, please contact the Rights and Permissions team.

## About this article

### Cite this article

Grassl, M. Comment on “An encryption protocol for NEQR images based on one-particle quantum walks on a circle”.
*Quantum Inf Process* **20**, 183 (2021). https://doi.org/10.1007/s11128-021-03094-0

Received:

Accepted:

Published:

DOI: https://doi.org/10.1007/s11128-021-03094-0

### Keywords

- Entanglement
- Quantum circuits
- Quantum image encryption