You are on page 1of 5

Journal of Electronic Engineering Research and Development (JEERD)

Volume 1, Issue 1, August 2019

Image Encryption Scheme Based on Composition of Chaotic


Maps
Su Su Maunga, Khine Thin Zarb, Ni Htwe Aungc
a,b,c
Department of Computer Engineering and Information Technology, Yangon Technological University,
11011Gyogone, Insein Township, Yangon, Myanmar
susuela@gmail.com, ngengeko@gmail.com, nhadec@gmail.com

 describes a new image encryption/decryption scheme using


Abstract— In this paper an image encryption scheme using that S-box while security analysis is made in Section 5.
dynamical 8×8 S-box, based on the composition of chaotic maps, Finally, some conclusions are discussed in Section 6.
is proposed. In this method, the dynamical 8×8 S-box is
obtained by iterating chaotic map. Firstly, the dynamical S-box
2) CHAOTIC MAPS
is produced using logistic map to generate a sequence of
pseudo-random bytes, then applies certain permutations to Chaos is a dynamical system that is extremely sensitive to
them, using the discretized version of another two dimensional its initial conditions. It is a deterministic nonlinear system
chaotic map, baker map. Secondly a sequence of that has random-like behaviors. The property that stability
pseudo-random bytes generated from two dimensional cat map may depend on initial conditions is characteristic only for
is used to index the entry of the S-box. The output 8 bits (0-255)
nonlinear systems. Chaos theory has become a new branch of
of the S-box are XOR-ed with the plaintext to produce the
ciphertext and XOR-ed with the ciphertext to produce the
different engineering and scientific studies today. Discrete
plaintext. Standard statistical tests and speed comparison of chaotic dynamic systems which are known as maps are used
other traditional encryption algorithms of this scheme are in cryptography. There are many chaotic systems such as
performed and the results of simulations show that this logistic, lorenz, chen, and chua system etc. In this paper, we
encryption scheme is secure and fast enough to be used in use logistic map, baker map and cat map.
real-time image encryption applications.
2.1) Logistic Map
Keywords—Chaos, S-box, Image Encryption, Cryptography. Logistic map is one of the simplest form of one dimensional
chaotic maps and mathematically its equation can be written
as:
1) INTRODUCTION ( ) (1)
In recent years, with the rapid growth of the Internet and the Where xn is a real value in (0,1), and μ is control parameter
multimedia technology, the security of digital information satisfying 0≤ μ ≤4. The logistic map is chaotic on the
including image, audio, and other multimedia has attracted condition 0.35699≤ μ ≤4. The map is illustrated in Fig. 1.
more and more intention. Cryptography has been used to 1
logistic map

send secure message over unsecured channel. Using chaos 0.9

0.8
for data encryption is certainly not new idea and can be 0.7

investigated into the classical Shannon’s paper [9]. Secure 0.6

communication method based on chaotic maps has been


x n+1

0.5

utilized in several different ways in cryptography [2-7]. One 0.4

or more one dimensional maps are used as pseudo-random 0.3

0.2

number generators producing a key stream which is then 0.1

XOR-ed with the plaintext to produce the ciphertext. Chaos 0


0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

based image encryption has superiority over the conventional xn

encryption methods, particularly in a good combination of Fig. 1. The logistic map


speed, security, and flexibility.
2.2) The two-dimensional Baker Map
In this paper, a method using cryptographically strong
dynamical 8×8 S-box based on composition of chaotic maps The baker map, defined by B, is described with the
is proposed. The substitution boxes (S-boxes) have been following formulas:
widely used in almost all traditional cryptographic system, ( ) ( )
such as DES, AES. RC4 which is a variable-key-size stream ( ) ( ) (2)
cipher also uses a 8×8 S-box [8]. The entries of S-box are a
permutation of the integer numbers (0-255), and the The baker map is a chaotic map from the unit square into
itself. Since an image is defined on a lattice of finitely many
permutation is a function wtih the variable-length key. To
points (pixels), a correspondingly discredited form of the
obtain dynamical 8×8 S-box, using chaotic maps is the best
basic map needs to be derived. In particular, the discredited
approach [4]. The organization of this paper is as follows. In
map is required to assign a pixel to another pixel in a bijective
Section 2, the descriptions of chaotic maps are introduced. manner. Since the discredited map is inherited the property of
Section 3 designs the dynamical 8×8 S-box and Section 4 the continuous basic map, the discredited map should become
increasingly close to the basic map as the number of pixels

