Enhancement of An Encryption System Performance Using MPI

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Enhancement of an Encryption System Performance

using MPI
Islam Amar1 Mohammed Abutaha2
1 College of Information Technology and Computer Engineering , Palestine Polytechnic University PPU ,Hebron, Palestine
2 College of Information Technology and Computer Engineering , Palestine Polytechnic University PPU, Hebron, Palestine
1 (E-mail : 161100@ppu.edu.ps)
2 (E-mail : m abutaha@ppu.edu)

Abstract—Nowadays with a tremendous speed and continuous of chaotic generator by using skew-tent and piecewise linear
development, the world’s connection to the Internet has increased chaotic map (PWLC) to encrypt images by generating a key
to a point that it has become part of their unsteady lives.Thus that exceeds 256 bit. whereas Halin pan et.al [3] in their
as technology evolves, encryption has become a priority for
our lives to protect sensitive data from hacking and piracy. paper provides an efficient way of image encryption based
However, this process takes a long time to transfer, handle and on a double logistic chaotic map by combining two chaotic
program data by the appropriate electronic means. In this paper sequence generators as a key that used to encrypt a clear image
we present a new methodology which depends on distributed to scramble image.
memory architecture based on message passing Interface( MPI)
to enhance the performance of the sequential algorithm. Our Boris and Anthony [4] in their paper, they improve architecture
results showed that the new model give 2x speed up compared and addressing thread safety of modern reliable messaging
to the previous one. software and identifying and taking advantage of inherent con-
Keywords: Message Passing Interface, Cryptography, Image currency in message-passing software itself. However Jesper
Encryption and Decryption, Security, Parallel Programming Larsson and William grop [5] surveyed and analyzed possible,
sensible, and desirable to formulate system independence by
I. I NTRODUCTION using good MPI implementation. They discuss basic MPI
In recent years encryption become an important goal to protect terminology in their paper such as general communication,
sensitive data in many aspects of life Such as medicine, collective communication likes regular, reduction, irregular
internet, and military. Most people prefer using the internet as collective and communicators and topologies of MPI. How-
a means to make communication and transmit data from one ever, Rajeev Thakur and William gropp [6] discuss and sur-
side to another. There are many forms of data transmission veyed open issue in MPI implementation such as performance,
over the internet such as text, voice, and image. In our scalability, fault tolerance, support for debugging and veri-
connected world images are widely in use. But one of the fication, virtual to physical topology, derived datatypes, col-
main issues with sending data over the internet is security lective communication, parallel I/O, one side communication
and speed. Image security means converting an image from and efficient support for MPI- THREAD-MULTIPLE. Rajeev
a readable image to an unreadable image by using a secret and William gropp [7] demonstrate and analyzed test suite
key that is not known to any user except the intended user. for evaluating the performance of MPI implementation that
Because of the human needs of real-time application such as supports MPI THREAD MULTIPLE. They show concurrent
video conferences, Air Traffic Control Systems, Networked bandwidth latency tests on MPI implementation.
Multimedia Systems, and Command Control Systems, The
This paper will present a new way to increase performance
speed nowdays is very important as long as the security. In
by using MPI technique. The methodology used is a message-
this paper, we will provide a parallel manner to encrypt the
passing Interface as a distributed memory architecture model.
image data using MPI.
A trade off between security and performance is required when II. CHAOS ENCRYPTION
developing a security systems. For achieving the purpose of Chaos is a new field of study in mathematics that studies
keeping the security high and obtaining a good performance the behavior of dynamical systems and it seems sensible to
we will review some samples of literature and make a com- changes of initial conditions. Chaos aims to provide a State
parative study of parallel and sequential encryption systems. of Turmoil, Disorder, and Disarray of the data. Chaos has a
Shung zue et.al [1] in their paper demonstrates an efficient way good feature such as randomness and non-periodic for these
of encrypting images by using a chaos theorem that provides reasons chaos consider the best way for data encryption [8],[9].
randomness and ergodicity with secure hash algorithm SHA- AbuTaha et.al [2] developed in his paper a system consist of
256. While Abutaha et.al [2] shows a new sequential model an internal state which contains two chaotic maps. The first is
skew tent map and the second is the piecewise linear chaotic Algorithm 1 PARALLEL IMAGE CHAOS ENCRYPTION ALGORITHM

