Medical Images Compression and Encryption Using DCT Arithmetic Encoding and Chaos-Based Encryption

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

2021 International Seminar on Intelligent Technology and Its Applications (ISITIA)

Medical Images Compression and Encryption using


DCT, Arithmetic Encoding and Chaos-Based
Encryption
2021 International Seminar on Intelligent Technology and Its Applications (ISITIA) | 978-1-6654-2847-7/21/$31.00 ©2021 IEEE | DOI: 10.1109/ISITIA52817.2021.9502246

Tiffany Maliati Khumairoh Afandi Dion Hayu Fandiantoro


Department of Electrical Engineering Department of Computer Engineering
Sepuluh Nopember Institute of Technology Sepuluh Nopember Institute of Technology
Surabaya, Indonesia Surabaya, Indonesia
[email protected] [email protected]

Endroyono I Ketut Eddy Purnama


Department of Electrical Engineering Department of Computer Engineering
Sepuluh Nopember Institute of Technology Sepuluh Nopember Institute of Technology
Surabaya, Indonesia Surabaya, Indonesia
[email protected] [email protected]

Abstract—With the need for incognito and security for the tree compression techniques with SPIHT and Chaotic Maps
medical image transmission and to reduce the size of the file, the encryption techniques are used. Another research conducted
authors proposed chaotic sequence-based encryption combined in [2] by using JPEG compression technique and Black2 Hash
with the arithmetic encoding and discrete cosine transform (DCT)
for the compression. First, the image is compressed by using DCT. encryption technique is performed. And in [3]. DWT and
Then, the image is compressed again with the arithmetic encoding Chaos-based dynamic session key is used.
technique. After that, the result of the compression is encrypted In this paper, the authors proposed a medical image trans-
by using two chaotic sequence functions to shuffle and scramble mission technique with discrete cosine transform and arith-
the file. The compression ratio of the proposed technique is 0.748
metic encoding to reduce the file size and encrypted with
and a PSNR of 41.70 dB.
Index Terms—compression, discrete cosine transform, chaotic chaos-based encryption.
function, encryption, medical images
II. M ETHODOLOGY
I. I NTRODUCTION
A. The Compression Method
With a population of more than 200 million residents.
Indonesia has several health problems. One of them is the The proposed technique is combining both the Discrete
sparsely distributed health center which most of them are in Cosine Transform (DCT) and Arithmetic Encoding to reduce
the capital cities. Furthermore, only those in capital cities have the file size of the medical images. The DCT is used to
access to health specialists. Telemedicine in Indonesia has its decompose the original image into different frequencies. Then,
problem with its low available bandwidth to transfer such a the frequencies are quantized to reduce or remove the less
large medical image, and the anonymity and security of the important frequencies and retain the important frequencies
patient need to be considered. In Indonesia, health facilities [4]. The result of removing the less important frequencies is
need to send the results to the specialist in the capital which generating more zeros and should reduce the file size of the
needs a transmission method using limited bandwidth and image. The DCT process is shown in Fig. 1.
limited access to the internet and also the need for security After the process of DCT-Quantization-IDCT, the resulting
of medical images. image is compressed using the arithmetic encoding technique.
Therefore, the medical images must be compressed to The Arithmetic encoding technique is shown in Fig. 2. Arith-
improve the storage and archiving capacity and to optimize metic encoding replaces a sequence input symbol with a
their transmission across the networks. In addition, the en- floating-point number. The longer and the more complex the
cryption of medical images is necessary in order to ensure the message encoded, the more bits it takes to these needs. The
confidentiality of personal medical data during transfer to the output from arithmetic coding is one number less than 1 and
network, and also during the period in which the information greater than or equal to 0 [5]. The number is unique and can be
is stored on the internet. decoded to produce string symbols used to generate numbers.
There are several studies that combined the compression and To produce these output numbers, each symbol need to be
encryption techniques as one system. In [1]. IWT and Kd- coded to a set of probability values.

