Content uploaded by Xingyuan Wang
Author content
All content in this area was uploaded by Xingyuan Wang on May 06, 2015
Content may be subject to copyright.
Nonlinear Dyn (2010) 62: 615–621
DOI 10.1007/s11071-010-9749-8
ORIGINAL PAPER
A chaotic image encryption algorithm based on perceptron
model
Xing-Yuan Wang ·Lei Yang ·Rong Liu ·
Abdurahman Kadir
Received: 16 March 2010 / Accepted: 28 May 2010 / Published online: 22 June 2010
© Springer Science+Business Media B.V. 2010
Abstract Based on the high-dimension Lorenz cha-
otic system and perceptron model within a neural
network, a chaotic image encryption system with a
perceptron model is proposed. This paper describes
the algorithm flow in detail, and analyses the crypto-
graphic security. The experimental results show that
this algorithm has high security, and strong resistance
to the existing attack methods.
Keywords High-dimension chaotic system · Chaotic
encryption · Neuron · Perceptron model
1 Introduction
Chaos has become one of the most important research
fields in the past decade years. Almost all the scholars
are trying to apply it in the secure communication and
cryptography field with the chaotic control or synchro-
nization [1–3]. In the information subject, chaos can
be divided into two categories: one is the chaotic se-
cure communication system with chaotic synchroniza-
tion as the technical core [4–6], the other one is to con-
struct a new digital chaotic encryption algorithm using
X.-Y. Wang (
) · L. Yang · R. Liu ·A. Kadir
Faculty of Electronic Information and Electrical
Engineering, Dalian University of Technology,
Dalian 116024, China
e-mail: wangxy@dlut.edu.cn
a chaotic system based on the computer finite preci-
sion technology [7–11]. To the digital chaotic encryp-
tion algorithm, there are two typical examples: one is
proposed by Baptista in 1998 [7] and the other one is
proposed by Álvarez in 1999 [8]. Since then, there are
always new chaotic encryption algorithms and various
improved methods have been proposed. Because of the
continuous development of chaotic cryptanalysis, the
existing chaotic encryption algorithms, most of them
have potential security hazard more or less [12–14].
Anyway, it is necessary to propose and design bet-
ter ones in order to avoid the threats and resist attacks.
Therefore, this paper introduces the perceptron con-
ception of a neural network to a chaotic encryption
system, and proposes a new chaotic encryption algo-
rithm. The experimental results show that this algo-
rithm has a higher key sensitivity and better robust-
ness.
2 System description
As we know, using the low-dimension chaotic system
to design one encryption algorithm is very easy, but
some defects of the low-dimension chaotic system,
like the simple dynamic characteristic, simple cipher
code, and less determine sequence parameters, may
cause serious security problems. Compared with the
low-dimension ones, the high-dimension chaotic sys-
tem has a more complex structure, more system vari-
ables, and parameters. All of these characters assure it
can be used as a cipher key of cryptosystem. Then the
616 X.-Y. Wang et al.
Fig. 1 Chaotic dynamic behavior of Lorenz system: (a) Chaotic
track of Lorenz system, (b) chaotic attractor of Lorenz
cryptosystem’s key space will be larger, and the sys-
tem variables’ time sequence will be more erratic and
unpredictable than using the low-dimension chaotic
system. So it is better to choose a high-dimension
chaotic system to design the cryptosystem. This paper
chooses the Lorenz system
⎧
⎪
⎨
⎪
⎩
˙x =a(y −x)
˙y =cx −xz −y
˙z =xy −bz
(1)
as the encrypttext. The Lorenz system has a com-
plex inner structure. When the system parameters vary,
the system will show different period’s chaotic dy-
namic behavior. Figure 1 shows the dynamic behav-
ior of the Lorenz system when parameters are a =10,
b = 8/3, c =28 [15, 16].
3 Perceptron model
For each neuron, introduce a set of input signals,
and each signal corresponds to one weight. All in-
put weights determine the neuron’s output [17]. When
the neuron has accessed network input, there should
be an appropriate output. Each neuron should have a
threshold value. This paper uses the following thresh-
old function:
f(net)=
1, if net >θ
0, if net ≤θ
(2)
Single layer perceptron is a simple single-layer
neural network. There are no information flows among
the internal neurons, and the weights of the neuron
can be changed as the network changes. There are n
neurons and n inputs x
1
,x
2
,...,x
n
to compose the
network of perceptron model, w
ij
denotes the weight
of the ith input about the j th neuron, θ
j
is threshold
value of the j th neuron, and the output of neuron is
y
j
=
1, if
n
i=1
x
i
w
ij
≥θ
j
0, else
(3)
4 Algorithm
In this paper, in order to adjust each neuron’s weight
of the single layer perceptron dynamically and finally
output the ciphertext, a high-dimensional chaotic map
is used to generate pseudo-random sequence. The spe-
cific algorithm is as follows:
Step 1: Let Lorenz system (1) iterate 3001 times.
Throw away the numbers of previous m =3000 times
and keep the 3001th value as initial value (X,Y,Z) of
Lorenz system.
Step 2: Do 8 iterations to get (X
k
,Y
k
,Z
k
), k ∈
[1, 8]. According to the following (4) and (5), normal-
ize X
k
,Y
k
to [0, 1]
x
k
= (X
k
−X
min
)/(X
max
−X
min
) (4)
y
k
= (Y
k
−Y
min
)/(Y
max
−Y
min
) (5)
Then calculate the corresponding values x
k
and y
k
.
Here, X
max
= max{X
k
}, X
min
= min{X
k
}, Y
max
=
max{Y
k
}, Y
min
=min{Y
k
} (k =1, 2,...,8).
A chaotic image encryption algorithm based on perceptron model 617
In accordance with the following nonlinear trans-
formation rules:
keyX(k) =
1,x
k
≥0.5
0,x
k
< 0.5
(6)
keyY(k)=
1,y
k
≥0.5
0,y
k
< 0.5
(7)
the results keyX(k), keyY(k), k ∈[1, 8] will become
perceptron weight parameters. Select 8 bits in Z
8
randomly to create m, and then use the following
equations to enlarge the periodicity of the Lorenz
system. In order to enlarge the periodicity of the
high-dimension Lorenz chaotic system, (8) and (9)
are used to do the next chaotic iteration to get new
X and Y value, and Z can be set to the previous
value Z
8
w
i
=
7
k=0
keyX(k)2
k
,w
j
=
7
k=0
keyY(k)2
k
(8)
X =((w
j
⊕m)x
8
/256)(X
max
−X
min
) +X
min
Y =((w
i
⊕m)y
8
/256)(Y
max
−Y
min
) +Y
min
(9)
Step 3: Utilize the perceptron weight parameters
keyX(k), keyY(k), k ∈[1, 8] to do the following non-
linear transformation:
w
1,k
=
1, if keyX[k]=1
−1, else
(10)
w
2,k
=
1, if keyX[k]=1
−1, else
(11)
The result is each neuron’s weights of perceptron,
and the weights can be written as w
1,k
and w
2,k
c
k
=
−0.5,w
1,k
=1
0.5,w
1.k
=−1
(12)
w
1,k
=
1,w
1,k
=1
0,w
1.k
=−1
(13)
w
2,k
=
1,w
2,k
=1
0,w
2,k
=−1
(14)
θ
k
=w
1,k
⊕w
2,k
(15)
Then the other input c
k
and threshold value θ
k
(k ∈[1, 8]) can be obtained.
Fig. 2 The encryption algorithm flow
Step 4: Using stream cipher strategy to encrypt im-
age. Take one pixel p from the image. b
k
(k ∈[1, 8])
denotes the kth bit of pixel p’s value b. After en-
cryption, the ciphertext’s pixel value is b
, and b
k
(k ∈[1, 8]) denotes the kth bit of pixel value b
.The
ciphertext is
b
k
=
f(w
1,k
b
k
+w
2,k
c
k
−θ
k
), w
1,k
=1
f(w
1,k
b
k
−w
2,k
c
k
+θ
k
), w
1.k
=−1
(16)
where
f(x)=
1,x≥0
0,x<0
Step 5: Repeat step 2–step 4, until the whole image
is encrypted. Figure 2 shows the encryption flow.
5 Security analysis
Experiment environment: CPU: PentiumIV 1.4 G,
Memory: 512 M, Operating system: Windows XP,
Program language: C++.
Choose the system parameters a = 10, b = 8/3,
c = 28, and initial value X = 0, Y = 0, Z = 10
−10
.
Figure 3 shows the experimental results after using this
algorithm to encrypt the image of Lena.
5.1 Histogram analysis
Figures 4(a) and 4(b) are the histograms of Figs. 3(a)
and 3(b), respectively. Compare Fig. 4(a) with
Fig. 4(b); the latter histogram is uniformly distributed
618 X.-Y. Wang et al.
Fig. 3 The encryption
results of Lena: (a) Original
image, (b) initial value
z =10
−10
,(c)initialvalue
z =2 ×10
−10
after using the proposed encryption algorithm and it
masks Fig. 4(a)’s distribution rule, increasing the dif-
ficulty of deciphering.
5.2 The correlation of adjacent pixels
As we know, the correlation of adjacent pixels of orig-
inal image is so big that it can be broken easily by
statistical attack. 1000 pixel-pairs are selected from
Fig. 3(a) and Fig. 3(b) randomly to test the horizon-
tal and vertical correlation. Figure 5 shows the experi-
mental results about the correlation of adjacent pixels
before and after encryption. Table 1 lists the correla-
tion coefficient of vertical direction.
As Fig. 5 and Table 1 show, the correlation of adja-
cent pixels of cipher-image is much lower than that of
plain-image.
Fig. 4 Histograms of Lena: (a) Before encryption, (b) after en-
cryption
5.3 Key sensitivity analysis
Add 10
−10
to the parameter Z of system (1), and
then encrypt the original image Lena. The results are
shown in Fig. 3(c). Calculate Figs. 3(b) and 3(c)’s
NPCR [18], and it is 0.76%. This result shows that the
similarity of these two images is little. Thus, it can be
concluded that this algorithm is quite sensitive to the
key.
In order to check the system’s key sensitivity, small
changes are made to the other parameters of the keys.
It can be seen from Fig. 6 that the system is extremely
sensitive to the key, and even a very small differ-
ence with the right key will lead a failure of decryp-
tion.
A chaotic image encryption algorithm based on perceptron model 619
Fig. 5 Adjacent pixels’ horizontal correlation before and after
encryption: (a) Before encryption, (b) after encryption
Table 1 Adjacent pixels’ correlation coefficients before and af-
ter the encryption of Lena
Direction Original After encryption
Vertical 0.9484 −0.0876
Horizontal 0.9404 0.0056
5.4 Cropped and noise attack analysis
Ciphertext may lose data or influenced by noise during
transmission, so cropped and noise attack should be
considered. Figure 7(b) is the decryption result when
the ciphertext lose part of data. Except the dark clip
part cannot be recovered; others can be seen clearly.
Fig. 6 Decryption results under the wrong keys: (a) X =
0.0000001, (b) Y = 0.0000001, (c) a = 11, (d) b = 2,
(e) c =27, (f) preiteration times m =2999
Figure 8(b) is the decryption result after noise attack.
From Fig. 8(b), it can be seen that the general outline
of the image can be decrypted correctly. This shows
that the proposed method can resist cropped and noise
attack.
6 Conclusion
This paper presents a chaotic image encryption algo-
rithm based on simple Perceptron. High-dimensional
chaotic system is used to produce three sets of pseudo-
random sequence, and two of them are normalized.
Then a nonlinear strategy is adopted, which can gen-
erate weight of each neuron of Perceptron as well as
a set of input signal. At the same time, dynamically
adjust chaotic system’s parameters, which greatly ex-
tend the periodicity of chaotic systems, and effectively
solve the cycle state issues caused by discrete chaotic
system.
620 X.-Y. Wang et al.
Fig. 7 Cropped attack experiment: (a) cropped attack image,
(b) decryption result
Acknowledgements This research is supported by the Na-
tional Natural Science Foundation of China (No.: 60973152,
60573172), the Superior University Doctor Subject Special Sci-
entific Research Foundation of China (No.: 20070141014), and
the Natural Science Foundation of Liaoning province (No.:
20082165).
Fig. 8 Noise attack experiment: (a) noise attack image, (b)de-
cryption result
References
1. Ott, E., Grebogi, C., Yorke, J.A.: Controlling chaos. Phys.
Rev. Lett. 64, 1196–1199 (1990)
2. Pecora, L.M., Carroll, T.L.: Synchronization in chaotic sys-
tems. Phys. Rev. Lett. 64, 821–824 (1990)
A chaotic image encryption algorithm based on perceptron model 621
3. Wu, X.J., Liu, J.S., Chen, G.R.: Chaos synchronization of
Rikitake chaotic attractor using the passive control tech-
nique. Nonlinear Dyn. 53, 45–53 (2007)
4. Feki, M., Robert, B., Gelle, G., Colas, M.: Secure digital
communication using discrete-time chaos synchronization.
Chaos Solitons Fractals 18, 881–890 (2003)
5. Wang, X.Y., Duan, C.F.: Observer based chaos synchro-
nization and its application to secure communication.
J. Chin. Inst. Commun. 26, 105–111 (2005)
6. Wang, H., Han, Z.Z., Zhang, W., Xie, Q.Y.: Chaotic syn-
chronization and secure communication based on descrip-
tor observer. Nonlinear Dyn. 57, 69–73 (2009)
7. Baptista, M.S.: Cryptography with chaos. Phys. Lett. A
240, 50–54 (1998)
8. Álvarez, E., Fernández, A., García, P., Jiménez, J., Mar-
cano, A.: New approach to chaotic encryption. Phys. Lett.
A 263, 373–375 (1999)
9. Pareek, N.K., Patidar, V., Sud, K.K.: Discrete chaotic cryp-
tography using external key. Phys. Lett. A 309, 75–82
(2003)
10. Pareek, N.K., Patidar, V., Sud, K.K.: Cryptography using
multiple one-dimensional chaotic map. Commun. Nonlin-
ear Sci. Numer. Simul. 10, 715–723 (2005)
11. Wang, X.Y., Duan, C.F.: A new chaotic encryption algo-
rithm based on ergodicity. Chin. J. Comput. Phys. 23, 621–
625 (2006)
12. Wei, J., Liao, X.F., Wong, K.W., Zhou, T.: Cryptanalysis
of a cryptosystem using multiple one-dimensional chaotic
maps. Commun. Nonlinear Sci. Numer. Simul. 12, 814–822
(2007)
13. Álvarez, G., Montoya, F., Romera, M., Pastor, G.: Crypt-
analysis of a discrete chaotic cryptosystem using external
key. Phys. Lett. A 319, 334–339 (2003)
14. Li, S.J., Chen, G.R., Wong, K.W., Mou, X.Q., Cai, Y.L.:
Baptista-type chaotic cryptosystems: problems and coun-
termeasures. Phys. Lett. A 332, 368–375 (2004)
15. Lorenz, E.N.: Deterministic nonperiodic flow. J. Atmos.
Sci. 20, 130–141 (1963)
16. Adda, A.P., Naima, H.S., Hamed, A.M., Belgoraf, A.:
Lorenz’s attractor applied to the stream cipher. Chaos Soli-
tons Fractals 33, 1762–1766 (2007)
17. Jiang, Z.L.: Introduction to Artificial Neural Networks. Ad-
vanced Education Press, Beijing (2008)
18. Behnia, S., Akhshani, A., Ahadpour, S., Mahmodi, H.,
Akhavan, A.: A fast chaotic encryption scheme based on
piecewise nonlinear chaotic maps. Phys. Lett. A 366, 391–
396 (2007)