map (PWLC) which generate a new efficient and randomness Input: clear image
keystream used in image and video encryption. Output: Scrambled Encrypted image
1: Convert image into bytes
III. THE PARALLEL PROPOSED CHAOS 2: Split image into 4 bytes
CRYPTOSYSTEM 3: id ← 0
4: send data ← 0
This current age is called the age of speed because the 5: receive data ← 0
importance of speed in our life, for example, Imagine Air 6: Initialize MPI environment
traffic control system not work at the appropriate time through 7: if id = P0 then
landing and if military defenses do not detect and discover 8: Input send data
9: Send data from processor P0 to P 1
enemy at the suitable time the result will be disastrous. 10: else
Because of the high impact of speed generally in our life, 11: Input receive data
there is a need to make implementations that have high and 12: Receive data from processorP 0
good performance. From that point, this study focuses on 13: end if
exploit all cores and parallelism in CPU by using distributing 14: Finalize MPI Environment
15: Generate a sequence of 32 bit
memory architecture based on the message passing interface 16: Convert each 32-bit sequence into 4- byte
(MPI). This study selects this model according to the following 17: Distribute generated sequence into thread
design criteria. First, MPI architecture is generic, and it offers 18: XORing each 4-byte in key with the corresponding 4-byte In the
a reliable message passing interface with uniform commu- image
nication progress. Second, this model allows for concurrent 19: Scattered each 32-bit sequence into processors
fabric-communication. Third, MPI has the ability to utilize
available hardware concurrency over a wide range of target
platforms. Finally, MPI is a thread-safe and allow a multi-
threaded application to take advantage of Message passing
interface services. MPI can do internal process communication
(IPC) by using famous collective operations. MPI Reduce is
one of the collective operations in MPI that stores the result of
aggregation operation (sum, mul) from all distributing proces- (a) Plain image (b) ciphered image
sors into one processor . While MPI All reduce work the same
as MPI Reduce but the data item distributed to all processor.
In contrast, MPI Gather collect data item from all distributing
processors and combine them in one array for specific one
processor. While MPI Allgather similar to MPI Gather but
array will be available in all processors. MPI also used MPI
Bcast in order to broadcast a message from one process
to all process. However, MPI Scatter decomposing, splitting
and distributing an array from one process to all processes
(c) Histogram of Plain image (d) Histogram of ciphered im-
[10],[11],[12]. Depending on all these features of MPI we age
developed a new parallel chaos algorithm that gives a high
and good performance computation as shown in Algorithm 1. Fig. 1: Plain image and its Ciphered image

IV. SOFTWARE IMPLEMENTATION AND


