A Secure Image Encryption Algorithm Based on Rubik's Cube Principle

Article (PDF Available)inJournal of Electrical and Computer Engineering · March 2012with441 Reads
DOI: 10.1155/2012/173931
Abstract
In the past few years, several encryption algorithms based on chaotic systems have been proposed as means to protect digital images against cryptographic attacks. These encryption algorithms typically uses relatively small key spaces and thus offers limited security, especially if they are one dimensional. In this paper, we proposed a novel image encryption algorithm based on Rubik’s cube principle. The original image is scrambled using the principle of Rubik’s cube. Then, XOR operator is applied to rows and columns of the scrambled image using two secret keys. Finally, the experimental results and security analysis show that the proposed image encryption scheme not only can achieve good encryption and perfect hiding ability and resist to exhaustive attack, statistical attack and differential attack.
Hindawi Publishing Corporation
Journal of Electrical and Computer Engineering
Volume 2012, Article ID 173931, 13 pages
doi:10.1155/2012/173931
Research Article
A Secure Image Encryption Algorithm Based on
Rubiks Cube Principle
Khaled Loukhaoukha, Jean-Yves Chouinard, and Abdellah Berdai
Department of Electrical and Computer Engineering, Laval University, QC, Canada G1K 7P4
Correspondence should be addressed to Khaled Loukhaoukha, khaled.loukhaoukha.1@ulaval.ca
Received 22 August 2011; Accepted 15 November 2011
Academic Editor: Fouad Khelifi
Copyright © 2012 Khaled Loukhaoukha et al. This is an open access article distributed under the Creative Commons Attribution
License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly
cited.
In the past few years, several encryption algorithms based on chaotic systems have been proposed as means to protect digital images
against cryptographic attacks. These encryption algorithms typically use relatively small key spaces and thus oer limited security,
especially if they are one-dimensional. In this paper, we proposed a novel image encryption algorithm based on Rubik’s cube
principle. The original image is scrambled using the principle of Rubiks cube. Then, XOR operator is applied to rows and columns
of the scrambled image using two secret keys. Finally, the experimental results and security analysis show that the proposed image
encryption scheme not only can achieve good encryption and perfect hiding ability but also can resist exhaustive attack, statistical
attack, and dierential attack.
1. Introduction
The end of the 20th century was marked by an extraordinary
technical revolution from analog to numerical as docu-
ments and equipments became increasingly used in various
domains. However, the advantages of the digital revolution
were not achieved without drawbacks such as illegal copying
and distribution of digital multimedia documents. To meet
this challenge, researchers were motivated more than ever
to protect multimedia documents with new and ecient
document protection techniques. In this context, dierent
techniques have been introduced such as encryption and
digital watermarking. The first one consists in transforming
multimedia documents using an algorithm to make it
unreadable to anyone except for the legitimate users. The
second one consists of embedding digital watermarks into
multimedia documents to guarantee the ownership and the
integrity of the digital multimedia contents.
Theprotectionofimagesisofparticularinterestin
this paper. Traditional image encryption algorithms such as
private key encryption standards (DES and AES), public key
standards such as Rivest Shamir Adleman (RSA), and the
family of elliptic-curve-based encryption (ECC), as well as
the international data encryption algorithm (IDEA), may
not be the most desirable candidates for image encryption,
especially for fast and real-time communication applications.
In recent years, several encryption schemes have been
proposed [112]. These encryption schemes can be classified
into dierent categories such as value transformation [14],
pixels position permutation [58], and chaotic systems [9
12].
In the first category, Liu et al. [1]presentedan
image encryption scheme based on iterative random phase
encoding in gyrator transform domains. A two-dimensional
chaotic mapping is employed to generate many random
data for iterative random phase encoding. In [2],acolor
image encryption method using discrete fractional random
transform (DFRNT) and the Arnold transform (AT) in
the intensity-hue-saturation (IHS) color space has been
proposed. Each color space component is then encrypted
independently with dierent approaches. In [3], an image
encryption algorithm based on Arnold transform and
gyrator transform has been proposed. The amplitude and
phase of the gyrator transform are separated into several
subimages, which are scrambled using the Arnold transform.
The parameters of gyrator transforms and separating scheme
serve as the key of the encryption method. Tao et al. [4]
proposed an image encryption algorithm based on fractional
2 Journal of Electrical and Computer Engineering
Fourier transform (FRFT) and which can be applied to
the double or more image encryptions. The encrypted
image is obtained by the summation of dierent orders of
inverse discrete fractional Fourier transform (IDFRFT) of the
interpolated subimages. The whole transform orders of the
utilized FRFT are used as the secret keys for the decryption
of each subimage.
In the second category, Zunino [5] use Peano-Hilbert
curves as pixels position permutation to destroy the spatial
autocorrelation of an image. Zhang and Liu [6] proposed
image encryption scheme based on permutation-diusion
architecture and skew tent map system. In the proposed
scheme, the P-box is chosen as the same size of original
image, which shues the positions of pixels totally. To
enhance the security, the keystream in the diusion step
depends on both the key and original image. Zhao and
Chen [7] proposed to used ergodic matrices for scrambling
and encryption of digital images. The authors analyzed
the isomorphism relationship between ergodic matrices
and permutation. Zhu et al. [8] proposed an innovative
permutation method to confuse and diuse the gray-scale
image at the bitlevel, which changes the position of the pixel
and modifies its value. This algorithm uses also the Arnold
cat map to permute the bits and the logistic map to further
encrypt the permuted image.
In the third category, Huang and Nien [9] proposed
a novel pixel shuing method for color image encryption
which used chaotic sequences generated by chaotic systems
as encryption codes. In [10], the two-dimensional chaotic
cat map has been generalized to three-dimensional one
and then was used to design a fast and secure symmetric
image encryption scheme. This scheme employs the 3D
cat map to shue the positions and the values of image
pixels. Wang et al. [11] presented an image encryption
algorithm based on simple Perceptron and using a high-
dimensional chaotic system in order to produce three sets
of pseudorandom sequence. Then to generate weight of
each neuron of perceptron as well as a set of input signal,
a nonlinear strategy is adopted. Recently, a new image
encryption algorithm combining permutation and diusion
was proposed by Wang et al. [12]. The original image is
partitioned into blocks and a spatiotemporal chaotic system
is then employed to generate the pseudorandom sequence
used for diusing and shuing these blocks.
Thesecurityofimageencryptionhasbeenextensively
studied. Almost some encryption schemes based on per-
mutation had already been found insecure against the
ciphertext-only and known/chosen-plaintext attacks, due to
the high information redundancy, and it is quite under-
standable since the secret permutations can be recovered
by comparing the plaintexts and the permuted ciphertexts.
Generally, chaos-based image encryption algorithms are
used more often than others but require high computational
cost. Moreover, a chaos system is defined on real numbers
while the cryptosystems are defined on finite sets of integers.
One-dimensional chaotic cryptosystems are limited by their
small key spaces and weak security in [1, 13].
In this paper, we present a novel image encryption
algorithm based on the principle of Rubik’s cube. First-, in
order to scramble the pixels of gray-scale original image the
principle of Rubiks cube is deployed which only changes the
position of the pixels. Using two random secret keys, the
bitwise XOR is applied into the odd rows and columns. Then,
the bitwise XOR is also applied to even rows and columns
using the flipped secret keys. These steps can be repeated
while the number of iteration is not reached. Numerical
simulation has been performed to test the validity and the
security of the proposed encryption algorithm.
The remaining of this paper is organized as follows.
Section 2 describes the proposed image encryption algorithm
based on Rubik’s cube principle. Experimental results and
security analysis are presented in Section 3. Finally, we
conclude in Section 4.
2. Rubik’s Cube Image Encryption
In this section, the proposed encryption algorithm based on
Rubik’s cube principle is described along with the decryption
algorithm.
2.1. Rubik’s Cube Based Encryption Algorithm. Let I
o
repre-
sent an α-bit gray scale image of the size M
× N.Here,I
o
representthepixelsvaluesmatrixofimageI
o
. The steps of
encryption algorithm are as follows:
(1) Generate randomly two vectors K
R
and K
C
of length
M and N, respectively. Element K
R
(i)andK
C
( j)Each
take a random value of the set A
={0, 1, 2, ...,2
α
1}. Note that both K
R
and K
C
must not have constant
values.
(2) Determine the number of iterations, ITER
max
,and
initialize the counter ITER at 0.
(3) Increment the counter by one: ITER
= ITER + 1.
(4) For each row i of image I
o
,
(a) compute the sum of all elements in the row i,
this sum is denoted by α(i)
α
(
i
)
=
N
j=1
I
o
i, j
, i = 1, 2, ..., M,
(1)
(b)computemodulo2ofα(i), denoted by M
α(i)
,
(c) row i is left, or right, circular-shifted by K
R
(i)
positions (image pixels are moved K
R
(i)posi-
tions to the left or right direction, and the first
pixel moves in last pixel.), according to the
following:
if M
α(i)
= 0 −→ right circular shift
else
−→ left circular shift.
(2)
(5) For each column j of image I
o
,
Journal of Electrical and Computer Engineering 3
(a) compute the sum of all elements in the column
j, this sum is denoted by β( j),
β
j
=
M
i=1
I
o
i, j
, j = 1, 2, ..., N,
(3)
(b)computemodulo2ofβ( j), denoted by M
β( j)
.
(c) column j is down, or up, circular-shifted by
K
C
(i) positions, according to the following:
if M
β( j)
= 0 −→ up circular shift
else
−→ down circular shift.
(4)
Steps 4 and 5 above will create a scrambled image,
denoted by I
SCR
.
(6) Using vector K
C
, the bitwise XOR operator is applied
toeachrowofscrambledimageI
SCR
using the
following expressions:
I
1
2i 1, j
=
I
SCR
2i 1, j
K
C
j
,
I
1
2i, j
=
I
SCR
2i, j
rot 180
K
C
j