1
2019, JEERD
Journal of Electronic Engineering Research and Development (JEERD)
Volume 1, Issue 1, August 2019

tends to infinity. The discredited generalized baker map will


be denoted ( ) , where the sequence of k integers,
, is chosen such that each integer , divides N, and
. Denoting , the pixel (r,
s), with
, and is mapped to
( )
( )( ) [ ] (3)
( ) (a) (b)
This formula is based on the following geometrical
considerations. A square is divided into vertical
rectangles of height N and width . Following the action of
the generalized baker map, these vertical rectangles should be
stretched in the horizontal direction and contracted in the
vertical direction to obtain a horizontal rectangle. To
achieve this for the discretized map, each vertical rectangle
is divided into boxes containing exactly
N points (see Fig. 2). Each of these boxes is mapped to a row
of pixels. Since there are boxes, a horizontal rectangle (c) (d)
is obtained, as required.
Fig. 4. Original image (a), after applying the baker map once
(b), twice (c), and nine times (d)

 2.3) The two dimensional Cat Map


The cat map is a chaotic map which is two dimensional and
invertible introduced by Arnold and Avez. The mathematical
formula is:

[ ] [ ][ ]

( ) (4)
where x (mod 1) means the fractional parts of a real
Fig. 2. Discretized baker map number x by subtracting or adding an appropriate integer.
The map is known to be chaotic. The unit square is first
Now, how the pixels in each box are mapped to a row of stretched by the linear transform and then folded by the
pixels need to be specified. Since the original baker map is modulo operation. The results of applying the cat map to the
continuous on each box, the only plausible discretization is to test image after 1, 2, and 9 iterations are shown in Fig.5.
map the box column by column. An example for N = 16,
is shown below. The rectangle
is mapped to a row of 16 pixels as follows in Fig. 3.
The results of applying the discretized baker map to the test
image after 1, 2, and 9 iterations are shown in Fig.4.

(a) (b)

Fig. 3. The mapping of the rectangle 8 × 2 to a row of 16 (c) (d)


pixels
Fig. 5. Original image (a), after applying the and cat map
once (b), twice (c), nine times (d)

2
2019, JEERD
Journal of Electronic Engineering Research and Development (JEERD)
Volume 1, Issue 1, August 2019

I. An example of 8x8 S-box

105 208 122 96 123 3 246 144 98 126 102 224 236 9 52 41
1 64 32 163 52 73 175 6 241 215 28 156 132 202 11 41
40 238 54 117 175 174 235 206 172 29 127 182 149 99 205 122
178 34 79 106 36 58 225 13 120 99 135 203 39 177 116 251
230 89 220 199 195 193 232 224 49 16 245 33 145 112 139 31
190 88 202 129 81 99 200 90 151 219 6 166 134 122 63 111
1 62 230 230 135 67 200 61 166 114 19 85 228 129 61 240
118 38 166 226 198 39 120 92 224 79 36 183 119 130 242 36
70 124 142 31 9 223 73 25 125 108 246 62 148 36 151 200
62 200 88 166 177 117 33 3 177 237 63 117 101 100 181 78
149 222 47 109 104 48 132 58 17 253 236 27 28 160 48 132
197 55 220 198 107 143 144 60 83 39 20 105 22 17 191 204
153 58 245 186 200 3 64 113 124 106 30 175 254 189 228 32
184 68 35 79 13 45 230 83 76 146 247 218 39 123 184 156
200 24 66 44 104 54 26 81 244 129 151 183 155 211 41 85
192 154 155 218 251 202 151 163 72 203 235 93 148 3 30 47

3) DESIGNING DYNAMICAL S-BOX BASED ON 4) ENCRYPTION SCHEME USING DYNAMICAL S-BOX