PERFORMANCE COMPUTATION uniformity test for both plain and cipher image and the result
The software implementation of parallel chaos cryptosystem shows that the cipher image has a uniform distribution as
is summarized as the following: presented in figure (d) in contrast of histogram for the plain
image as shown in figure (c).
• Read selected image in order to encrypt it later.
• Convert these image into bytes. To study the performance of the proposed cryptosystem using
• Generate keystream from two chaotic map generator. MPI, we apply some experiments on a computer that has Intel
• Apply MPI on the image by splitting it into small chunks. Core i3 (TM) working at 1800 GHz CPU and 4 GB Ram.
• XORing between the keystream from the generator and We install the parallel cryptosystem under Ubuntu 18.04 as a
image pixels. trusted Linux version. In these experiments, we take in concern
• Producing a scrambled image as clarified in Figure 1. three measurements i.e. Number of the cycle to generate one
byte (cycle/byte) measurement, Generation time measurement
As depicted in Figure 1 the proposed algorithm takes a plain in a microsecond, and the rate at which bit transferred in
image (a) to produce cipher image (b). In order to prove that megabit per second (Mbit/s). As shown in Equation 1,2 and
the cryptosystem is strong against statistical attacks, we apply Table 2,3,4 that present and clarify the mathematical equation
and result obtained from these measurements. As noted from Table 2 number of cycles per byte in MPI
CP U Speed(Hertz) is half of Sequential when applying MPI externally to cryp-
N CpB = (1) tosystem. When the size of data is bigger such as Lena
BR(M bit/s)
1024*1024*3 then more decreasing in NCpB than Small
Datesize(M bit) image size like Lena 256*256*3. In contrast to Table 2,
BR = (2)
Gen time(s) the result shows in Table 3 that bit rate in proposed system
is double of bit rate comparing with sequential version. As
observed from the results in Table 3, the bigger image size
TABLE I: NCpB For Sequential and MPI Implementation such as cameraman 1024*1024*3 has the bigger bit rate
Image NCpB Seq NCpB MPI which is equal to 33.20 Mbps/s compared with small image
size like cameraman 256*256*3 that has a 32.78 Mbps/s bit
Lena 256*256*3 1484.3 660.2 rate. As noted from Table 4 that the average generation time
Lena 512*512*3 1413.8 634.6 increased proportionally with increasing of the image size and
Lena 1024*1024*3 1471.5 571.5 also the performance of MPI implementation two times faster
boat 256*256*3 1551.8 620.0 than sequential implementation.
boat 512*512*3 1431.9 581.5
boat 1024*1024*3 1666.2 616.7 V. SECURITY
cameraman256*256*3 1488.1 605.1
In order to check the security of our proposed system, we
cameraman512*512*3 1433.4 643.2
make some tests on the cipher image to check the immunity
cameraman1024*1024*3 1494.9 597.5 of the system against statistical and brute-force attacks. In
this section, we present some measurement and analysis such
as Key security and sensitivity, NIST Test and Correlation
TABLE II: Bit Rate For Sequential and MPI Implementation analysis that are shown in details as the following :

Image BR Seq BR MPI


A. Key security and sensitivity attack
Lena 256*256*3 13.36 30.04
In order to check key sensitivity of our proposed cryptosystem,
Lena 512*512*3 14.03 31.26 we apply two important measurements which are Number of
Lena 1024*1024*3 13.48 34.71 pixel change rate (NPCR) and the unified Average changing
intensity (UACI) which has shown that the proposed cryp-
boat 256*256*3 12.78 32.00 tosystem is very sensitive to one-bit change that appears when
boat 512*512*3 13.85 34.11 we encrypt “Lena ” image more than 100 times using 100
secret key that different in LSB bit.
boat 1024*1024*3 11.91 32.17
cameraman256*256*3 13.33 32.78
P X L X C
cameraman512*512*3 13.84 30.84 1 X
N P CR = D(i, j, p) × 100% (3)
cameraman1024*1024*3 13.27 33.20 L × C × P p=1 i=1 j=1

Where

0 , if C1 (i, j, p) = C2 (i, j, p)
TABLE III: Generation Time For Sequential and MPI Implementation D(i, j, p) = (4)
1 , if C1 (i, j, p)6= C2 (i, j, p)
Image NCpB Seq NCpB MPI
In the prior equations (3) and (4) L, C, and p are the length,
Lena 256*256*3 112244 49927
width, and plane sizes of the image respectively. I, j and
Lena 512*512*3 427636 191937 p are the rows, column, plane index respectively. As the
Lena 1024*1024*3 1780309 691513 result shown in Table 5 that NPCR, UAC of the proposed
boat 256*256*3 117342 46882 cryptosystem is close to the optimal NPCR and UACI values
boat 512*512*3 433116 175886 99.61% and 33.46% respectively.
boat 1024*1024*3 2015910 746142
TABLE IV: NCpB For Sequential and MPI Implementation
cameraman256*256*3 112529 45757
cameraman512*512*3 433560 194538 Cryptosystem NPCR UACI
cameraman1024*1024*3 1808616 722860 Proposed Cipher Cryptosystem 99.665 33.459
VI. S TATISTICAL A NALYSIS