,
(5)
where
and rot 180(K
C
) represent the bitwise XOR operator
and the flipping of vector K
C
from left to right, respectively.
(7) Using vector K
R
, the bitwise XOR operator is applied
to each column of image I
1
using the following
formulas:
I
ENC
i,2j 1
= I
1
i,2j 1
K
R
j
,
I
ENC
i,2j
=
I
1
i,2j
rot 180
K
R
j

.
(6)
with rot 180(K
R
) indicating the left to right flip of vector K
R
.
(8) If ITER
= ITER
max
, then encrypted image I
ENC
is
created and encryption process is done; otherwise,
the algorithm branches to step 3.
Ve c t or s K
R
, K
C
and the max iteration number ITER
max
are considered as secret keys in the proposed encryption
algorithm. However, to obtain a fast encryption algorithm it
is preferable to set ITER
max
= 1 (single iteration). Converse-
ly, if ITER
MAX
> 1, then the algorithm is more secure because
the key space is larger than for ITER
MAX
= 1. Nevertheless,
in the simulations presented in Section 3, the number of
iterations ITER
max
was set to one.
2.2. Rubik’s Cube Dec ryption Algorithm. The decrypted im-
age, I
o
, is recovered from the encrypted image, I
ENC
, and the
secret keys, K
R
, K
C
,andITER
max
as follows in the following.
(1) Initialize ITER
= 0.
(2) Increment the counter by one: ITER
= ITER + 1.
(3) The bitwise XOR operation is applied on vector K
R
andeachcolumnoftheencryptedimageI
ENC
as
follows:
I
1
i,2j 1
=
I
ENC
i,2j 1
K
R
j
,
I
1
i,2j
=
I
ENC
i,2j
rot 180
K
R
j