horized licensed use limited to: AMRITA VISHWA VIDYAPEETHAM AMRITA SCHOOL OF ENGINEERING. Downloaded on January 18,2022 at 04:54:47 UTC from IEEE Xplore. Restrictions ap
are the control parameters. Eq. 2. is used to permute the data
and Eq. 3 is used to diffuse the data. The encryption algorithm
consist of the following step:
STEP 1 Read the original data and rearrange it as an arbitrary
two-dimensional array.
STEP 2 Choose the initial seeds and control parameters of the
chaotic functions, the number of R rounds, and the
number of discarded sequences. All of these param-
eters are used to generate the key with the sequences
of a round number, initial x seed, initial y seed,
first control parameter, second control parameter, and
discarded number.
STEP 3 The first few sequences of the chaotic function are
discarded to get rid of the transient effect of the
chaotic functions.
STEP 4 First chaotic function sequences are XORed with the
data.
STEP 5 Second chaotic function sequences are used to scram-
ble the data in their respective rows.
STEP 6 Second chaotic function sequences are used again to
scramble the data in their respective columns.
STEP 7 First chaotic function sequences are used again to
perform a bitwise rotation in each data element.
STEP 8 Repeat from Step 2 for the R round.
Fig. 1. DCT Process STEP 9 Rearrange the data to its original binary format.
The flowchart of the encryption algorithm is shown in Fig.
4, and the decryption process performs in reverse order.
The overall flowchart of the proposed technique is shown
in Fig. 3.
TABLE I
B. The Encryption Method T HE C OMPRESSION P ERFORMANCE R ESULTS

Due to their inherent features of chaotic systems such Technique Name PSNR CR Time
as ergodicity and pseudorandomness, and sensitive to initial Ref [1] 39.85 dB 0.970 19.20 s
Ref [2] 33.43 dB 0.917 00.63 s
conditions and control parameters. The chaos-based encryption Ref [3] 38.84 dB 0.027 31.01 s
algorithms have been widely used for image encryption due to RLE and Chaos-based 43.32 dB 1.480 04.93 s
their simplicity compared with traditional cryptosystems such Proposed 41.70 dB 0.748 27.84 s
as AES or DES [6].
The proposed scheme is using a chaotic function known as
Logistic Map shown in Eq. 1 III. T EST R ESULTS
The tests scenario in Fig. 5 aims to describe and explain
the steps taken when testing the system from the start until
f (x) = λx(1 − x) (1) the results are obtained. The tests scenario in this study
The chaotic behavior of the function depends on the initial includes testing the Peak Signal to Noise Ratio (PSNR), the
condition x and control parameters λ. Logistic Map is used Compression Ratio (CR), the elapsed time, and data random-
due to its well-known chaotic behaviour to perform a permu- ness. PSNR and CR tests were obtained when the image was
tation and diffusion. compressed using the Matlab program. Meanwhile, random
data is obtained from the encryption process through the NIST
C. Encryption Algorithm test suite using the Python program. To test the elapsed time,
Two separate Logistic Maps are used for both encryption the results can be obtained from the total time of compression
and decryption processes and are shown in Eq. 2 and Eq. 3. and encryption from start to finish.
The first step is compression of the original image using
xi+1 = λ1 xi (1 − xi ) (2) the DCT technique. After DCT compression, the image is
compressed again with another compression technique, in
yi+1 = λ1 yi (1 − yi ) (3)
order to obtain the best image compression results so that it
x( i + 1) and y( i + 1)are state values with i=0,1,2,...; with can speed up the image transfer process to the database and
x0 and y0 are the initial seed of the function. And λ1 and λ2 does not take up a lot of storage. The compression techniques

horized licensed use limited to: AMRITA VISHWA VIDYAPEETHAM AMRITA SCHOOL OF ENGINEERING. Downloaded on January 18,2022 at 04:54:47 UTC from IEEE Xplore. Restrictions ap
Fig. 2. Arithmetic Encoding Technique

TABLE II
NIST T EST R ESULTS FOR E NCRYPTION

