MDP Report - Image Cryptography
MDP Report - Image Cryptography
A report on
“Image Cryptography”
BACHELOR OF ENGINEERING
IN
By
Mrs. Rajeshwari K
Assistant Professor
CERTIFICATE
Certified that the Technical Seminar has been successfully presented at BMS College of
Engineering by Aditya Chakravarthi, Aditya Kumar, Chandan S Nadig bearing USN:
1BM19IS007, 1BM19IS008, 1BM19IS040 in partial fulfilment of the requirements for the VI
Semester degree in Bachelor of Engineering in Information Science & Engineering of
Visvesvaraya Technological University, Belgaum as a part of for the course
Multidisciplinary Project, Course Code - 20IS6PWMPR during academic year 2021-2022.
Signature :
1
CONTENTS
Chapter 1 4
1.3 Objective 4
Chapter 2 5
Chapter 3 12
Chapter 4 13
4.1 Implementation 13
Chapter 5 15
5.1 Results 15
References 20
2
ABSTRACT
A program for securely encrypting and decrypting images using chaos theory. The images are
first converted into grayscale. Then a series of mathematical operations are performed to ensure
that the image is encrypted. We then decrypt the image back to its grayscale image and from
grayscale, back to its original coloured image.
3
Chapter 1
INTRODUCTION
1.3 Objective
Create a program that can convert RGB images to grayscale, then encrypt, then decrypt, then
convert image back to colour.
4
Chapter 2
Qi Zhang et al. [1] talks about using Advanced Encryption Standard as an algorithm for image
encryption and decryption. The authors just want to show us that this algorithm is an excellent
method to use on digital images. The code is run in MATLAB. After a successful operation, the
authors do two tests. First is a histogram analysis of the decrypted and original image to make
sure that they are indeed the same. The second one is where they use a wrong key to decrypt an
encrypted image. The final decrypted image is completely different than the original image and
hence it’s secure. They conclude that since AES is secure and easy to implement, it is a good
algorithm in image cryptography.
Zhi-Hong Guan et al. [2] talks about using Chaos-based algorithms for image encryption and
decryption. Two of the requirements are to shuffle the position of each pixel and changing the
grayscale intensity of each pixel. They use two kinds of maps for this, one is Arnold cat map (for
shuffling pixel positions) and Chen’s chaotic system (For shuffling the grayscale intensity). As
both are being scrambled, the key space increases (permutations increase). Therefore this
becomes a very secure cryptography technique.
Mehmet Rida Tur et al. [3] talks about using chaos based encryption and decrypt algorithm for
secure communication of data and instruction in smart in smart grid-based energy systems
applications. Many instructions and information are in both texts and images (including graphs).
AES, DES and other algorithms that are mainly used for text are not preferred in this case. So the
authors use chaotic logistic maps to create keys and cryptography. Histograms are used to
represent the grayscale pixels to show us how randomly shuffling is done. They conclude that
this is a good technique to use for these applications.
Yaghoub Pourasad et al. [4] talks about a new algorithm for chaos based image encryption.
Many chaos based algorithms are used in many diverse fields. Although regular chaos based
5
algorithms were said to be good at scrambling, their accuracy was not high. Therefore they tried
using Wavelet Transformation to improve accuracy. Extra confusion is done for the cipher
image. Using Histogram and scatter plots the analysis is done. They concluded that the algorithm
is efficient and effective.
Yu-Guang Yang et al. [5] talks about the use of M-ary decomposition and virtual bits for
visually meaningful image encryption. DNA encoding is used to encode images into pseudo
DNA sequences instead of pixel shuffling and other operations. Compressive sensing can
achieve the functions of image encryption and compression simultaneously, and the final result is
presented in the form of pixels rather than a bitstream. The authors propose a method of M-ary
decomposition which can be used to decompose an integer into different representations of
virtual bits. By using the M-ary decomposition method, a non-standard image pre-encryption
algorithm is proposed. A Generalised Embedding Model (GEM) which allows the authors to
dynamically embed the four matrices with different virtual bit depths into the IWT domain of the
host image and therefore correcting the error to the minimum is used. They show us that this is a
very promising cryptography technique
Firdous et al. [6] discuss the importance of privacy and confidentiality of images in modern
times. They further present an image encryption algorithm inspired by the ripple effect of waves
in water when a weight, like a stone, is dropped into it. The plain image is considered as a water
pond and by throwing a stone on its surface, the pixels are diffused. As a ripple is formed it
produces crests and troughs as it travels through. Firstly the permutations of pixels is done by
taking a random sequence. Then k number of stones are generated. To throw these stones on the
image, pixels are chosen in terms of row and column indexes to form a ripple. Substitution of
pixels on the pattern of water waves is applied by adding and subtracting pseudo random
numbers from each pixel along with exclusive-or operation with the preceding wave. The authors
conducted several experiments and results to test the efficiency as well as effectiveness of their
proposed algorithm. They perform several statistical tests such as histogram analysis, x square
analysis, correlation coefficient analysis, computational complexity analysis, etc. They later
conclude that their approach to encrypting images is efficient and effective without
compromising on security.
6
Gamido et al. [7] talk about changing Advanced Encryption Standard (AES) to make it more
efficient when encrypting text files as well as images. The authors proposed to use bit
permutation to replace mix columns transformation of AES as it is easy to implement and it does
not have any complex mathematical computation. By implementing this the authors were able to
reduce the high complexity of AES. The authors then compared the performances of their
modified AES and traditional AES. Based on encryption time, CPU usage and avalanche effect,
the proposed modified AES algorithm proved to have better efficiency as well as faster
encryption time in text files as well as images. The proposed modified AES algorithm also
consumed lesser CPU usage. This algorithm also resulted in producing a higher avalanche effect.
The authors later concluded that their modified AES algorithm increased efficiency, level of
security and overall performance while encrypting and decrypting both text files and images.
Li Zhen et al. [8] propose an efficient chaos based encryption algorithm which uses the
imitation jigsaw method, which contains revolving and shifting operations. In their proposed
algorithm there are three processes in encryption - preprocessing, encryption and postprocessing.
In the preprocessing phase, the original image is partitioned into 64 × 64 pixel image blocks and
is randomly revolved and shifted under control sequences that are generated by a chaos based
Lorenz system whose initial conditions are calculated by original image and keys. During the
preprocessing phase, the plain image is vulnerable to differential attacks. In the next step,
encryption, the preprocessed image is partitioned into 32 × 32 pixel blocks and randomly
revolved and encrypted by control sequence and key blocks which are generated by the skew tent
map. In the last step, post processing, the after encrypted image is then partitioned into 16 × 16
pixel blocks and are again, randomly revolved and shifted under control sequences which are
related to the encrypted image and key. The post processing step further increases the diffusion
characteristics of the algorithm. The authors then conducted a series of experiments and tests
such as key space analysis, differential attack, histogram analysis, correlation coefficient,
information entropy analysis, etc. They concluded that their algorithm has both good security as
well as good performance.
7
Zhang et al. [9] proposes an asymmetric image encryption algorithm based on an elliptic curve
cryptosystem (ECC). The sender and receiver agree on an elliptic curve point based on
DifeHellman public key sharing technique. In order to reduce the encryption time, the sender
groups the pixel values together and converts them into big integers. The sender then encrypts
big integers with ECC and the chaotic system. Finally, the encrypted image is obtained from
encrypted big integers. The proposed algorithm makes key transmission and management simple
and secure. Experimental results and algorithm analyses show that the proposed algorithm is
secure enough to resist the brute force attack, differential attack, the known plaintext attack, and
statistical attack. The authors compare their proposed algorithm to three other similar ones
namely Singh’s algorithm, Laiphrakpam’s algorithm and Zhu’s algorithm and state that their
proposed algorithm is fastest in terms of encryption speed.
Zhenlong Man et al. [10] proposes a double image encryption algorithm based on convolutional
neural network (CNN) and dynamic adaptive diffusion. According to the characteristics of
digital image, the authors design a dual-channel (digital channel / optical channel) encryption
method, which not only ensures the security of double image, but also improves the encryption
efficiency and reduces the possibility of being attacked. First, a chaotic map is used to control the
initial values of the 5D conservative chaotic system to enhance the security of the key. Second,
in order to effectively resist known plaintext attack and chosen plaintext attack, the authors
employ a chaotic sequence as convolution kernel of convolution neural network to generate
plaintext related chaotic pointer to control the scrambling operation of two images. On this basis,
a novel image fusion method is designed, which splits and fuses two images into two different
parts according to the amount of information contained. In addition, a dual channel image
encryption scheme, optical encryption channel and digital encryption channel, is designed for the
two parts after fusion. The first part has better parallelism and higher encryption efficiency,
while the latter has higher computational complexity and better encryption reliability. Especially
in the digital encryption channel, a new dynamic adaptive diffusion method is designed, which is
more flexible and secure than the existing encryption algorithm. The authors then conduct
numerical simulation and experimental analysis and verify the feasibility and effectiveness of the
scheme.
8
S Shaukat et al. [11] The author in this paper gives an in depth review and analysis of the Chaos
theory and its application in the schemes for image encryption. It discussed the advantages of
Chaos theory over traditional encryption schemes. To understand Chaos theory, Bifurcation is
one of the most critical topics to understand and start with. In Bifurcation, we learn that a
model's behaviour derives from stability to periodicity and then periodicity to randomness in
certain conditions. A system bifurcates and changes its state by applying perturbation small in its
guiding rules. Then we learn the concept of Fractals, which can be called the geometry of chaos
or the graphical representation of chaotic function which is related to mathematical science.
Then, we learn that Lorenz Attractor simplifies the approximations required in the theories. Both
Fractals and Lorenz attractors show that chaos theory can be applied in random number
generation and cryptography. Generally, traditional algorithms encrypt images without using any
complex mathematics, but can be easily decrypted without the possession of a key. Chaos theory
possesses properties such as complex dynamics, ergodicity, non-periodicity, pseudo randomness,
boundedness and high sensitivity to initial conditions and control parameters, which makes it
suitable for image encryption. Chaos theory also produces a highly random sequence compared
to traditional algorithms if the chaotic system is selected properly. The author also discusses
several issues that should be kept in mind while designing a chaotic system for an
image/multimedia encryption scheme such as higher keyspace, computational complexity, and
real number representation.
TS Ali et al. [12] The author in this paper propers a diffusion based image encryption algorithm
using chaotic maps. First, S-Box is generated using a Chaotic map and then it is used for the
pixel values modification to generate elements of non linearity. In the following step, the
modified values obtained are further diffused with another random sequence, generated by tent
logistic chaotic map. Then, the colour components of pre-encrypted images are mixed with each
other so that the developed randomness is uniformly distributed in them. We also learn that a
hybrid cryptographic approach is used for colour images. It uses a plain image based master key
for the generation of subkeys to encrypt the corresponding image. It consists of the master key,
that is sent to the receiver by using the asymmetric cryptographic technique RSA after
encrypting with the public key of the receiver, where encryption and decryption are carried out
by using a symmetric cryptographic approach. The algorithm that is proposed has provided
9
resistance to various types of cryptographic attacks such as bruteforce attack, known plaintext
attack and noise and data loss attacks. The proposed scheme also shows practicality and
effectiveness verified by a security analysis. Since the proposed encryption algorithm is based on
multi chaotic maps, it may require larger memory and an increased computational cost.
X Chai et al. [13] The author discusses a colour image encryption system which is based on an
improved genetic algorithm and matrix semi-tensor product (STP). We learn that the five stages
in this encryption process are preprocessing, DNA encoding, crossover, mutation and DNA
decoding. This algorithm is a combination of STP operation and image adaptive segmentation
technology, which improves processing efficiency. When encrypting large-scale image, users
can adjust the size of the image blocks, which can be adjusted into 8 blocks, 16 blocks. We learn
that the process of encrypting an image using this method involves splitting of the plain image
into its red, green and blue components, and then processing by an adaptive block-based image
preprocessing driven by a semi-tensor product to get new components. Next, the obtained
components are converted to DNA sequences according to DNA encoding rules. Subsequently,
the resulting sequences are shuffled by a double crossover operation of inter-intra components
(DCOIC), and diffused by a DNA complementary cycle mutation strategy. And finally, the
cipher image required is obtained by decoding the diffused DNA components and recombining
them. We can also learn with simulation results and security analysis which verifies the
algorithm’s effectiveness and superiority, making it suitable for utilisation in military, medical,
business and other fields.
J Khan et al. [14] In this paper, the author discusses that data encrypted through a single chaotic
map does not provide better security in terms of resistance against various attacks. Hence, he
proposes a 2D Henon chaotic map and skew tent map which could be deployed in the design of
an efficient chaos-based image encryption algorithm. Both chaotic maps play a key role in the
permutation and diffusion mechanism. It consists of two stages, where, in the first stage, the
Henon chaotic map generates two different chaotic sequences, which are further applied in row
and column permutation of the plaintext image. The pixel values diffusion is produced by
unimodal skew tent map via XOR operations. In the last stage of the encryption algorithm,
Hussain’s substitution box is used to substitute each pixel into a new random pixel. This
10
proposed encryption scheme is lightweight and effective. Several differential and statistical tests
on this scheme have resulted in its favour. The scheme can also be easily manipulated for an
image of unequal width and height as well. Hence all the properties obtained, make this scheme
suitable for encryption and decryption of digital images of different sizes and aspect ratios.
X Wang et al. [15] In this paper, the author proposes a permutation algorithm that can not only
guarantee good permutation performance but also guarantee low time and space complexity. It
also proposes a parallel diffusion method which is critical in ensuring the parallelism of diffusion
to the utmost extent and achieving a qualitative improvement in efficiency over traditional
streaming diffusion methods. The parallel diffusion method proposed is called the Twice
Independent Diffusion of each group and Bidirectional Diffusion, where the first pixels are taken
from all the groups. Similar to traditional algorithms, this method is composed of permutation
and diffusion. During permutation, sorting and cyclic shift are combined to achieve high
efficiency while guaranteeing the permutation performance. The encryption efficiency is greatly
improved by the parallel diffusion process of TIDBD, and ensures that the algorithm can resist
chosen plain attack. The author also proposes a parallel version of the permutation algorithm,
that could be implemented to ensure the permutation performance and being able to achieve the
full advantages of parallel processing.
11
Chapter 3
SYSTEM DESIGN
12
Chapter 4
IMPLEMENTATION
Image Conversion
To convert RGB images into grayscale images we just need to average the RGB values.
These weights that are used are so that the colours with higher wavelengths have lower
weightage than those with lower wavelengths. This gives a better grayscale image.
To get back the exact RGB values of the original image, it must be passed on securely too to the
receiver so that the grayscale can be converted exactly. Any algorithm can be used for this.
Encryption keys can be created with different algorithms. This is to ensure that each key is
unpredictable. This can be achieved by Chaotic Logistic map which is defined by,
13
x is between 0 and 1
The key is 8-bits long.
X is rounded off to the nearest integer and is modulus with 256 so that it can stay within the
range of 0 - 255.
Encryption:
Decryption:
14
Chapter 5
Results
15
16
17
18
19
References
[1] Zhang, Q. and Ding, Q., 2015, September. Digital image encryption based on advanced
encryption standard (aes). In 2015 Fifth International Conference on Instrumentation and
Measurement, Computer, Communication and Control (IMCCC) (pp. 1218-1221). IEEE.
[2] Guan, Z.H., Huang, F. and Guan, W., 2005. Chaos-based image encryption algorithm.
Physics letters A, 346(1-3), pp.153-157.
[3] Tur, M.R. and Ogras, H., 2021. Transmission of frequency balance instructions and secure
data sharing based on chaos encryption in smart grid-based energy systems applications. IEEE
Access, 9, pp.27323-27332.
[4] Pourasad, Y., Ranjbarzadeh, R. and Mardani, A., 2021. A new algorithm for digital image
encryption based on chaos theory. Entropy, 23(3), p.341.
[5] Yang, Y.G., Wang, B.P., Pei, S.K., Zhou, Y.H., Shi, W.M. and Liao, X., 2021. Using M-ary
decomposition and virtual bits for visually meaningful image encryption. Information Sciences,
580, pp.174-201.
[6] Firdous, A., Rehman, A.U. and Missen, M.M.S., 2021. A gray image encryption technique
using the concept of water waves, chaos and hash function. IEEE Access, 9, pp.11675-11693.
[7] Gamido, H.V., Sison, A.M. and Medina, R.P., 2018. Modified AES for text and image
encryption. Indonesian Journal of Electrical Engineering and Computer Science, 11(3), pp.942-
948.
[8] Li, Z., Peng, C., Tan, W. and Li, L., 2021. An effective chaos-based image encryption
scheme using imitating jigsaw method. Complexity, 2021.
20
[9] Zhang, X. and Wang, X., 2018. Digital image encryption algorithm based on elliptic curve
public cryptosystem. IEEE Access, 6, pp.70025-70034.
[10] Man, Z., Li, J., Di, X., Sheng, Y. and Liu, Z., 2021. Double image encryption algorithm
based on neural network and chaos. Chaos, Solitons & Fractals, 152, p.111318.
[11] Shaukat, S., Arshid, A.L.I., Eleyan, A., SHAH, S.A. and AHMAD, J., 2020. Chaos theory
and its application: An essential framework for image encryption. Chaos Theory and
Applications, 2(1), pp.17-22.
[12] Ali, T.S. and Ali, R., 2022. A novel color image encryption scheme based on a new
dynamic compound chaotic map and S-box. Multimedia Tools and Applications, pp.1-25.
[13] Chai, X., Zhi, X., Gan, Z., Zhang, Y., Chen, Y. and Fu, J., 2021. Combining improved
genetic algorithm and matrix semi-tensor product (STP) in color image encryption. Signal
Processing, 183, p.108041.
[14] Khan, J., Ahmad, J. and Hwang, S.O., 2015, May. An efficient image encryption scheme
based on: Henon map, skew tent map and S-Box. In 2015 6th International Conference on
Modeling, Simulation, and Applied Optimization (ICMSAO) (pp. 1-6). IEEE.
[15] Wang, X., Feng, L. and Zhao, H., 2019. Fast image encryption algorithm based on parallel
computing system. Information Sciences, 486, pp.340-358.
21