,
(7)
(4) Then, using the K
C
vector, the bitwise XOR operator
is applied to each row of image I
1
:
I
SCR
2i 1, j
=
I
1
2i 1, j
K
C
j
,
I
SCR
2i, j
=
I
1
2i, j
rot 180
K
C
j

.
(8)
(5) For each column j of the scrambled image I
SCR
,
(a) compute the sum of all elements in that column
j,denotedasβ
SCR
( j):
β
SCR
j
=
M
i=1
I
SCR
i, j
, j = 1, 2, ..., N,(9)
(b)computemodulo2ofβ
SCR
( j), denoted by
M
β
SCR
( j)
,
(c) column j is down, or up, circular-shifted by
K
C
(i) positions according to the following:
if M
β
SCR
( j)
= 0 −→ up circular shift
else
−→ down circular shift.
(10)
(6) For each row i of scrambled image I
SCR
,
(a) compute the sum of all elements in row i, this
sum is denoted by α
SCR
(i):
α
SCR
(
i
)
=
N
j=1
I
SCR
i, j
, i = 1, 2, ..., M,
(11)
(b) compute modulo 2 of α
SCR
( j), denoted by
M
α
SCR
( j)
,
(c) row i is then left, or right, circular-shifted by
K
R
(i) according to the following:
if M
α
SCR
( j)
= 0 −→ right circular shift
else
−→ left circular shift.
(12)
(7) If ITER
= ITER
max
, then image I
ENC
is decrypted
and the decryption process is done; otherwise, the
algorithm branches back to step 2.
4 Journal of Electrical and Computer Engineering
Table 1: Dierence measures between original and encrypted
images.
Image NPCR (in %) UACI (in %)
Lena 99.5850 28.6210
Black 99.6078 50.1931
Baboon 99.6094 27.4092
Checkerboard 99.6201 50.0233
3. Experimental Results
In this section, we present the tests that were conducted
to assess the eciency and security of the proposed image
encryption algorithm. These tests involve visual testing and
security analysis.
3.1. Visual Testing. For visual testing, four gray-scale images
of size 256
× 256 pixels were used. Figure 1 depicts these
test images—lena, black, baboon and checkerboard
as well as the images encrypted using the proposed Rubik’s
cube algorithm. From this figure, one can see that there is
no perceptual similarity between original images and their
encrypted counterparts.
The encrypted image should greatly dier from its
original form. In general, two dierence measures are used
to quantify this requirement. The first measure is the number
of pixels change rate (NPCR), which indicate the percentage
of dierent pixels between two images. The second one is the
unified average changing intensity (UACI), which measures
the average intensity of dierences in pixels between two
images [10]. Let I
o
(i, j)andI
ENC
(i, j) be the pixels values of
original and encrypted images, I
o
and I
ENC
, at the ith pixel
row and jth pixel column, respectively. Equations (13)and
(15) give the mathematical expressions of the NPCR and
UACI measures:
NPCR
=
M
i=1
N
j=1
D
i, j
M × N
× 100%,
(13)
with : D
i, j
=
0ifI
o
i, j
= I
ENC
i, j
,
1 otherwise.
(14)
UACI
=
M
i=1
N
j=1
I
o
i, j
I
ENC
i, j
255
×
100%
M × N
.
(15)
To approach the performances of an ideal image encryp-
tion algorithm, NPCR values must be as large as possible and
UACI values must be around 33%. Table 1 gives the NPCR
and UACI values for the original images and their encrypted
versions. The values are very close to unity for the NPCR
measure. The UACI values are also appropriate. The high
percentage values of the NPCR measure indicate that the
pixels positions have been randomly changed.
Furthermore, the UACI values show that almost all pixel
gray-scale values of encrypted image have been changed from
their values in the original images, making the original and
encrypted image pixels more dicult to discriminate. It iss
also observed that the UACI values for the case of the black
Table 2: Number of pixel change rate (NPCR) between images
encrypted with keys K
1
and K
2
(with 1 bit dierence).
Image Mean (%) Standard deviation (%)
Lena 99.6111 0.0251
Black 99.6064 0.0238
Baboon 99.6085 0.0253
Checkerboard 99.6113 0.0274
and the checkerboard images are larger than those of the
other images. This is due to the fact that all the pixels values
of the black and checkerboard images are at the extremity
of pixels values range, that is, 0 for the black pixels and 255
for the white pixels, leading to a large absolute dierence
between the original and encrypted images.
3.2. Security Analysis. Security is a major issue in cryptology.
A good image encryption scheme should resist various
attacks such as known plain text attack, cipher-text-only
attack, statistical analysis attack, and brute-force attacks.
In this section, a security analysis on the proposed image
encryption algorithm is done. The security assessment has
been done on key space analysis and statistical analysis.
3.2.1. Key Space Analysis. A secure image encryption scheme
must have a large key space in order to make brute-force
attack practically (computationally) infeasible. In theory, the
proposed algorithm can accommodate an infinite key space.
However, the encryption key used in our scheme is composed
of the (K
R
, K
C
,ITER
max
) triplet. For an α-bit gray-scale image
I
o
of size M × N pixels, the vectors K
R
and K
C
can take
2
M·α
and 2
N·α
possible values, respectively. If we consider
that both vectors must not have constant values, and the key
spacesizeis2
α·(M+N)
× ITER
max
2
2α
keys, one can see that
the size of the key space can be expanded when the number
of iteration ITER
max
is increased. For instance, for an 8-bits,
scale gray image of size 256
× 256 pixels and ITER
max
= 1.
Thekeyspacesizeisequalto2
4096
2
16
10
1233
; this key
space is large enough to resist exhaustive attack and it is larger
than the key space size of the image encryption algorithms
proposed in [1, 9, 10, 1416].
3.2.2. Key Sensibility. Encryption algorithms should also
have high sensibility to encryption key: this means that any
small change in the key should lead to a significant change in
the encrypted, or decrypted, image. We performed two tests
to illustrate the key sensibility of our scheme. The first one
shows the impact of a key change in the image encryption
process. Here, the original image, I
o
, is encrypted using the
key K
1
= (K
R
, K
C
,ITER
max
), where K
R
, K
C
,andITER
MAX
are randomly generated. Then, the same image, that is, I
o
,
is encrypted using another key K
2
which diers only from
the first key, K
1
, in the least significant bit, that is, K
2
=
(K
R
, K
C
,ITER
max
+ 1). This experiment is repeated 100 times
using dierent key pairs K
1
and K
2
(still only diering by
the least significant bit). Table 2 represents the mean and
the standard deviation of the NPCR values between the
Journal of Electrical and Computer Engineering 5
(a) Lena (original) (b) Lena (encrypted)
(c) Black (original) (d) Black (encrypted)
(e) Baboon (original) (f) Baboon (encrypted)
(g) Checkerboard (original) (h) Checkerboard (encrypted)
Figure 1: Original and encrypted images.
6 Journal of Electrical and Computer Engineering
(a) Original image: Lena
(b) Encrypted image (a)
with key K
1
(c) Encrypted image (a)
with key K
2
(d) Image dierence be-
tween (b) and (c)
(e) Original image: Black (f) Encrypted image (e)
with key K
1
(g) Encrypted image (e)
with key K
2
(h) Image: dierence be-
tween (f) and (g)
(i) Original image:
Baboon
(j) Encrypted image (i)
with key K
1
(k) Encrypted image (i)
with key K
2
(l) Image dierence be-
tween (j) and (k)
(m) Original image:
Checkerboard
(n) Encrypted image (m)
with key K
1
(o) Encrypted image (m)
with key K
2
(p) Image: dierence be-
tween (n) and (o)
Figure 2: Key sensibility for image encryption using the proposed algorithm.
encrypted image with key K
1
and the encrypted image using
the key K
2
using 100 dierent key pairs. One can see from
Ta bl e 2 that the mean values of NPCR are close to 100%,
which means that image encrypted by the key K
1
diers
significantly from the one encrypted by key K
2
.Moreover,
standard deviation values are very small: this indicates that
the NPCR values are clustered closely around the mean.
Figure 2 represents the original images, their encrypted
images using two dierent keys K
1
and K
2
and the image
dierence between the encrypted images, respectively. As
mentioned earlier, keys K
1
and K
2
dier only by one bit.
The second test consists of measuring the key sensibility
in the image decryption process. Let original image I
o
be
encrypted using the key K
1
= (K
R
, K
C
,ITER
MAX
), where K
R
,
K
C
,andITER
MAX
are again randomly generated, to give the
encrypted image I
ENC
. This image is decrypted separately
using the keys K
1
and K
2
; these keys always dier by only
one bit in the least significant bit location. Figure 3 illustrates
the original image, the encrypted image I
ENC
with key K
1
,
the decrypted image of I
ENC
using correct key K
1
, and the
decrypted image of I
ENC
using the wrong key K
2
.Itisclear
from this figure that decryption using a wrong key does not
succeed.
3.3. Statistical Analysis. In a paper published in 1949 [17],
Shannon stated that It is possible to solve many kinds of
ciphers by statistical analysis. Consequently, he suggested
two methods based on confusion and diusion in order to
counteract powerful attacks based on statistical analysis. In
Journal of Electrical and Computer Engineering 7
(a) Original image: Lena (b) Encrypted image (a) with
key K
1
(c) Decrypted image (b) using
correct key K
1
(d) Decrypted image (b) using
wrong key K
2
(e) Original image: Black (f) Encrypted image (e) with
key K
1
(g) Decrypted image (f) using
correct key K
1
(h) Decrypted image (f) using
wrong key K
2
(i) Original image: Baboon (j) Encrypted image (i) with
key K
1
(k) Decrypted image (j) using
correct key K
1
(l) Decrypted image (j) using
wrong key K
2
(m) Original image:
Checkerboard
(n) Encrypted image (m) with
key K
1
(o) Decrypted image (n) using
correct key K
1
(p) Decrypted image (n) using
wrong key K
2
Figure 3: Key sensibility for image decryption using the proposed algorithm.
the present paper, statistical analysis has been performed to
demonstrate the superior confusion and diusion properties
of the proposed encryption algorithm against statistical
attacks. This is done by performing two series of tests:
histograms analysis of the encrypted images and the correla-
tions computation of the adjacent pixels in encrypted images.
Figure 4 represents the histograms of the original and
the encrypted images illustrated previously in Figure 1.One
can see those the histograms of the encrypted images are
almost uniform and are significantly dierent from that of
the four original images. For instance, the histogram of
original image Checkerboard shows as expected only two
values: 0 and 255; however, the histogram of the encrypted
Checkerboard image is fairly uniform. Therefore, the
proposed image encryption algorithm responds well to the
diusion properties: it does not provide information that can
be exploited for attacks based on statistical analysis of the
encrypted image.
The other statistical test consists of computing the
correlation between adjacent pixels [10]. It is obvious
8 Journal of Electrical and Computer Engineering
20 60 100 140 180 220 255
0
100
200
300
400
500
600
700
800
Number of pixels
(a) Original image: Lena
20 60 100 140 180 220 255
0
100
200
300
400
500
600
700
800
Number of pixels
(b) Encrypted image: Lena
0
1
2
3
4
5
6
×10
4
Number of pixels
20 60 100 140 180 220 255
(c) Original image: Black
20 60 100 140 180 220 255
0
100
200
300
400
500
600
700
800
Number of pixels
(d) Encrypted image: Black
0
100
200
300
400
500
600
700
800
900
Number of pixels
20 60 100 140 180 220 255
(e) Original image: Baboon
0
100
200
300
400
500
600
700
800
900
Number of pixels
20 60 100 140 180 220 255
(f) Encrypted image: Baboon
×10
4
Number of pixels
Grayscale
20 60 100 140 180 220
0
1
1.5
2
2.5
3
0.5
(g) Original image: Checkerboard
Grayscale
20 60 100 140 180 220 255
0
100
200
300
400
500
600
700
800
Number of pixels
(h) Encrypted image: Checkerboard
Figure 4: Histograms of original and encrypted images.
Journal of Electrical and Computer Engineering 9
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
Correlation coecient = 0.9763
20 60 100 140 180 220 255
(a) Image: Lena
Correlation coecient = 0.0068
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
20 60 100 140 180 220 255
(b) Encrypted image: Lena
Correlation coecient = 1
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
20 60 100 140 180 220 255
(c) Image: Black
Correlation coecient = 0.0046
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
20 60 100 140 180 220 255
(d) Encrypted image: Black
Correlation coecient = 0.8567
20 60 100 140 180 220 255
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
(e) Image: Baboon
Correlation coecient = 0.0055
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
20 60 100 140 180 220 255
(f) Encrypted image: Baboon
Correlation coecient = 0.9578
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
Pixel gray value on location (x, y)
20 60 100 140 180 220 255
(g) Image: Checkerboard
Correlation coecient = 0.0039
0
20
40
60
80
100
120
140
160
180
200
220
240
255
Pixel gray value on location (x +1,y)
20 60 100 140 180 220 255
Pixel gray value on location (x, y)
(h) Encrypted image: Checkerboard
Figure 5: Correlation distribution of the pairs horizontal to adjacent pixels.
10 Journal of Electrical and Computer Engineering
(a) Decrypted image: Lena (b) Decrypted image: Black (c) Decrypted image: Baboon (d) Decrypted image:
Checkerboard
Figure 6: Attack by salt & pepper noise.
(a) Decrypted image: Lena (b) Decrypted image: Black (c) Decrypted image: Baboon (d) Decrypted image:
Checkerboard
Figure 7: Attack by speckle noise.
that an arbitrarily chosen pixel in an image is generally
strongly correlated with adjacent pixels, and its in either
horizontal, vertical or diagonal directions. However, a secure
image encryption algorithm must produce an encrypted
image having low correlation between adjacent pixels. This
correlation test consists of randomly selecting N pairs of
adjacent pixels (vertical, horizontal, and diagonal) from the
original and the encrypted images separately. Then, the
correlation coecientofeachpairiscalculatedusing(19)
E
(
x
)
=
1
N
N
i=1
x
i
, (16)
D
(
x
)
=
1
N
N
i=1
(
x
i
E
(
x
))
2
, (17)
cov
x, y
=
1
N
N
i=1
(
x
i
E
(
x
))
y
i
E
y