Tests name 01 02 03 04 05 06 07 08 09 10
Frequency 0,622 0,392 0,053 0,820 0,457 0,227 0,743 0,398 0,466 0,695
Block Frequency 0,930 0,197 0,748 0,913 0,681 0,029 0,705 0,353 0,944 0,974
Runs 0,329 0,530 0,775 0,386 0,820 0,875 0,246 0,973 0,028 0,535
Longest run 0,166 0,679 0,090 0,810 0,752 0,491 0,707 0,785 0,623 0,035
Rank 0,241 0,680 0,362 0,453 0,927 0,945 0,287 0,311 0,443 0,882
Spectral 0,553 0,294 0,190 0,899 0,774 0,813 0,856 0,881 0,708 0,271
Non overlapping 1,000 1,000 1,000 1,000 1,000 1,000 1,000 1,000 1,000 1,000
Overlapping 0,910 0,498 0,872 0,308 0,184 0,910 0,643 0,327 0,815 0,857
Maurer 0,482 0,131 0,115 0,637 0,083 0,592 0,659 0,822 0,996 0,774
Linear complexity 0,448 0,299 0,605 0,878 0,206 0,525 0,516 0,810 0,359 0,293
Serial 0,227 0,754 0,397 0,347 0,333 0,458 0,640 0,853 0,190 0,546
Entropy 0,226 0,754 0,396 0,691 0,454 0,459 0,837 0,972 0,190 0,545
Cumulative sum 0,762 0,415 0,047 0,400 0,582 0,299 0,732 0,298 0,399 0,745
Excursions 0,102 0,087 0,141 0,132 0,242 0,030 0,017 0,021 0,012 0,041
Excursions variant 0,139 0,214 0,053 0,228 0,253 0,128 0,064 0,060 0,017 0,048

that will be tested in this research are Arithmetic Encoding


and RLE.
Next, for the image encryption is the encoding of the
original image into an image that cannot be interpreted from
its value, this process aims to keep the image safe during the
transfer and storage process. The encryption techniques that
will be evaluated in this study are Chaotic Encryption and
AES. The NIST test suite process is carried out to evaluate
the encryption performance in randomness.This test is to find
out whether the data has been randomized so that it can show
that the data has been encrypted. There is no need for a NIST
test series for the AES encryption.
Fig. 3. The overall flowchart of the proposed method After the encryption process, the The next process is the
decryption process, which is the process of converting an

horized licensed use limited to: AMRITA VISHWA VIDYAPEETHAM AMRITA SCHOOL OF ENGINEERING. Downloaded on January 18,2022 at 04:54:47 UTC from IEEE Xplore. Restrictions ap
Fig. 4. The flowchart of the chaos-based encryption

Fig. 5. Test scenario

techniques are more effective and have good results. The


Matlab and Python programs are created to perform all of
the compression and encryption algorithms. CR and PSNR
are observed to determine the compression performance, and
also the compression and encryption time is observed to
determine the required time to perform all the compression
and encryption. The compression ratio is obtained by dividing
the compressed file size with their respective original file size.
Ten images are used to test the proposed algorithm and are
shown in Fig. 6.
Fig. 6. Test images used on the observation

The authors also create a run-length encoding variant as


encoded image into a reconstructed images. Then, the image a comparison. The results of the compression performance
is saved and the PSNR test is performed. are shown in Table I. The algorithm that we propose has the
In this study, several other techniques were also tested averaged CR 0.748, PSNR 41.70 dB, average time process
in order as a evaluation which compression and encryption 27.84 s. These results are obtained from 10 test images.

