Quantum Inf Process (2013) 12:3477–3493
DOI 10.1007/s11128-013-0612-y
Novel image encryption/decryption based on quantum
Fourier transform and double phase encoding
Yu-Guang Yang · Juan Xia · Xin Jia · Hua Zhang
Received: 22 March 2013 / Accepted: 9 July 2013 / Published online: 19 July 2013
© Springer Science+Business Media New York 2013
Abstract A novel gray-level image encryption/decryption scheme is proposed, which
is based on quantum Fourier transform and double random-phase encoding technique.
The biggest contribution of our work lies in that it is the first time that the dou-
ble random-phase encoding technique is generalized to quantum scenarios. As the
encryption keys, two phase coding operations are applied in the quantum image spa-
tial domain and the Fourier transform domain respectively. Only applying the correct
keys, the original image can be retrieved successfully. Because all operations in quan-
tum computation must be invertible, decryption is the inverse of the encryption process.
A detailed theoretical analysis is given to clarify its robustness, computational com-
plexity and advantages over its classical counterparts. It paves the way for introducing
more optical information processing techniques into quantum scenarios.
Image processing · Double random-phase encoding · Encryption ·
Keywords
Decryption · Quantum Fourier transform
1 Introduction
Image is one of the most important information representation models and widely
used in modern society. With the rapid development of Internet technology and digital
signal processing technology, the secure transmission of image data is becoming a
Y.-G. Yang (B) · J. Xia · X. Jia
College of Computer Science and Technology, Beijing University of Technology, Beijing 100124, China
e-mail: yangyang7357@bjut.edu.cn
H. Zhang
State Key Laboratory of Networking and Switching Technology, Beijing University
of Posts and Telecommunications, Beijing 100876, China
123
3478
Y.-G. Yang et al.
most important problem. Thus, image encryption is of great significance but of differ-
ence from traditional text encryption due to some inherent features of the image, such
as bulk data capacity, high redundancy and strong correlation among adjacent pixels.
A variety of image encryption schemes have ever been proposed, based on scan pat-
terns methodology [1], double random-phase encoding (DRPE) [2], iterative random
encoding and gyrator transformation [3], vector quantization [4], quadtree compres-
sion [5,6], chaos maps with total shuffling [7], Kolmogorov flow [8] and so on.
Optical processing systems may be useful for security applications owing to their
ability to operate with high speed and in parallel and the characteristics of having vari-
ous attributes such as amplitude, phase, wavelength, polarization and so on. However,
up to date, most optical encryption systems are far from satisfactory. This is because
there exist two following reasons. On the one hand, optical elements via free space
transmission have big size, weak operating flexibility and stability. For example, the
DRPE scheme has skew alignment drawbacks [9,10] and the encryption results as the
complex amplitude distributions are difficult to store and transmit. On the other hand,
most optical encryption systems have vulnerabilities against attacks. For example, the
security of the DRPE method has been thoroughly analyzed and a few weaknesses
and attacks have started to appear, including known plaintext attack [11,12], chosen
ciphertext attack [13] and chosen-plaintext attack [14] and so on. Therefore, optical
encryption systems should be used cautiously in practice.
As we know, cryptography is the approach to protect data secrecy in public environ-
ment. The security of most classical cryptosystems is based on the assumption of com-
putational complexity and might be susceptible to the strong ability of quantum compu-
tation [15,16]. Fortunately, this difficulty can be overcome by quantum cryptography
[17,18], where the security is assured by quantum physical principles such as Heisen-
berg uncertainty principle, quantum no-cloning theorem and so on. With the advantage
of higher security, quantum cryptography has attracted a great deal of attention now.
Processing images on classical computers have been studied extensively. With
the development of quantum computation, classical image processing is naturally
extended to the quantum scenario. Research on quantum image processing started with
proposals on quantum image representations such as Qubit Lattice [19,20], Real Ket
[21] and Flexible Representation of Quantum Images (FRQI) [22]. On the other hand,
classical frequency domain transformations have been proposed to be implemented on
quantum computers such as quantum Fourier transform (QFT) [23], quantum discrete
cosine transform (QDCT) [24,25], quantum Wavelet transform (QWT) [26], quan-
tum fractional Walsh transform (QFWT) [27] and quantum discrete Hartley transform
(QDHT) [28,29]. These quantum transforms are more efficient than their classical
counterparts [23]. For example, as shown in Ref. [23], the quantum circuit provides a
(n2) algorithm for performing the QFT. In contrast, the best classical algorithms for
computing the discrete Fourier transform on 2n elements are algorithms such as the
Fast Fourier Transform (FFT), which compute the discrete Fourier transform using
(n2n) gates. That is, it requires exponentially more operations to compute the Fourier
transform on a classical computer than it does to implement the QFT on a quantum
computer. The similar conclusions can be drawn for other quantum transforms. Table 1
summarizes the classical and quantum algorithm complexities for some representative
transforms and applications.
123
Novel image encryption/decryption
3479
Table 1 Comparisons between classical and quantum algorithm complexities
Fourier
trans-
form
Discrete
cosine
trans-
form
Wavelet
trans-
form
Fractional
Walsh
trans-
form
Discrete
Hartley
trans-
form
Search
algo-
rithm
Prime
factor-
ization
exp((n1/3 log2/3 n))
C (n2n )
Q (n2)
(n2 log n log log n)
In the first column, C denotes classical algorithm complexity, and Q for quantum algorithm complexity
(n2n )
(n)
(n2n )
(n2)
(n2n )
(n2)
(n2n )
(n2)
√
(n)
(
n)
However, there are some special classical image processing operations that cannot
be applied on quantum images, for example convolution and correlation [30], because
all operations in quantum computation must be invertible. Quantum transforms have
been used for images processing directly [22,31–34].
To solve the drawbacks of the optical encryption systems and combine the merits of
quantum cryptography, we propose a novel image encryption and decryption scheme
based on QFT and DRPE proposed by Refregier and Javidi [2]. Due to the proper-
ties of quantum parallel computation, the use of quantum transforms speeds up the
image encryption and decryption procedures. A detailed theoretical analysis is given
to clarify its robustness, computational complexity and advantages over its classical
counterparts.
The outline of this work is as follows. In Sect. 2, a novel and flexible quantum
representation for gray-level images (FQRGI) is introduced. Section 3 introduces the
proposed quantum encryption and decryption scheme. Section 4 is devoted to classical
simulation and performance comparison. Finally, the conclusion is drawn in Sect. 5.
2 Flexible quantum representation for gray-level images (FQRGI)
The properties of gray information and position are extracted from the gray-level
image to generate a representation of image in quantum states as follows,
22n−1
j=0
|I (θ ) = 1
2n
|c j = |0 + ei θ j|1
|c j ⊗ | j,
,
0, π
2
(2)
where θ j ∈
, j = 0, 1, . . . , 22n−1,|0,|1 are two dimensional computational
basis quantum states, (θ0, θ1, . . . , θ22n−1) is the vector of phases encoding information
about gray-level information, and | j, for j = 0, 1, . . . , 22n − 1 are 22n dimensional
computational basis quantum states. There are two parts in the quantum image repre-
sentation: |c j and | j which encode gray-level information and their corresponding
positions in the image, respectively. To perform operation on gray-level information,
a phase gate U =
can be performed on |c j.
1 0
0 ei ψ j
(1)
123
3480
Fig. 1 Encoding procedure
Y.-G. Yang et al.
For two dimensional images, the location information encoded in the position qubit
| j includes two parts; the vertical and horizontal co-ordinates. In 2n-qubit systems
for preparing quantum images, or n-sized images, the vector
| j = |y|x = |yn−1 yn−2 . . . y0|xn−1xn−2 . . . x0,
x j , y j ∈ {0, 1}
for every j = 0, 1, . . . , 22n − 1 encodes the first n-qubit yn−1 yn−2 ··· y0 along the
vertical location and the second n-qubit xn−1xn−2 ··· x0 along the horizontal axis.
3 Quantum image encryption and decryption scheme
In this section, we will first review the DRPE technique [2]. Then we will introduce
its idea into our quantum encryption and decryption strategies.
3.1 DRPE technique
The DRPE technique was proposed by Refregier and Javidi in 1995 [2]. This method
allows one to encode a primary image into a stationary white noise, which has been
receiving much interest because of its high-level data security. The encoding procedure
is given by the following steps and can be shown in Fig. 1.
Assume f (x, y) is the plaintext image and the size is M × N , ϕ(x, y) is the cipher
image. The formulas of the encoding and decoding procedures are given respectively
as follows:
ϕ(x, y) = F T
f (x, y) = F T
−1{F T{ f (x, y) exp[ j2πn(x, y)]} exp[ j2πb(ξ, η)]},
−1{F T{ϕ(x, y)} exp[− j2πb(ξ, η)]} exp[− j2πn(x, y)],
(3)
(4)
where n(x, y) and b(ξ, η) are the two random-phase functions in spatial domain and
frequency domain, respectively, which are uniformly distributed in [0; 1]. F T and
−1 represent the Fourier transform and its inverse Fourier transform, respectively.
F T
f (x, y) denotes the plaintext image, which is a complex image.
The basic principle of this technique is as follows. Two unrelated random phase
marks (RPM, i.e. exp[ j2πn(x, y)] and exp[ j2πb(ξ, η)]) act as the keys to be applied
on the input plane and Fourier spectrum plane respectively, as shown in Fig. 1. The
123
Novel image encryption/decryption
3481
input image is encrypted to get the encrypted image on the output plane. The encrypted
image is complex-amplitude stationary white noise. The cipher image cannot be
decrypted successfully by any unauthorized people without keys, thus the security
of the image is protected well. If only the first RPM is used to encrypt the original
image, the encrypted image is white but nonstationary and not encoded. If one only
uses the second RPM on the Fourier spectrum plane to encrypt image, the encrypted
image can easily be deciphered.
To learn the DRPE technique further, refer to Ref. [2] for details. There is no
spectrum apodization in the Fourier domain, and this method leads to a robust recon-
struction of the primary image as well as to high optical efficiency and robustness
against blind deconvolution. This is an attractive optical technique for high-security
applications. However, as mentioned above, the DRPE scheme is far from satisfactory
because of its skew alignment drawbacks and the difficulty of storing and transmitting
the encryption results as the complex amplitude distributions. In addition, the security
of the DRPE scheme has been thoroughly analyzed and been found a few weaknesses
and attacks mentioned above [11–14]. Therefore, there exists the difficulty in practical
use for the DRPE scheme.
3.2 Quantum image encryption
As shown in Sect. 2, we just take the gray-level information of quantum image into
|c j ⊗ | j, where
consideration. A quantum image is written as |I (θ ) = 1
|c j represents the vectors in color space. Assume the plaintext quantum image is
22n−1
|O = 1
|c j⊗| j, the keys for spatial and QFT domain are phase operations
j=0
2n
=
1 0
, respectively. Here ψ j , υ j are real numbers
and UK2
UK1
0 ei ψ j
and distributed uniformly between 0 and 2π.
Step 1. Encode the original plaintext image in spatial domain to get |M using the
1 0
0 ei υ j
22n−1
j=0
=
2n
key K1.
|M = K1|O = UK1
= UK1
|c j ⊗ | j
1
2n
⊗ I22n|O
22n−1
j=0
|c j ⊗ | j
⊗ I22n
22n−1
j=0
22n−1
j=0
UK1
|d j ⊗ | j.
= 1
2n
= 1
2n
Here, |d j = |0 + ei (θ j+ψ j )|1
.
(5)
123
3482
Y.-G. Yang et al.
Step 2. Execute QFT on |M to get its QFT Q F T (|M) shown as follows.
Q F T (|M) = Q F T
⎛
⎝ 1
2n
22n−1
j=0
⎞
|d j ⊗ | j
⎠ .
(6)
Here, the QFT on an orthonormal basis |0, . . . ,|N − 1 is defined to be a linear
operator with the following action on the basis states,
Q F T : | j → 1√
N
N−1
k=0
e2πi jk/N|k.
Step 3. Encrypt Q F T (|M) using the key K2, and get |M1.
|M1 = K2 Q F T (|M)
= UK2
= UK2
= 1
2n
⊗ I22n Q F T (|M)
⎛
⊗ I22n Q F T
⎝ 1
2n
22n−1
j=0
UK2 Q F T
⎞
|d j ⊗ | j
⎠
22n−1
j=0
|d j ⊗ | j
.
(7)
(8)
Step 4. Execute the inverse QFT to get the quantum cipher image |C what we expect
as follows.
|C = in Q F T (|M1)
⎛
⎝ 1
2n
= in Q F T
22n−1
j=0
|d j ⊗ | j
⎞
⎠ .
UK2 Q F T
(9)
Here the inverse QFT is the implementation of the quantum circuit of QFT in the
reverse order.
The quantum image encryption procedures can be implemented by the following
quantum circuit, as shown in Fig. 2.
Fig. 2 The quantum image encryption circuit
123
Novel image encryption/decryption
3483
3.3 Quantum image decryption
In this phase, only two keys are needed to decrypt the cipher image, i.e. the phase
operations UK1 and UK2. Because all the transformations used in quantum computation
are unitary transformations, the encryption procedure is completely reversible. Our
decrypting procedure is as follows.
Step 1. Execute QFT on |C, and get Q F T (|C) shown as follows.
Q F T (|C) = Q F T (in Q F T (|M1)) = |M1.
(10)
Step 2. Perform the decryption operation on |M1 using the key K2 shown as
follows.
−1
2
K
|M1 = U
⊗ I22n|M1
+
K2
= U
⊗ I22n K2 Q F T (|M)
+
K2
= (U
⊗ I22n )(UK2
+
K2
= U
+
UK2
= Q F T (|M) .
K2
⊗ I22n Q F T (|M)
⊗ I22n )Q F T (|M)
(11)
Step 3. Execute the inverse QFT to get |M shown as follows.
in Q F T (Q F T (|M)) = |M.
(12)
Step 4. Perform the inverse operation on |M using the key K1 to get the quantum
plaintext image |O as follows.
−1
1
K
|M = U
⊗ I22n|M
+
K1
= U
⊗ I22n K1|O
+
K1
= (U
⊗ I22n )(UK1
+
K1
= U
⊗ I22n|O
+
UK1
= |O.
K1
⊗ I22n )|O
(13)
4 Numerical simulation
We will give a detailed theoretical analysis to clarify its robustness, computational
complexity and advantages over its classical counterparts.
Since a practical and useful quantum computer is unavailable, we cannot clearly
say what the hardware will be like. Nevertheless, we can assume that any practical
quantum computer will have an in-built error correction mechanism to protect the
123
3484
Y.-G. Yang et al.
quantum information from errors due to uncontrolled interactions with the environ-
ment, or due to imperfect implementations of the quantum logical operations [23,35].
It may be possible to incorporate intrinsic fault tolerance into the design of quantum
computing hardware.
The simulations are based on linear algebraic constructions. To simulate the quan-
tum effects such as quantum entanglement or superposition, the complex vectors are
used, and the image processing operations are simulated by the unitary matrices. The
final step in these simulations is the measurement, which converts the quantum infor-
mation into the classical information in form of probability distributions. Extracting
and analyzing these distributions gives information for retrieving the transformed
images [22,36].
MATLAB is a mathematical software. It facilitates the representation and manipu-
lation of large arrays of vectors and matrices which makes it a good tool for simulating
quantum states (such as our images) and their transformations. In particular, by treating
the quantum images as large matrices the required simulation of their transformation
using linear algebraic constructions equivalent to the quantum circuit elements is pos-
sible. MATLAB’s Image Processing Toolbox provides a set of graphical tools for
image processing, analysis, visualization, and algorithm development using which
these images and circuit to manipulate them, can be effectively simulated. The results
reported in this section are based on classical simulation experiments using a dataset
of five different images.
In this section, the simulations are analyzed from two aspects. Firstly, in order
to understand the encryption algorithm and prove that our scheme is reliable and
secure, we give a classical numerical simulation. Secondly, we make a comparison
between optical image encryption based on DRPE technique and our scheme in terms
of security, robustness and computational complexity to demonstrate the advantage of
the proposed quantum encryption scheme.
4.1 Evaluation of the proposed scheme
Classical numerical simulation has been implemented on a plaintext image, which
consists of 256 × 256 pixels. Experiments are performed on a laptop with Intel(R)
Core(TM) 2 Duo CPU P7450 2.13 GHz 1.99 GB RAM equipped with the MATLAB
R2012a environment.
The plaintext image is shown in Fig. 3a, and the corresponding cipher image is
shown in Fig. 3b.
An ideal encryption scheme should resist against all kinds of attacks such as sta-
tistical attacks, brute-force attacks, differential attacks, cipher only attacks and the
known plaintext attacks, etc. According to the basic principles of cryptology, a desir-
able encryption scheme requires sensitivity to cipher keys, that is, the cipher should
have close correlation with the keys. In this section, the key sensitivity analysis and
statistical analysis on the proposed image encryption scheme are discussed. All the
analyses show that the proposed image encryption scheme is highly secure thanks to
its large key space and satisfactory permutation–diffusion architecture.
123