COMPOSITION OF CHAOTIC MAPS
The method is composed of two steps: First, by iterating For more randomness, the values of S-box are randomly
chaotic map, a sequence of random variables is generated and chosen by another chaotic map. The digitized value generated
turns it to a decimal integer on the range of 0-2n, then an from two dimensional cat map is used to index the entry of
integer table can be obtained. Second, a key-dependent the S-box which is XOR-ed with the values of the plain
permutation is used to shuffle the table nonlinear by a Baker image pixel. We generate pseudo-random numbers
map to achieve a more secure encryption. The shuffle table is sequences by using the cat map with parameters x0=0.1 and
the S-box which is desired. According to its own properties of y0=0.1. The generated random bytes are used to index the
sensitive dependence on initial condition and system entries of S-box. The block diagram of the system is shown in
parameter of the chaotic system, it is easy and convenient to Fig. 7. Decryption is the same as encryption.
obtain cryptographically secure pseudo-random bits with The histograms of the original images and cipher images
changing the initial condition or system parameter slightly. A are shown in Fig. 9 and Fig. 11. The histograms of cipher
different initial value and control parameter will result in a image are uniform, i.e., our cipher images hold a good
different S-box. In this paper, we employ the logistic map to confusion property on the statistics. Two-dimensional
generate the chaotic integer table, which initial value x0=0.1 discrete Fourier transform and shift zero-frequency
is chosen and the value of μ in Eq.(1) is selected as 3.9996. component of discrete Fourier transform to center of
By applying the baker map with a sequence of 6 divisors of spectrum by plotting 2 D diagram (see Fig. 12) represents
16 (2 2 4 4 2 2) nine times, we can obtain the dynamical 8×8 average distribution of spectrum energy. The result indicates
S-box. The block diagram of designing dynamical S-box is the nice diffusion characteristics.
given in Fig. 5 and the desired S-box is given in Table I.
5) SECURITY ANALYSIS AND TEST RESULTS
Initial value and
control parameter In order to test the method, we have performed certain
statistical tests. The tests we used in this paper are the
standard criteria specified in FIPS PUB 140-2 tests [10]
Logistic Map .There are four tests: Monobit test, Poker test, Runs tests and
Long run tests. To test the quality of the random bits
Sequence of Sequence of generated, we will have to test a total of sixteen items (one for
divisors pseudo-random byte
Baker Map the Monobit test, one for the Poker test, twelve for the Runs
test, and two for the Long Run test). In these statistical tests
of random numbers one considers a single bit stream of
Dynamical 8x8 S-Box 20,000 consecutive bits output from the generator. The bits
are then subjected to each of the tests below. Any failure to
pass the specified criteria means that the sequence must be
Fig. 6. Designing dynamical S-box rejected. The four tests are described below.

3
2019, JEERD
Journal of Electronic Engineering Research and Development (JEERD)
Volume 1, Issue 1, August 2019

Initial value (x0, y0) Initial value (x0, y0)

Cat Map Cat Map

Sequence of pseudo-random byte Sequence of pseudo-random byte

Dyamical 8x8 S-Box Dyamical 8x8 S-Box

8 bits 8 bits
Plaintext (8 bits) Cyphertext (8 bits) Cyphertext (8 bits) Plaintext (8 bits)

Fig. 7. Encryption and decryption schemes: (a) encryption scheme, (b) decryption scheme

(a) (b)
(a) (b) Fig. 12. The 2D Spectrum: (a) the Plane Image, (b) the
Fig. 8. Plane Images: (a) Lena, (b) Twin Encrypted Image

Monobit Test: The number of ones in the 20,000 bit


stream, here we denote X, is counted and the test is passed if
9,725 < X < 10,275.
Poker Test: The 20,000 bit stream is divided into 5,000
contiguous 4-bit segments. Count the number of occurrences
of each of the 16 possible 4-bit values and denote the number
of occurrences as f (i) where 0 ≤ i ≤ 15. Evaluate the
following:
(a) (b)
[∑ [ ( )] ] (5)
Fig. 9. Histograms of Plane Images: (a) Lena, (b) Twin
The test is passed if 2.16 < X < 46.17.
Runs Test: A run is defined as the maximal sequence of
consecutive bits of either all ones or all zeros. The runs (for
both consecutive zeros and consecutive ones) of all lengths (
≥ 1) in the sample stream are counted. The test is passed if the
number of runs is within the corresponding interval specified
in Table II. The runs of greater than 6 are considered to be of
length 6.

(a) (b) II. The required interval for runs test


Fig. 10. Encrypted Images: (a) Lena, (b) Twin
Length of Run Required Interval
1 2315-2685
2 1114-1386
3 527-723
4 240-384
5 103-209
6+ 103-209
(a) (b)
Fig. 11. Histograms of Encrypted Images: (a) Lena, (e) Twin
Long Run Test: A long run test is passed if there are no
long runs of length 26 or more (of either zeros or ones).
According to the property of high sensitive dependent on
the initial condition and system parameter of the chaotic map,