A. NIST Test
In order to investigate the randomness of our ciphered image,
we apply the NIST test which is a statistical test that consists
of 188 tests that used to estimate the statistical performance of
the keystream produced . We apply this test to 100 different
binary sequences each with a different secret key. The result
as shown in Figure 2 proof that our proposed system has high
randomness and ability against statistical attacks.

Fig. 3: Adjacent Pixels for Plain Image


Prop vs Test
100

90

80

70 Fig. 4: Adjacent Pixels for ciphered Image

60 VIII. ACKNOWLEDGEMENT
I would like to express my very great appreciation to Palestine
Polytechnic University for their financial,moral and psycho-
logical support. This paper will be never complete without
50
0 50 100 150 200 the support of factually member of Computer engineering
department

Fig. 2: NIST Test for the keystream R EFERENCES


[1] S. Zhu, C. Zhu, and W. Wang, “A new image encryption algorithm based
on chaos and secure hash sha-256,” Entropy, vol. 20, no. 9, p. 716, 2018.
B. Correlation Analysis
[2] M. Abutaha, S. El Assad, A. Queudet, and O. Deforges, “Design and
For proving that cipher image is completely different from efficient implementation of a chaos-based stream cipher,” 2017.
the original image we used correlation analysis of adjacent [3] H. Pan, Y. Lei, and C. Jian, “Research on digital image encryption
pixels for both cipher and the original image. As the result algorithm based on double logistic chaotic map,” EURASIP Journal on
Image and Video Processing, vol. 2018, no. 1, p. 142, 2018.
clarified in Figure 3 that adjacent pixels in the plain image
are redundant and correlated, however, adjacent pixels in [4] B. V. Protopopov and A. Skjellum, “A multithreaded message passing
interface (mpi) architecture: Performance and program issues,” Journal
cipher image nearly completely different and seem to have of Parallel and Distributed Computing, vol. 61, no. 4, pp. 449–466,
redundancy and correlation as low as possible as shown in 2001.
Figure 4 . This another proof that shows our proposed system [5] J. L. Träff, W. Gropp, and R. Thakur, “Self-consistent mpi performance
has immunity against statistical attacks . requirements,” in European Parallel Virtual Machine/Message Passing
Interface Users’ Group Meeting. Springer, 2007, pp. 36–45.

VII. C ONCLUSIONS [6] R. Thakur and W. Gropp, “Open issues in mpi implementation,” in
Asia-Pacific Conference on Advances in Computer Systems Architecture.
Springer, 2007, pp. 327–338.
In this paper we proposed a new methodology which depends
on distributed memory architecture based on message passing [7] ——, “Test suite for evaluating performance of mpi implementations
that support mpi thread multiple,” in European Parallel Virtual Ma-
Interface( MPI) to develop a new high speed security model. chine/Message Passing Interface Users’ Group Meeting. Springer,
Security tests and performance showed that the proposed 2007, pp. 46–55.
encryption system has a very good speed and robustness [8] T. Gao and Z. Chen, “A new image encryption algorithm based on
against attack compared with sequential one. hyper-chaos,” Physics Letters A, vol. 372, no. 4, pp. 394–400, 2008.
[9] 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.
[10] T. Kielmann, R. F. Hofman, H. E. Bal, A. Plaat, and R. A. Bhoedjang,
“Magpie: Mpi’s collective communication operations for clustered wide
area systems,” in Proceedings of the seventh ACM SIGPLAN symposium
on Principles and practice of parallel programming, 1999, pp. 131–140.
[11] J. Pješivac-Grbović, T. Angskun, G. Bosilca, G. E. Fagg, E. Gabriel,
and J. J. Dongarra, “Performance analysis of mpi collective operations,”
Cluster Computing, vol. 10, no. 2, pp. 127–143, 2007.
[12] M. Matsuda, T. Kudoh, Y. Kodama, R. Takano, and Y. Ishikawa, “Effi-
cient mpi collective operations for clusters in long-and-fast networks,”
in 2006 IEEE International Conference on Cluster Computing. IEEE,
2006, pp. 1–9.

You might also like