, (18)
γ
xy
=
cov
x, y
D
(
x
)
D
y
with D
(
x
)
/
= 0, D
y
/
= 0,
(19)
where x
i
and y
i
are the grayscale values of two adjacent pixels,
N is the number of pairs (x
i
, y
i
), and E(x)andE(y), are
respectively, the mean values of x
i
and y
i
.
Ta bl e 3 gives the correlation coecient values of adjacent
pixels in the horizontal, vertical, and diagonal directions of
the original images and their encrypted versions. It is clear
Table 3: Correlation coecients between adjacent pairs of pixels
for original and encrypted images.
Correlation Horizontal Vertical Diagonal
Original image: lena 0.9763 0.9453 0.9282
Encrypted image: lena 0.0068 0.0091 0.0063
Original image: black 1.0000 1.0000 1.0000
Encrypted image: black 0.0046 0.0055 0.0056
Original image: baboon 0.8567 0.8772 0.7880
Encrypted image: baboon 0.0055 0.0078 0.0042
Original image: checkerboard 0.9578 0.9521 0.9118
Encrypted image: checkerboard 0.0039 0.0090 0.0045
that for the original images, the coecient correlation values
are very high (close to one) contrary to those observed for
the encrypted images. This confirms that adjacent pixels in
the original images are strongly correlated. However, for the
encrypted images, those values are close to zero, which means
that the adjacent pixels (horizontal, vertical and diagonal
directions) are very weakly correlated. Figure 5 illustrates the
correlation distributions of the horizontal adjacent pixels of
the original images and the corresponding encrypted images
using the proposed algorithm. One can see from Figure 5 that
adjacent pixels in encrypted images are indeed very weakly
correlated.
3.4. Entropy Analysis. The concept of entropy analysis for
image encryption algorithm was introduced by Edward [18].
Journal of Electrical and Computer Engineering 11
(a) Encrypted lena image (b) Encrypted black image (c) Encrypted baboon image (d) Encrypted checkerboard
image
(e) Image (a) decrypted (f) Image (b) decrypted (g) Image (c) decrypted (h) Image (d) decrypted
Figure 8: Encrypted images under cropping attack in center (cropping over 1/8 of the entire image area).
Table 4: Comparison of entropy values of original images and their
encrypted version.
Image Original Encrypted
Lena 7.4318 Sh 7.9968 Sh
Black 0 Sh 7.9966 Sh
Baboon 7.2279 Sh 7.9974 Sh
Checkerboard 1 Sh 7.9972 Sh
Table 5: Comparison of entropy values of encrypted images under
dierent image encryption algorithms.
Algorithm Entropy (Sh)
Proposed algorithm 7.9968
Baptista [19] 7.9260
Wong et al . [ 20] 7.9690
Xiang et al. [21] 7.9950
Lin and Wang [22] 7.9890
For gray-scale images of 256 levels, if each level of gray
is assumed to be equiprobable, then the entropy of this
image will be theoretically equal to 8 Sh (or bits). Ideally,
an algorithm for encryption of images should give an
encrypted image having equiprobable gray levels. Table 4
gives the entropy values of the four original images and those
of their encrypted versions.
From those entropy values, we note that the entropy
values of original images are far from ideal value of entropy
since information sources are highly redundant and thus
rarely generate uniformly distributed random messages. On
the other hand, the entropy values of the encrypted images
are very close to the ideal value of 8 Sh, which means that
the proposed encryption algorithm is highly robust against
entropy attacks.
Ta bl e 5 gives a comparison of the entropy values for
encrypted image Lena with various image encryption algo-
rithms.
3.5. Analysis against Attacks. An attacker who intercepts
encrypted image can easily modify it, while the legitimate
user can receive it and decrypt it successfully. This is the
principle of attacks in image encryption; these attacks can
include additive noise, filtering, rotation and cropping, and
so forth.
3.5.1. Additive Noise. To verify the performance of the
proposed encrypted algorithm against additive noise attacks,
we considered two types of noises: salt and pepper noise and
speckle noise. An additive noise attack consists in adding
random noise to the intercepted encrypted image. Then,
the noisy encrypted image will be decrypted. To measure
the robustness of the proposed image encryption algorithm
against this attack, mean squared error (MSE) measures are
used.
Ta bl e 6 gives the MSE values between original images
and their decrypted ones under the salt and pepper noise
with dierent noise density values and the speckle noise with
dierent variances.
Figures 6 and 7 illustrate the decrypted images: their
encrypted version has been attacked separately by salt &
pepper noise with 0.05 density and by speckle noise of
variance 0.05. From these results, we can conclude that
random noise attacks seriously aect decrypted images.
12 Journal of Electrical and Computer Engineering
Table 6: MSE between original images and the decrypted versions under dierent noise attacks.
Image
Salt and pepper noise Speckle noise
Density MSE Variance MSE
Lena
0.05 3.42
× 10
3
0.05 5.30 × 10
3
0.1 3.68 × 10
3
0.1 5.79 × 10
3
Black
0.05 1.06
× 10
3
0.05 8.11 × 10
3
0.1 2.20 × 10
3
0.1 1.02 × 10
4
Baboon
0.05 2.38
× 10
3
0.05 3.97 × 10
3
0.1 2.49 × 10
3
0.1 4.50 × 10
3
Checkerboard
0.05 2.44
× 10
4
0.05 2.12 × 10
4
0.1 2.50 × 10
4
0.1 2.19 × 10
4
Table 7: MSE between original images and the decrypted versions
under cropping attack.
Image Center cropping Sides cropping
Lena 2.96 × 10
3
2.90 × 10
3
Black 2.72 × 10
3
2.69 × 10
3
Baboon 2.05 × 10
3
2.02 × 10
3
Checkerboard 1.81 × 10
4
1.64 × 10
4
Table 8: Speed test results of the proposed algorithm with image
Lena using a 2.7 GHz personal computer.
Image size Encryption time Decryption time
64 × 64 0.03 s 0.03 s
128
× 128 0.04 s 0.04 s
256
× 256 0.12 s 0.12 s
512
× 512 0.66 s 0.66 s
1024
× 1024 5.40 s 5.40 s
3.5.2. Analysis against Cropping Attacks. The cropping
attacks consist of modifying the intercepted encrypted image
by deleting one or several areas of the image. Table 7 gives
the MSE values between original images and the decrypted
and cropped images either in their center or on the image
sides with parameter values equal to 1/8. This one indicates
the fraction of the encrypted image that has been cropped.
Figure 8 represents the encrypted images cropped in the
center and their decrypted versions. From these results, we
can conclude that the proposed image encryption algorithm
resists to this attack lightly.
3.6. Speed Test. Apart from security considerations, another
important consideration in the design of image encryption
techniques is the actual algorithm execution speed, partic-
ularly for real-time applications. The proposed encryption
algorithm is indeed very fast compared to other algorithms
[10]. Our experimental results show that the average speed
for encryption and for decryption is of around 0.9 Mb/s
(megabits per second). The peak speed can reach up to
2.2 Mb/s on personnel computer equipped with an AMD
Athlon processor with clock speed of 2.70 GHz, 1 GB (giga-
bytes) of RAM memory and 160 GB hard-disk capacity.
Ta bl e 8 illustrates the performance of the proposed
algorithm using original image Lena with dierent sizes
ranging from 64
× 64 to 1024 × 1024 pixels. The proposed
algorithm was written using the MATLAB software platform.
4. Conclusion
In this paper, a novel image encryption algorithm is pro-
posed. This algorithm is based on the principle of Rubik’s
cube to permute image pixels. To confuse the relationship
between original and encrypted images, the XOR operator is
applied to odd rows and columns of image using a key. The
same key is flipped and applied to even rows and columns of
image. Experimental tests have been carried out with detailed
numerical analysis which demonstrates the robustness of the
proposed algorithm against several types of attacks such as
statistical and dierential attacks (visual testing). Moreover,
performance assessment tests demonstrate that the proposed
image encryption algorithm is highly secure. It is also capable
of fast encryption/decryption which is suitable for real-time
Internet encryption and transmission applications.
References
[1] Z. Liu, L. Xu, C. Lin, J. Dai, and S. Liu, “Image encryption
scheme by using iterative random phase encoding in gyrator
transform domains,Optics and Lasers in Engineering, vol. 49,
no. 4, pp. 542–546, 2011.
[2] Q. Guo, Z. Liu, and S. Liu, “Color image encryption by using
Arnold and discrete fractional random transforms in IHS
space, Optics and Lasers in Engineering, vol. 48, no. 12, pp.
1174–1181, 2010.
[3] Z. Liu, H. Chen, T. Liu et al., “Image encryption by using
gyrator transform and Arnold transform, Journal of Electronic
Imaging, vol. 2, no. 4, pp. 345–351, 1993.
[4] R.Tao,X.Y.Meng,andY.Wang,“Imageencryptionwithmul-
tiorders of fractional fourier transforms, IEEE Transactions on
Information Forensics and Security, vol. 5, no. 4, pp. 734–738,
2010.
[5] R. Zunino, “Fractal circuit layout for spatial decorrelation of
images, Electronics Letters, vol. 34, no. 20, pp. 1929–1930,
1998.
[6] G. Zhang and Q. Liu, A novel image encryption method
based on total shuing scheme,Optics Communications, vol.
284, no. 12, pp. 2775–2780, 2011.
Journal of Electrical and Computer Engineering 13
[7] X.-Y. Zhao and G. Chen, “Ergodic matrix in image encryp-
tion, in Proceedings of the 2nd International Conference on
Image and Graphics, vol. 4875, pp. 394–401, August 2002.
[8] Z.-L. Zhu, W. Zhang, K.-W. Wong, and H. Yu, A chaos-
based symmetric image encryption scheme using a bit-level
permutation, Information Sciences, vol. 181, no. 6, pp. 1171–
1186, 2011.
[9] C. K. Huang and H. H. Nien, “Multi chaotic systems based
pixel shue for image encryption, Optics Communications,
vol. 282, no. 11, pp. 2123–2127, 2009.
[10] G. Chen, Y. Mao, and C. K. Chui, A symmetric image en-
cryption scheme based on 3D chaotic cat maps, Chaos,
Solitons and Fractals, vol. 21, no. 3, pp. 749–761, 2004.
[11] X. Y. Wang, L. Yang, R. Liu, and A. Kadir, A chaotic image
encryption algorithm based on perceptron model, Nonlinear
Dynamics, vol. 62, no. 3, pp. 615–621, 2010.
[12] Y. Wang, K. W. Wong, X. Liao, and G. Chen, A new
chaos-based fast image encryption algorithm, Applied Soft
Computing Journal, vol. 11, no. 1, pp. 514–522, 2011.
[13] S. Li, C. Li, G. Chen, N. G. Bourbakis, and K. T. Lo, “A general
quantitative cryptanalysis of permutation-only multimedia
ciphers against plaintext attacks, Signal Processing: Image
Communication, vol. 23, no. 3, pp. 212–223, 2008.
[14] C. K. Huang, H. H. Nien, S. K. Changchien, and H. W. Shieh,
“Image encryption with chaotic random codes by grey rela-
tional grade and Taguchi method, Optics Communications,
vol. 280, no. 2, pp. 300–310, 2007.
[15] S. Mazloom and A. M. Eftekhari-Moghadam, “Color image
encryption based on Coupled Nonlinear Chaotic Map, Chaos,
Solitons and Fractals, vol. 42, no. 3, pp. 1745–1754, 2009.
[16] Y. Tang, Z. Wang, and J. A. Fang, “Image encryption using
chaotic coupled map lattices with time-varying delays, Com-
munications in Nonlinear Science and Numerical Simulation,
vol. 15, no. 9, pp. 2456–2468, 2010.
[17] C. E. Shannon, “Communication theory of secrecy systems,
Bell System Technical Journal, vol. 28, no. 4, pp. 656–715, 1949.
[18] O. Edward, Chaos in Dynamical Systems, Cambridge Univer-
sity Press, Cambridge, UK, 2nd edition, 2003.
[19] M. S. Baptista, “Cryptography with chaos, Physics Letters,
Section A, vol. 240, no. 1-2, pp. 50–54, 1998.
[20] K. W. Wong, S. W. Ho, and C. K. Yung, A chaotic cryptog-
raphy scheme for generating short ciphertext, Physics Letters,
Section A, vol. 310, no. 1, pp. 67–73, 2003.
[21] T. Xiang, X. Liao, G. Tang, Y. Chen, and K. W. Wong, “A novel
block cryptosystem based on iterating a chaotic map, Physics
Letters, Section A, vol. 349, no. 1–4, pp. 109–115, 2006.
[22] Z. Lin and H. Wang, “Ecient image encryption using a
chaos-based PWL memristor,IETE Technical Review, vol. 27,
no. 4, pp. 318–325, 2010.
    • "Figure 4shows a Baker map randomization of an (8 x 8) matrix (M=8). Here the secret key is S= [2, 4, 2] . "
    [Show abstract] [Hide abstract] ABSTRACT: In the field of digital and multimedia applications, more multimedia data are developed and transmitted in art, entertainment, advertising, commercial areas, education and training through the networks, which may have important information that should not be accessed by the unauthorized persons. Therefore issue of protecting the confidentiality, integrity, security, privacy as well as the authenticity of images has become an important issue for communication and storage of images. In this paper an efficient method for image encryption based on Rubik's cube principle with chaotic Baker map is presented. It consists of two layers. The first layer is a preprocessing layer used to improve the security of the system which is implemented with the chaotic baker map. In the second layer, the Rubik's cube principle is utilized. The original image is first converted in to baker mapped image and then Rubik's cube principle is applied. The proposed technique will enhance the security level of the Rubik's cube encryption technique.
    Full-text · Article · Dec 2016
    • "Table 12 gives the comparison of the execution time for the proposed method and existing methods. From the tabulated values, it is observed that the execution time of proposed method is less when compared with those methods suggested in [6,[27][28][29]. "
    [Show abstract] [Hide abstract] ABSTRACT: Internet is an important part in the daily life of people in many ways, which allows the people in any corner of the world to share all types of information. Image encryption is used to transmit sensitive multimedia information in unsecured networks to provide high degree of confidentiality. In this paper, a new image encryption method is proposed based on novel implementation of pixel scan, utilizing the Knight's Travel Path, and true random number. The Knight's travel path is a pattern in which the path of a Knight around a chess board is taken without revisiting any node. This travel path pattern is used to permute the pixel positions of the original image to obtain the scrambled image. The scrambled image is further XORed with the random key numbers to get the cipher image. To change the pixel values of the scrambled image, true random numbers are generated from the amplitude values of a chosen noise audio file. Decryption is performed to confirm the reception of the sent image. The proposed method resists the statistical, differential, and entropy attacks significantly which have been demonstrated with various standard images.
    Article · Jan 2016
    • "Traditional image encryption algorithms, for instance, private key encryption standards (DES and AES) faces problems when used to encrypt large images and therefore, its efficiency becomes low and weak, public key standards such as Rivest Shamir Adleman (RSA), and the family of elliptic-curve-based Encryption (ECC), as well as the international data encryption algorithm (IDEA) requires a great computational time and super computers when used in encrypting real-time images, may not be the most desirable candidates for image encryption, especially for fast and realtime communication applications because of Cryptographic algorithms that use less time are much more preferable for encrypting such real-time images. Also, some encryption schemes may be run very slowly, and this increases the degree of security features, yet they would be of little use when dealing with real-time images [3]. "
    [Show abstract] [Hide abstract] ABSTRACT: Security of data is of prime importance. Security is a very complex and vast topic. One of the common ways to protect this digital data from unauthorized eavesdropping is encryption. This paper introduces an improved image encryption technique based on a chaotic 3D cat map and Turing machine in the form of dynamic random growth technique. The algorithm consists of two main sections: The first does a preprocessing operation to shuffle the image using 3D chaotic map in the form of dynamic random growth technique. The second uses Turing machine simultaneous with shuffling pixels’ locations to diffuse pixels’ values using a random key that is generated by chaotic 3D cat map. The hybrid compound of a 3D chaotic system and Turing machine strengthen the encryption performance and enlarge the key space required to resist the brute force attacks. The main advantages of such a secure technique are the simplicity and efficiency. These good cryptographic properties prove that it is secure enough to use in image transmission systems.
    Full-text · Article · Jan 2016
Show more

  • undefined · undefined
  • undefined · undefined
  • undefined · undefined

Recommended publications

Discover more