horized licensed use limited to: AMRITA VISHWA VIDYAPEETHAM AMRITA SCHOOL OF ENGINEERING. Downloaded on January 18,2022 at 04:54:47 UTC from IEEE Xplore. Restrictions ap
A. NIST Test Results R EFERENCES
Encrypted data must be resistant to statistical attacks in [1] Nasrullah. Sang J, Akbar. MA, Cai B. Xiang H, dan Hu H, ”Joint Image
Compression and Encryption Using IWT with SPIHT, Kd-Tree, and
cryptographic applications, and the randomness is not only Chaotic Maps,” Applied Science, vol. 8, no. 10, 2018.
important for pseudo-random number generators but also for [2] Li. P, dan Lo. K.T, ” A Content-Adaptive Joint Image Compression and
a cipher-text generation. For this reason, the randomness of Encryption Scheme,” IEEE Transactions on Multimedia, vo. 20, no. 8,
2017.
resultant encrypted data is evaluated using the NIST (National [3] Setyaningsih. E, Wardoyo. R, dan Sari. A.K, ”New Compression-
Institute of Standard and Technology) statistical randomness Encryption Algorithm Using Chaos-Based Dynamic Session Key,” In-
test suite [7]. ternational Journal on Smart Sensing Intelligent Systems, vol. 11, no.
1, 2018.
The test significance level p is desired to be above 0,01 for [4] Reininger, R. and Gibson, J., “Distributions of the two-dimensional DCT
each test in order to accept the randomness of bit sequences. coefficients for images,” IEEE Transactions on Communications, vol. 31,
NIST randomness test results for all encrypted data is given no. 6, pp.835-839, 1983.
[5] Witten, I.H., Neal, R.M. and Cleary, J.G., “Arithmetic coding for data
in Table II. And according to the test results, all of the test compression,”. Communications of the ACM, vol. 30, no. 6, pp. 520-
data are passed the NIST test. 540, 1987.
[6] Zhang, W., Wong, K.W., Yu, H. and Zhu, Z.L., “An image encryption
scheme using reverse 2-dimensional chaotic map and dependent diffu-
IV. D ISCUSSION sion,” Communications in Nonlinear Science and Numerical Simulation,
vol. 18, no. 8, pp.2066-2080, 2013.
From these two types of tests, two errors were found. [7] Bassham III, L.E., Rukhin, A.L., Soto, J., Nechvatal, J.R., Smid, M.E.,
The first conclusion is that Arithmetic takes longer because Barker, E.B., Leigh, S.D., Levenson, M., Vangel, M., Banks, D.L. and
Heckert, N.A., “Sp 800-22 rev. 1a. a statistical test suite for random
Arithmetic has to make a table of values and the frequency of and pseudorandom number generators for cryptographic applications,”
values appearing in the image, which can then be translated National Institute of Standards Technology, 2010.
by binary encoding. Whereas RLE is performed sequentially [8] Husseen. A. H, Mahmud. S. Sh, dan Mohammed. R. J, ”Image Com-
pression Using Proposed Enhanced Run Length Encoding Algorithm,”
directly in the image. The second conclusion is that the IBN Al-Haitham J for pure APPL.SCI, vol. 24(1), 2011.
Chaotic encryption process is longer than the AES encryption
process because the encryption process is more sequential,
while AES uses a Matrix.
Compression testing using DCT and RLE results in high
compression ratios, because the number of the same pixels in
the image is not too many, causing inefficient use of RLE, by
the RLE principle which combines the same pixels into one
value and is followed by the number of pixels that have the
same value. If there are only a few of the same pixel values,
it causes expansion instead of compression.
For PSNR values, Arithmetic Coding and RLE compression
have no effect, because both compressions are lossless com-
pression. Lossless compression techniques reduce size while
preserving all of the original image information and without
degrading image quality. Meanwhile, DCT compression is
a lossy compression technique. Lossy compression achieves
its effect by sacrificing image quality and deleting image
information only [8].

V. C ONCLUSION
The goal of this study is to evaluate the arithmetic encod-
ing compression and the chaos-based encryption technique.
Despite a longer compression time, an effective medical
image compression with DCT and arithmetic encoding and
encryption with two independent chaotic function techniques
are presented. PSNR and compression ratio are observed to
measure the compression performance, with the results of
41.70 dB and 0.748 respectively. To increase the resistance of
the crypto-system, scrambling and circular rotation operations
are performed. A statistical analysis based on NIST 800-22
test is carried out to present the security and the validity of
the proposed algorithm. The result from the NIST tests is a
pass for all of the test data.

horized licensed use limited to: AMRITA VISHWA VIDYAPEETHAM AMRITA SCHOOL OF ENGINEERING. Downloaded on January 18,2022 at 04:54:47 UTC from IEEE Xplore. Restrictions ap

You might also like