4
2019, JEERD
Journal of Electronic Engineering Research and Development (JEERD)
Volume 1, Issue 1, August 2019

a different initial value and control parameter will result in a security and faster enciphering and deciphering speeds that is
different S-box. The result of statistical test of the proposed suitable for multimedia applications. So the proposed
scheme is shown in Table III. scheme is very suitable for the real-time digital image
encryption.
III. The result of statistical test of the proposed scheme
REFERENCES

Images [1] L. Kocarev and G. Jakimoski. “Logistic map as a block encryption


Test algorithm,” Physic Letters, pp. 199-206, 2001.
Lena Twin [2] G. Jakimoski and L. Kocarev. “Chaos and Cryptography: Block
Monobit Test 9932 9981 Encryption Ciphers Based on Chaotic Maps,” IEEE Trans.
Poker Test 20.577 43.872 Circuit&Syst. I, pp.163-169, 2001.
[3] N. Masuda and K. Aihara. “Cryptosystems with Discretized Chaotic
Run Test of Run 1 2321 2461 Maps,” IEEE Trans. Circuit&Syst. I, pp. 28-40, 2002.
Run Test of Run 2 1288 1232 [4] G. Tang, X. Lieu and Y. Chen. “A novel method for designing
Run Test of Run 3 587 588 S-boxes based on chaotic maps,” Chaos, Solitons and Fractals,
Run Test of Run 4 348 323 pp.413-419, 2004.
[5] L. Shiguo, S. Jinsheng and W. Zhiquan. “A block cipher based on a
Run Test of Run 5 167 148 suitable use of the chaotic standard map,” Chaos, Solitons and
Run Test of Run 6 150 174 Fractals, pp.117-129, 2004.
Long Run Test 0 0 [6] G. Chen, Y. Mao and K. Charles and Chui. “A symmetric image
encryption scheme based on 3D chaotic cat maps, ” Chaos, Solitons
and Fractals, pp. 749-761, 2004.
Using PC which is Pentium IV 2.80GHz CPU with 704MB [7] G. Tang and X. Liao. “A method for designing dynamical S-boxes
of RAM and the Lena color image, the encryption speed is as based on discretized chaotic map,” Chaos, Solitons and Fractals,
shown in Fig. 13. Compared with traditional ciphers, the pp.1901-1909, 2005.
proposed chaos-based cryptosystem has high encryption [8] B. Schneier. (1994). Applied Cryptography, Protocols, Algorithms,
and Source Code in C.
speed. This advantage makes it suitable for large-volume [9] C. E. Shanoon. (1949). “Communication theory of secret systems.” J.
data encryption such as image. In addition, the encryption of Bell Syst. Tech.38(1).
process and decryption process are symmetric, and easy to be [10] National Institute of Standard and Technology and Communication
realized, which makes it suitable for multimedia encryption. Security Establishment, Derived Test Requirement (DTR) for FIPS
PUB 140-2, Security Requirements for Cryptographic Modules.
The graph shown in Fig.13 shows the relationship between
the encryption speed and the plaintext size. From the Fig., it
can be seen that the increase of the plaintext size, the time
difference becomes larger and larger, that is, the encryption
speed increases with the plaintext size. Therefore, for
large-volume data, the chaotic cryptosystem proposed here is
better overall.
Encryption Speed Test

0.8
AES
0.7 SAFER-K64
Blowfish
0.6
The Proposed Algorithm

0.5
Time(Sec)

0.4

0.3

0.2

0.1

0
64 4096 16384 65536
Plaintext Size (Byte)

Fig.13. Encryption Speed Test

6) CONCLUSION
In this paper, new encryption scheme using dynamical
S-box and chaotic maps has been proposed. Security analysis
and other tests of this scheme are performed. The proposed
encryption scheme passes test for FIPS PUB 140-2, Security
Requirements for Cryptographic Modules of National
Institute of Standard and Technology. To sum up, our
proposed new scheme of the chaotic image encryption has
good confusion and diffusion properties. Comparing with
existing traditional ciphers, the new scheme has higher

5
2019, JEERD

You might also like