Content uploaded by Youssef Elbably
Author content
All content in this area was uploaded by Youssef Elbably on Jun 16, 2022
Content may be subject to copyright.
Faculty of Management Technology
Business Informatics Department
The German University in Cairo
Digital Image Encryption using AES
Encryption Scheme
Bachelor Thesis
Author: Youssef Elbably
Supervisor: Dr. Wassim Alexan
Submission date: June 14th, 2022
This is to certify that:
(i) the thesis comprises only my original work towards the Bachelor degree,
(ii) due acknowledgement has been made in the text to all other material used.
–––––––––––––––––––––
Youssef Elbably
June 14th, 2022
ii
Abstract
Because of the increasing usage of images in industrial processes, it is critical to
protect confidential image data from unauthorised access in today’s image commu-
nications. Moreover. Image security has become a major concern. The challenges
of protecting people’s privacy are becoming increasingly tough. Image encryption
is required to keep sensitive information safe from the undesirable users. In this
paper an AES (Advanced Encryption Standard) scheme is proposed.
iii
Acknowledgement
I would like to express my deep and sincere gratitude to my supervisor, Dr. Was-
sim Alexan, for his leadership, patience, inspiration and support for leading this
work from the very beginning. Working under his supervision is a very healthy
experience, because his door is always open for me. I am very grateful for your
help. In addition, I want to thank my parents for supporting me over the years.
–––––––––––––––––––––
Youssef Elbably
June 14th, 2022
iv
Contents
1 Introduction 1
1.1 Motivation................................ 1
1.2 Contributions .............................. 2
1.3 Organization .............................. 2
2 Background and Literature Review 3
2.1 DigitalImages.............................. 3
2.1.1 Digital Image Formats . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 2D Image Representation . . . . . . . . . . . . . . . . . . . . 5
2.2 Cryptography.............................. 6
2.2.1 History and Background . . . . . . . . . . . . . . . . . . . . 7
2.2.2 Symmetric Key Encryption . . . . . . . . . . . . . . . . . . 9
2.2.3 Asymmetric Key Encryption . . . . . . . . . . . . . . . . . . 12
2.2.4 Cryptographic Hash Functions (CHF) . . . . . . . . . . . . . 15
2.3 Performance Evaluation Metrics . . . . . . . . . . . . . . . . . . . . 18
2.3.1 Histogram Analysis . . . . . . . . . . . . . . . . . . . . . . . 18
2.3.2 Mean Squared Error (MSE) . . . . . . . . . . . . . . . . . . 18
2.3.3 Peak Signal to Noise Ratio (PSNR) . . . . . . . . . . . . . . 19
2.3.4 Entropy ............................. 19
v
2.3.5 Structural Similarity Index Measurement (SSIM) . . . . . . 19
2.4 Stateoftheart ............................. 21
3 Proposed scheme of AES image encryption 34
3.1 Description of the scheme: . . . . . . . . . . . . . . . . . . . . . . . 34
3.2 CodeImplementation.......................... 34
3.2.1 Encryption and Embedding . . . . . . . . . . . . . . . . . . 34
3.2.2 Extraction and Decryption . . . . . . . . . . . . . . . . . . . 39
3.3 Performance Evaluation Metrics and Numerical Results . . . . . . . 41
3.3.1 Comparison With The Literature . . . . . . . . . . . . . . . 45
4 Conclusions 46
4.1 Conclusions ............................... 46
References 47
vi
List of Tables
3.1 Histogram Analysis for Peppers image . . . . . . . . . . . . . . . . 42
3.2 Histogram Analysis for Lena image . . . . . . . . . . . . . . . . . . 43
3.3 MSEresults. .............................. 43
3.4 PSNRresults. ............................. 44
3.5 Entropyresults. ............................ 44
3.6 SSIMresults. .............................. 44
3.7 Comparison. .............................. 45
viii
List of Acronyms and Initialisms
2D Two–Dimensional
3D Three–Dimensional
AES Advanced Encryption Standard
ASCII American Standard Code for Information Interchange
DES Data Encryption Standard
SSIM Structural Similarity Index Measurement
MSE Mean Squared Error
RSA Rivest-Shamir-Adleman
PNG Portable Network Graphics
PSNR Peak Signal–to–Noise Ratio
RGB Red Green Blue
CHF Cryptographic Hash Function
MDC Modification Detection Codes
CPU Central Processing Unit
ix
Chapter 1
Introduction
In this chapter, I provide a brief introduction to this thesis by explaining the
motivation behind it and the business problem that it attempts to solve. I also
summarize the contributions made in this thesis, and explain how it is organized.
1.1 Motivation
Nowadays, digital images and videos have high importance because they have be-
come the main carriers of information. Lately, it has been a must for all organiza-
tions to get involved more on the internet for multiple reasons to stay competitive
and active in the market. Large organizations need to make sure that any image
they put on the internet is kept safe and away from their competitors.
The motivation behind this seminar topic is that image encryption and especially
AES encryption is a safe solution for this issue, trying as possible to maximize the
security of important data, images and videos over the internet.
1
1.2 Contributions
In this thesis, AES scheme was applied on colored digital images to keep its content
safe of the internet. AES was used as it is known to be a highly secured method
of encryption.
1.3 Organization
This thesis is organized as follows. Chapter 1 provides an introduction to the thesis,
with motivation, contributions, and the organization of the thesis. In Chapter
2 is going to contain, digital images, cryptography, and state–of–the–art. As for
Chapter 3 is the code for the AES image encryption and its measurements. Chapter
4 will include conclusion.
2
Chapter 2
Background and Literature
Review
This chapter is separated into four sections. The first section outlines the defini-
tion of the digital image and its forms and representations. The second section
illustrates the history and classification of cryptography. While the third section
is the State–of–the–Art.
2.1 Digital Images
Nowadays, we cannot think about a world without images. As people go through
multiple images every day through different resources such as TV, magazines and
the internet. According to the authors of [1] digital image is an image but using
pixels. Pixels is a finite number of digital values that is used as a unit of measure-
ment of the digital image in which any computer can understand.
According to Rohm and Haas in [2] there are four different types of digital imag-
3
ing. First is laser direct imaging (LDI), LDIs are an advanced method of imaging
used in electronics and uses a laser as their Light exposure source directed to board
to write on this board could be solder mask or photo-resist. Second is laser direct
structuring which is using a laser to mark specific areas on a given object using
3 different technologies. According to this paper, it is used in electronic devices.
Third is flow-guided deposition using air to deposit a coat of atomized stream of
particles on a surface. Last type stated by those two authors is Ink-jet printing,
it is similar to normal computer printing but instead of having a paper we print a
2D image on an object.
2.1.1 Digital Image Formats
Digital image is basically a type of image which is formed from pixels. Each pixel
has some finite size and is represented by some finite intensity to show the image
and they are arranged in a rectangular way. The are two types of Digital images
which are Raster digital image and Vector digital image.
1. Raster Digital Image
Raster digital image or the bitmap image is made up of billions of pixels. When
When the Raster image is zoomed the small squares can be seen in it. The software
used to build tracks every pixel of the image which makes it less useful because
the file size is very large which makes storing it on the computer very difficult.
There are many types of Raster image such as,
JPEG (Joint Photographic Experts Group)
GIF (Graphics Interchange Format)
4
TIFF (Tagged Image File Format)[3][4]
2. Vector Digital Image
Vector digital image consists of lines and curves which are called paths. The
vector image represents the wireframe type of image. It is the type of image used
when the data requires handling such as,
AFD (Affinity Designer document)
EPS (Encapsulated PostScript)
SVG (Scalable Vector Graphics)[3][4]
2.1.2 2D Image Representation
An image is and artifact that records visual perception of data. The are 4 types
of digital image representation which are Pixel-based representation, Block-based
representation, Region-based representations and Hierarchical representations [3].
1.Pixel-Based Representation
It is the most simple representation for image definition. The pixel is the
physical point in the raster image. Raster image is the types of images that are
produced when scanning or photographing an object. In this representation there
are relations between elements. Only local information for each element is stored
in each pixel. The representation usually has a large number of elements and is
used to depict the image.
2.Block-Based Representation
5
Block-based representation the image is made of a set of rectangular array size.
Compared to pixel based representation, the number of elements is slightly less.
Like the pixel-based representation local information is stored. This representa-
tion method can be done for both gray-scale and binary images and also, it uses
compression, segmentation and extracting different image features.
3.Region-Based Representations
Region-based representations which is also known as Superpixel representa-
tion. The regions in this representation are not rectangular and it is organized by
grouping identical and connected pixels and the adjacency information between
regions is usually defined as Region Adjacency Graph (RAG).
4.Hierarchical Representation
This representation method uses most likely unions of regions of region–based
representations. It can also be done at different scales. Moreover,it is used for
many applications including object detection, video segmentation, image segmen-
tation, filtering and image simplification.
2.2 Cryptography
Cryptography comes from the Greek terms kryptos, which means ”hidden,” and
grafein, which means ”to write.” Cryptography has been used to hide communi-
cations inside traditional modes of communication that could otherwise be inter-
cepted throughout history. This is accomplished by keeping the contents of the
message hidden from everyone except those with the key to unlock it[5].
6
2.2.1 History and Background
Cryptography is not a recent science. Although it has been used for thousands of
years to conceal secret messages, the study of cryptography as a science (or art)
just began about only 100 years ago. It began around 3500 BC in the form of
paintings on stones. This type of paintings is assumed to be the very first early
way of written communication, which was in the form of naturalistic paintings of
animals and people found in sheltered places such as caves [6].
Cryptography is usually divided into 2 segments, classic and modern cryptography.
Classic cryptography is an algorithm that uses a secret key to secure data which
is usually very easy to break as it has been relatively outdated in comparison with
modern techniques [7].
Caesar cipher substitution is considered one of the oldest classic algorithms.
Caesar cipher is simply a type of substitution procedure in which each letter in
the original text (plain text) is shifted a particular number of positions down the
alphabet’s series A shift of the 3 would, for example, mean that A would be re-
placed by the letter D, B by the letter E, and so on [7].This concept is clearly
demonstrated in Fig. 2.1.
According to the authors of [8] Caesar cipher can be relatively challenging to
break if the hacker is trying to do so mentally but, after the revolution of the
computers and the technology Caesar cipher stands no chance against brute force
attacks (trial and error) that is used by these computers as there is only 25 possible
7
Figure 2.1: Caesar cipher scheme [7].
options for keys available.
As per the authors of [9] The Second type of classical cryptography is the me-
chanical ciphers which are the Enigma machine and Lorenz system. An Enigma
machine is a famous encryption mechanism that the Germans employed to send
coded messages during WWII. An Enigma machine can encrypt a message in bil-
lions of different ways, making it extremely difficult for other countries to decode
German codes during WWII. It was firstly invented by a German engineer called
Arthur Scherbius in 1918. Enigma is a complicated form of the Caesar cipher
substitution as the main component of the invention is a part known as ”Rotor”.
Rotor is a combination of 3 disks. The first disc converted the original letter into
a coded letter, which was then turned into yet another letter by the second disc,
which was then transformed by the third disc. Furthermore, Scherbius made an
important enhancement which was the rotation of the disks. As The second disc
rotated one position after the first disc had rotated through all of its places. The
third disc rotated one position after the second disc had rotated through all of its
places. Sherbius assured that the encryption of each letter would be repeated only
after a complete cycle of all three discs. Using our 26-letter alphabet, this equals
a cycle of 26*26*26 = 17,576 position which is a very large pool or possibilities at
8
the time [10].
The second mechanical cipher is the Lorenz cipher. Lorenz cipher was initially
used at the WW2 but the German Army High Command. It’s related to stream
ciphers, in which the plaintext is obscured by XORing a continuous stream of
pseudo-random information with the plaintext. This cipher’s code converted let-
ters to binary digits and included six unique symbols for controlling automatic
printers. Each plaintext letter was also given a key letter by the coders [11].
Lastly, modern algorithms are used in the current technology. These algo-
rithms are very secure. There are two types of modern algorithm: Symmetric key
encryption and Asymmetric key encryption which will be discussed in the following
subsections.
2.2.2 Symmetric Key Encryption
As per the author of [12], Symmetric cryptography is the sharing of encrypted
data between parties using a single shared secret. Symmetric cryptography is best
suited for bulk encryption because it is much faster than asymmetric cryptography.
1. Data Encryption Standard (DES)
DES was the first encryption standards developed by National Institute of
Standards and Technology (NIST). It was created in 1974 by an IBM team and
became a national standard in 1997. DES is a method for encrypting sensitive and
unclassified information using Fiestal cipher. DES works on a 64-bit block size.
The encryption procedure is broken down into 16 steps, each with eight S-Boxes.
To get the result, it first shuffles the bits, then does non linear replacements,
and lastly uses the XOR operation. The result is merged with the sub key of a
9
given round using the XOR function. The reverse order of sub keys is used in the
decryption process. DES is not a highly secured block cipher as many attacks and
methods have noticed weaknesses [13].
2.Triple Data Encryption Standard (3DES)
Triple-DES was initially used after brute force attacks were more feasible with
the availability of increasing computational power. Triple-DES is just DES with
two 56-bit keys applied it was developed in 1998.According to the authors of [14]
3DES is a 3 step procedure Firstly, the program is give the plain text message,
the first key is used to DES encrypt the message. Secondly, he second key is used
to DES-decrypt the encrypted message but since this key is not the correct one it
just shuffles the data. The final step of this 3 step model is The final ciphertext
is created by encrypting the message which was shuffled twice with the first key.
Adding on by [13] 3DES is very similar to DES but applied three times, making
3DES three times slower than DES in terms of power consumption and throughput
but three times more safe.
3.Advanced Encryption Standard (AES)
AES was developed by (NIST) to replace the outdated DES. It has different
length of keys 128, 192, or 256 bits which is the most common one. AES is an it-
erative instead of Feistel cipher. It is based on two common techniques to encrypt
and decrypt data knowns as substitution and permutation network (SPN) [13].
In AES algorithm only the secret key should be hidden from the public be-
cause the attacker will not be able to try to decrypt the algorithm without it. As
mentioned above AES algorithm have 2 main properties which are confusion and
10
diffusion. The property of confusion hides the relationship between the ciphertext
and the key. So, simply It substitutes one letter with an entirely different one.
The trick is to make that connection unbreakable.
While, diffusion is the other property of the AES algorithm. Diffusion is re-
arranging and mixing of the message by Shifting data or transposing columns.
Substitute, ShiftRows, MixColumns and Addround key transformations are ex-
amples diffusion. First of all,The 16 input bytes are substituted by looking up a
fixed table (S-box) given in design. The result is in a matrix of four rows and four
columns secondly, each of the four rows of the matrix is shifted to the left. Any
entries that are left out are re-inserted on the right side of row them, Each col-
umn of four bytes is now transformed using a special mathematical function. This
function takes as input the four bytes of one column and outputs four completely
new bytes, which replace the original column. The result is another new matrix
consisting of 16 new bytes lastly, The 16 bytes of the matrix are now considered as
128 bits and are XORed to the 128 bits of the round key. If this is the last round
then the output is the ciphertext. Otherwise, the resulting 128 bits are interpreted
as 16 bytes and we begin another similar round [15][16].
4. Blowfish Algorithm
Blowfish is the first symmetric encryption algorithm created by Bruce Schneier in
1993. It uses Feistel network that iterates simple encryption and decryption func-
tions.As shown in Fig. 2.2. This algorithm is divided into two parts: key expansion
and data encryption. Key expansion divides a 448-bit key into several sub-key ar-
rays totaling 4168 bytes. Data encryption takes place over a 16-round network.
11
Figure 2.2: Caesar cipher scheme [17].
Each round includes a key-dependent permutation as well as a key- and data-
dependent substitution. On 32-bit words, all operations are XORs and additions.
The only additional operations per round are four indexed array data lookups [17].
2.2.3 Asymmetric Key Encryption
It is also known as public key encryption as it uses two distinct but related keys.
As the public key which is known by anyone is used for encryption meanwhile the
private key is meant for decryption. Public and private key are connected together
by a strong one way function but it is computationally infeasible to break it in a
logical and acceptable time [18].
1.Rivest-Shamir-Adleman (RSA)
12
As per the authors of [19][20] RSA algorithm is a type of asymmetric cryptog-
raphy. Asymmetric actually means that it works on two different keys which are
public and private keys. The Public Key is given to everyone, whereas the Pri-
vate Key is kept private, as the name implies. The RSA algorithm is named after
those who invented it in 1978: Ron Rivest, Adi Shamir, and Leonard Adleman.
RSA algorithm have 3 major elements which are key generation, encryption and
decryption. Key generation usually be applied with 6 simple steps which are:
1. Choose two distinct large random prime numbers p and q such that p = q.
2. Compute n= p ×q.
3. Calculate: phi (n) = (p-1) (q-1).
4. Choose an integer e such that 1¡e¡phi(n)
5. Compute d to satisfy the congruence relation d ×e = 1
mod phi (n); d is kept as private key exponent.
6. The public key is (n, e) and the private key is (n, d) Keep all the values d, p,
q and phi secret.
and then there is the encryption and decryption elements which are:
Encryption:
Plaintext: P ¡ n
Ciphertext: C= Pe mod n.
Decryption:
Ciphertext: C
Plaintext: P=Cd mod n.
RSA is proven not to be the most favorable design for the commercial use as it
has many flaws. As When small values of p and q are chosen for key design, the
encryption process becomes too weak, and the data can be decrypted using ran-
13
dom probability theory and side channel attacks.
2. Diffie-Hellmann Algorithm
Diffie-Hellman key exchange was first published publicly by Whitfield Diffie and
Martin Hellman in 1976. It is a cryptographic system that allows two parties who
have never met before to create a shared secret key together across an unsecure
communication channel. Diffie-Hellman consists of two keys a private key and se-
cret key. Suppose sender wants to set up a connection with the receiver he encrypts
the message provided faster, efficient and secure model for secured application in
the cloud [21].
3. Digital Signature Algorithm (DSA)
The National Institute of Standards and Technology (NIST) initially used and
created DSA in 1991 to try to authenticate and verify documents and data. This
is necessary to avoid tampering and modification of important data during the
transmission of official documents. Asymmetric key systems usually encrypt with
a public key and decrypt with a private key. In the case of digital signatures the
opposite is true. As the private key is used to encrypt the signature, which is
then decoded with the public key. Because the keys are linked, decoding it with
the public key proves that the correct private key was used to sign the document,
confirming its origin [13].
4. Elliptic Curve Cryptography (ECC)
ECC is a public-key cryptosystem similar to RSA. However, it varies from RSA
14
in that it has a faster developing capacity and provides an appealing and alternate
path for cryptographic algorithm researchers. As weaker and smaller ECC keys
can provide the same level of security as larger and stronger RSA keys. For ex-
ample, the RSA’s 1024 bit security strength might be matched by ECC’s 163 bit
security level. Wireless communications, such as mobile phones and smart cards,
are especially well suited to ECC. As ECC is designed to improve performance to
reduce computing power and battery resource consuming [13][22].
2.2.4 Cryptographic Hash Functions (CHF)
A hash function is a mathematical function that converts a numerical input value
into another compressed numerical value. The input to the hash function is of
arbitrary length but output is always of fixed length. Simply CHF is like a box
that takes a text of any length and produces an output or a digest of a fixed length.
This process should be efficient transforming text to digest but the opposite is very
hard to compute and there are infinite possibilities. hash functions are often called
modification detection codes (MDC) as their main use if to to detect changes in
data, Unlike most algorithms used in symmetric and asymmetric cryptography
CHF does not provide confidentiality, authentication or non-repudiation because
it does not use a secret key. There are several hash functions algorithms that are
used such as MD4, MD5, SHA-1, SHA-2 and SHA-3 [23].
1. Message Digest 5 (MD5)
First of all, The MD family are the most used hash functions algorithms, The
first MD model was the MD4 invented by Rivest in 1990 and it was one of the
first custom made hash function algorithms to ever exist. It was not used for a
15
long time as it was not recommended since 1993. While, MD5 which was firstly
designed in 1992 by the same person. The concept of MD5 is to adjust the length
of the message to 448 mod 512 to make the message 64 bit. After that, the creation
of a four-word (128-bit) MD buffer (A,B,C,D). The message is then processed in
16-word (512-bit) blocks using four rounds of 16-bit operations on the message
block, and the buffer is then added to the output to generate a new buffer value.
The final buffer value is determined by the output hash value. The process of MD5
is shown in Fig. 2.3[24].
Figure 2.3: MD5 Operation [24].
2. Secure Hash Algorithm 1 (SHA-1)
The SHA-1 algorithm was first released in 1995 in FIPS PUB 180-1 as part of the
US government’s Capstone project.The message schedule of SHA-1 differs from
those of its predecessors by a single bitwise rotation.In SHA-1 The message length
is padded to 448 mod 512. After that, it is given a 64-bit length value. Following
that, a 5-word (160-bit) buffer (A,B,C,D,E) is initialised to process the message
in 16-word (512-bit) blocks using four rounds of 20-bit operations on the message
16
block and buffer, after which the output is added to the buffer input, yielding
a new buffer value, which is regarded as the output hash value.SHA-1 is slower
than MD5, however unlike MD5, which has a 128-bit key, SHA-1 (160-bits) is not
vulnerable to brute force attacks [24].
3. Secure Hash Algorithm 2 (SHA-2)
The SHA-2 family of cryptographic hash functions was created in 2001 by the
National Security Agency of the United States and is protected under US patent
6829355. When compared to the preceding MD-5 or SHA-1 algorithms, SHA-2
is a better variant. There are 6 hash functions values is associated with SHA-2
which are 224, 256, 384 or 512 bits known as SHA-224, SHA-256, SHA-384, SHA-
512/224, SHA- 512/256. Knowing that the most used hash functions SHA-256
is using 32-bits and SHA-512 is using 64-bit. SSL, TSL, PGP, S/MIME, SSH
and IPsec are where SHA-2 is commonly implemented. It is also used in DKIM
message signing standard and authenticating Debian software packages. In nu-
merous crypto-currencies, such as Bitcoin, SHA-256 is used to verify transactions
and calculate proof-of-stake. SHA-2 is widely used in cryptographic algorithms
and protocols, as well as by the US government to protect sensitive unclassified
data [24].
4. Secure Hash Algorithm 3 (SHA-3)
Guido Bertoni, Michael Peeters, Joan Daemen, and Gilles Van Assche created the
Secure Hash Algorithm 3 (SHA-3) for the first time in 2015. It was not invented
to replace SHA-2 but because of the successful collisions and attacks on MD5 and
SHA-1. SHA-3 employs a sponge design, in which data is absorbed by the hash
17
function and then squeezed out as the result. In the absorbing part, the blocks
are XOR-ed into a subset of the state. While, in the squeeze phase output blocks
are read from the same subset of the state. In SHA-3, each state has an array of
5 * 5 64-bit words, for a total of 1600 bits [24]
2.3 Performance Evaluation Metrics
2.3.1 Histogram Analysis
An image-histogram illustrates how pixels in an image are distributed by graphing
the number of pixels at each color intensity level. To be able to have a strong
encryption scheme, the histogram of an encrypted image must be uniform
2.3.2 Mean Squared Error (MSE)
The mean squared error (MSE) is used to measure the reliability of a proposed
scheme. In order to detect any similarities or differences the pixels of the plain
and encrypted images using this equation.
MSE =1
M×N
M
X
i=1
N
X
j=1
(x(i, j)−y(i, j ))2,(2.1)
Where X corresponds is the pixels value of cover image and Y is the pixels value of
stego image. Moreover, M corresponds to total number of rows and N corresponds
to total number of columns of the image matrix. The value of the MSE should be
a large number in order classify the scheme as a strong scheme that can resist any
statistical attacks.
18
2.3.3 Peak Signal to Noise Ratio (PSNR)
Peak signal to noise ratio (PSNR) evaluates the quality of an encryption scheme.
It is the ratio of the highest pixel value of the image over the MSE. The value of
the PSNR is inversely proportion to the MSE which means lower the value means
better encryption quality.
P SN R = 10 ×log10 255255
MSE (2.2)
2.3.4 Entropy
The information entropy can test uncertainty. Entropy reflects how random the
distribution of the gray-scale values is in the image. The value of the Entropy
should be really close to 8
Entropy =
N−1
X
j=0
(p(x)log2p(x)),(2.3)
Where p(x) is the probability of occurrence of symbol x. While, N-1 is the total
number of bits in each symbol.
2.3.5 Structural Similarity Index Measurement (SSIM)
SSIM is a perceptual metric that quantifies image quality degradation that is
caused by processing such as data compression or by losses in data transmission.
19
It is a full reference metric that requires two images from the same image capture
which are an original image and a processed image. SSIM theoretically should be
a value that is very close to 0. The following equations are used to compute the
SSIM.
SS IM(x, y) = l(x, y)×c(x, y)×s(x, y),(2.4)
l(x, y) = 2µxµy+C1
µx2+µy2+C1
,(2.5)
c(x, y) = 2σxσy+C2
σx2+σy2+C2
,(2.6)
s(x, y) = σxy +C3
σxσy+C3
,(2.7)
Where the l(x,y) is the luminance, contrast (c) and structure (s). And the other
symbols are:
20
2.4 State of the art
The authors of [25] proposed a new image encryption scheme using chaotic func-
tions. The scheme is simply shuffling the positions and changing the grey values
of image pixels are combined to confuse the relationship between the cipher-image
and the plain-image. First, the used the Arnold cat map to shuffle the positions of
the image pixels in the spatial-domain then, Then the pixel values of the shuffled
image are encrypted by Chen’s chaotic system. Arnold cat map encryption is used
to shuffle the pixel positions of the plain-image without the loss of the original
image data. To ensure more security Chen’s chaotic system is applied. It have
the same concept as the Lorenz system therefore, it is more complicated. It uses
3 step encryption model to encrypt the shuffled image. Firstly, The pixels of the
shuffled image are arranged by the order from left to right and then top to bottom
in which each element is the decimal grey value of the pixel. Secondly, Iterate the
Chen’s chaotic for N(o) times. Last step is iterating the algorithm continuously
for each time it produces 3 values. The authors used histogram to demonstrate
their findings. The histograms showed uniform distribution when Chen’s chaotic
system is applied meanwhile, there was worse distribution with the Arnold cat
map as it only shuffles the pixel’s positions of the image.
The authors of [26] used a color image encryption algorithm to based on chaotic
system. They algorithm takes the R, G, B components on an image and encrypt
it using chaotic at the same time and make each of the three component affect the
other So the coloration is reduced and security is increased. This scheme should
start by extracting the (RGB) components from the plain text, then each compo-
nent should be encrypted separately, then the algorithm will shuffle these results to
21
create a matrix which have a shuffled and random data. The last step is diffusion
as it combines every output together. After the diffusion we get three ciphered
vectors The vectors is converted into three matrixes; these matrixes are the (RGB)
components of ciphered image. The performance measures used to evaluate this
scheme are key space, Key sensitivity, NPCR and UACI, histogram analysis. The
results showed like [25] that the histogram is uniform after the encryption while,
The NPCR and UACI are over 99% and over 33% respectively which means that
proposed algorithm is very sensitive to tiny changes in the plain image so, the algo-
rithm is robust against differential attack. The key space analysis is large enough
to make sure that the algorithm is strong enough against brute force attacks while,
the key sensitivity test shows that the scheme is very sensitive to a small change
in keys.
The authors of [27] represented a novel image encryption scheme using DNA
(Deoxyribonucleic acid) sequence operations and chaotic system. The first step of
the scheme is that an OR operation is performed on the pixels of the image using
pseudorandom sequences produced by the spatiotemporal chaos system, then the
image is encoded to produce DNA matrix after that, new condition of the CML is
generated, then the rows and columns of the matrix is shuffled the last steps are
repeated. At last, after decoding the confused DNA matrix using a kind of DNA
decoding rule the encrypted image will be available. To evaluate the performance
of the proposed technique Key space, Distribution, Entropy, Correlation, NPCR
and UACI and Sensitivity were tested. The key space is measured at 8.39 * 1054
which is large enough to stop brute force attacks. The distribution in the histogram
shows a uniform distribution which results in good performances. Moreover, the
22
Information Entropy values which are very close to 8 using Lena, Baboon and
Cameraman. All the correlation values are smaller than 0.1 The results indicate
that the spatiotemporal chaotic system has better random series than the one di-
mension chaotic systems. The NPCR is 99.65% and the UACI is 33.48%. The
sensitivity test shows that the proposed scheme is sensitive to the secret keys.
Sinha and Singh presented a new image encryption scheme using digital sig-
natures [28]. At first the digital signature of the original image is added to
the encoded version of the original image, the encryption is performed using
Bose–Chaudhuri Hochquenghem (BCH) code which is an error code control. The
digital signature is extracted from the encoded image at the receiving end. The
recovered digital signature can be used to validate the image’s authenticity.The
standard algorithm, produces a signature of a predefined length which is 128 bits
so, it depends on the size of the input image, the error control algorithm must be
chosen.The algorithm was tested using correlation between the recovered signature
and the generated signature it shows no correlation which means, if the image has
been tampered with, it can be determined it comparing the digital signatures.
This allows us to verify the image that was sent.
The authors of [29] introduced a two-dimensional chaotic cat map for image
encryption. Their scheme uses a 3D cat map to shuffle image pixel placements
and a chaotic map to link between the cipher-image and the plain-image. They
initially extend the cat map into a 3D map, then diffusion process is performed
to confuse relationship between cipher image and plain image. This scheme was
tested using Key space analysis, Key sensitivity test, histogram, correlation and
23
differential analysis. Key space analysis and Sensitivity tests are so similar to the
proposed schemes [26] [27] [28]. The encrypted image shows a uniform histogram
distribution while, the correlation coefficients are 0.91765 and 0.01183, respec-
tively, which are far apart. NPCR and UACI tests shows that one-pixel change
influence on a 256 grey-scale image of size 512*512 as at 5 cipher rounds the NPCR
was 0.502 while it decreased to little bit under 0.5 at 10 rounds which shows that it
is reasonable to increase the ciphering rounds in the test to achieve higher security.
The authors of [30] initiated an image encryption scheme using binary bitplane
of a source image. In their scheme the algorithm selects a bitplane decomposi-
tion method to generate a bitplane of a source image. This bitplane serves as
the security key bitplane, allowing XOR operations to encrypt bitplanes from the
plain image. After that, the proposed technique uses a scrambling algorithm for
bit-level permutation and then combines all of the processed bitplanes to produce
the encrypted image. They used novel image encryption algorithm named De-
comCrypt. The algorithm can effectively encrypt the gray-scale, color, bio-metric,
and medical images. Some tests were carried out to test the performance of the
proposed algorithm. The tests shows optimum Key space and Sensitivity results.
In addition, The histogram analysis shows that DecomCrypt is more uniform than
Zhou’s algorithm. While, UACI and NPCR are 96.46% and 33.10% respectivley
which is slightly worse than the results shown in [27]. Lastly, the correlation anal-
ysis shows that the algorithm has good randomness and its adjacent pixels have
extremely low correlation.
The authors of [31] proposed an image encryption scheme, based on a total
24
shuffling and parallel encryption algorithm. In their proposed scheme they also
tried to confuse the relationship between the plain image and the cipher image
like most scheme but, they tried to make different as,The plain image is separated
into four sub-images, which are then confused to create a disturbed image. The
positions of the pixels in the entire image are then shuffled using a complete shuf-
fling matrix, and the grey values of the plain image are changed using a states
combination of two chaotic systems. After that, the entire image is simultane-
ously encrypted in a parallel manner. To check the performance the authors’ used
histogram analysis that showed that the shuffled image had a very nonuniform
distribution compared to the encrypted histogram which shows that only shuffling
the image is not enough. Also, security tests were carried out and were similar
to the ones carried out in [27]. The information entropy was 7.9993 with the en-
crypted image. Lastly, Encryption speed was measured using Matlab 7.8 to run
encryption programs in a computer with a Pentium 4 CPU 2.66 GHz, 4 GB Mem-
ory, and 300 GB hard-disk capacity and it took 0.55855276 seconds to be executed.
The authors of [32] tried to take advantage of the chaotic tent map for image
encryption. The chaotic tent map has high complexity and The randomness of the
sequences generated by this map is very high. The initial condition and parame-
ters of the map are edited during the encryption. The high sensitivity of this map
to very small changes in initial condition and control parameters provides a very
secure encryption algorithm. Secondly, the chaos-based key stream is generated
by a 1D chaotic tent map which has better performance and security levels. The
performance and security measures used to evaluate this scheme are Key space,
Histograms, Correlation, Entropy and speed. The results showed that the pro-
25
posed scheme that the distribution and correlation of the image is above average.
Also, the encrypted image is 7.999876 which is close to the max number 8. Fi-
nally, the speed of the encryption using size 256 ×256 is from 0.90 till 0.95 seconds.
The authors of [33] proposed a parallel image encryption scheme using chaos-
based algorithms. In the proposed scheme the authors will use the Kolmogorov flow
map that fulfills the requirements for parallel image encryption algorithm. The
most important element in this model that the encryption should be performed in
parallel as the main goal for this scheme is to be fast. At first, the whole image
is divided into a number of blocks. Then, there are 4 basic transformations that
could be applied on the image such as, A-transformation, M-transformation, S-
transformation and K-transformation. Then the image will be encrypted the plain
image will be encrypted after 9 round of these transformations and encryption.
The measurements carried out in this scheme are NPCR and UACI, histogram
and correlation analysis. The NPCR and UACI shows satisfaction after the third
round which is slightly worse than [32]. While, the histogram showed good results
as the histogram of the encrypted image is fairly uniform compared to the plain
image. Meanwhile, the pixels have little correlation which is worse than [28] and
[30] as they had no and low correlation respectively.
The authors of [34] proposed a 2 layer image encryption algorithm based on
logistic and 2D Lorenz. In this paper they used 2D Lorenz chaotic system and Lo-
gistic chaotic system as these two chaotic mapping algorithms have low complexity.
Initially the colored image is converted into grey-scale image. Then, logistic will
be used to generate two sets of chaotic sequences. Then, 2 sets of 2D sequences
26
will be generated. The measurements for this scheme were Histogram, Entropy,
Correlation, and some security tests like, MSE and PSRN , Differential tests. The
measurements were applied to many classical encryption images such as, Lena,
baboon and Barbara. The results showed that images with dimensions of 512*512
yields a more uniform distribution in the histogram. Like histogram analysis also
the Entropy shows that the images with 512*512 have a value closer to 8 than
other sizes. The correlation between adjacent pixels of the original image is high.
While, the NPCR and UACI are both within the accepted margins. The MSE for
the proposed scheme is 105.0683 and the PSRN is 23.8677.
The authors of [35] presented an image encryption scheme using chaotic sys-
tems. In this scheme the authors are combing chaotic encryption technology which
is very popular for image encryption with the traditional DES encryption. DES
is used to achieve E expansion so the calculation is larger. Then, chaotic map is
used to expand DES key space As the initial encryption key of DES algorithm is
constant in the whole process. After that encryption is executed by the concept
of DES. The metric used to measure the scheme is correlation which is equal to
0.0158 vertical and 0.0019 level which is close to 0 so, there is low correlation.
The authors of [36] proposed a new image scheme based on the spatiotem-
poral chaos of the Mixed Linear–Nonlinear Coupled Map Lattices (MLNCML).
They used a DNA computing technique with a one-time pad encryption scheme
to increase plaintext sensitivity and its resistance against all types of attacks. The
merits of the DNA method and the MLNCML system are combined together. One
time pad encryption policy is need to ensure the security of this scheme. The result
27
of the measurements applied on the scheme shows that the scheme can successfully
resist any attacks like brute force attacks as the key space analysis shows a very
large value. Entropy for this scheme is 7.999287615 which is better compared to
other proposed schemes in [34][32]. The UACI and NPCR values are very similar
to the ones attained in [26].
The authors of [37] implemented an image encryption scheme based on on the
quantum logistic map. The algorithm takes advantage of the high complexity
and randomness of the quantum logistic map. As the parameters are connected to
plaintext and the ciphertext it has to be modified in the beginning of the algorithm.
First of all, the image data is transformed to an array, in order to be processed.
Then, the encryption process takes place using quantum logistic map. The de-
cryption algorithm is the same as the encryption algorithm but using reversed
steps.The histogram analysis for this scheme has a worse distribution compared to
all proposed schemes so far. This scheme has a very good Entropy value of 7.99984.
The proposed model has Correlation coefficient of 0.0065 which is slightly worse
than [35]. NPCR is 0.004104% and UACI is 0.3320%.
A new color image encryption scheme was used in article [38] that is based on
the spatiotemporal chaos of the two dimensional non-linear coupled mat lattices
(2DNLCML). The 2DNLCML system employs a non-linear chaotic map coupling
method to achieve the non-neighborhood coupling bases on two-dimensional CML.
The system proposed has good features for encryption such as less periodic window
in bifurcations and larger range of parameters in chaotic dynamics. The scheme
also applies genetic mutation and multipoint crossover operation, which has a
28
lower computational complexity than the regular DNA based schemes. In order to
evaluate the security or this novel encryption scheme; histogram analysis, UACI,
NPC and information entropy were used. 1056 is the value for the key space anal-
ysis. The Entropy for this scheme is 7.99171 which means that the probability of
accidental information leakage is very small as the value is close to 8.The average
values of NPCR and UACI are NPCR = 0.996149785 and UACI = 0.335135938,
which are very close to the ideal values.
The authors of [39] proposed a new approach for image encryption based on
chaotic logistic maps. In their scheme they used external secret key of 80-bit and
two chaotic logistic maps. Initially the basic conditions for both logistic maps is
obtained from the external secret key by providing different weights to its bits.
The first logistic map is used to generate numbers ranging from 1 to 24 and the
second logistic map is adjusted by the numbers generated from the first logistic
map so it become more randomized. To encrypt the pixels of a picture, eight dis-
tinct types of operations are used, and the conclusion of the second logistic map
determines which operation will be used for each pixel. The histogram analysis
for this scheme shows that the encrypted image is fairly uniform and significantly
different from the respective original version. Moreover, the correlation analysis
claims that no correlation exist between original and its corresponding cipher im-
ages. The key space analysis shows a value of 280 which is better than the results
attained in [38]. Finally, The time analysis has been done on Pentium-4 with 256
MB RAM computer and it shows for the size 256*256 the time take was 0.33–0.39
which is significantly better than the time in [32].
29
Elkandoz and Alexan[40] proposed an image encryption confusion-diffusion
technique. In their scheme they used five keys for encryption which are the Arnold
cat map which is responsible for shuffling the image pixels. While, the diffusion
of the image pixels is performed using 2D Logistic Sine Map, a Linear Congru-
ential Generator, the Bernoulli Map, and the Tent Map. The algorithm firstly,
load the RGB image and seperate the colors into 3 RGB channels. The image
used have dimensions of 256*256. This results in a Red channel shuffled pixels,
Green channel shuffled pixels, and Blue channel shuffled pixels. After that, 2 keys
are generated where the first key is generated using 2D Sine Logistic map and
the Linear Congruential Generator while, The second key is generated using both
the Bernoulli chaotic map and the Tent chaotic map, which consists of 65536 * 8
matrix. The performance of the proposed scheme was tested using the histogram
analysis, entropy, mean square error (MSE), peak signal to noise ratio (PSNR),
mean absolute error (MAE), correlation coefficient analysis, key space analysis,
differential attack analysis, complexity analysis and finally, a NIST analysis. The
histogram analysis shows a uniform distribution of edge pixels. And the Entropy
results are really close to 8. While, The MSE, PSNR, MAE, Correlation anal-
ysis, key space analysis, differential attack analysis, complexity analysis shows a
comparable or Superior results than the other proposed scheme presented in the
paper. Finally, The NIST analysis showed a value greater than 0.01 which means
that this scheme is resistant against any cryptographic attack.
The authors of [41] proposed an image encryption scheme by using R¨ossler Sys-
tem, PRNG S-Box and Recam´an’s Sequence. This scheme is a three stage scheme
where the first stage uses the R¨ossler system and the second stage uses the S-Box.
30
Finally, the third layer is Recam´an’s Sequence. Firstly, the R¨ossler System which
consists of three nonlinear differential equations. This system approaches chaos
through a period doubling bifurcation route. While, the S-Box incorporates a non-
linear mapping among the input and output data is established to create confusion
this step is very important as the data security relies on the confusion in this step.
The last step is using Recam´an’s Sequence for the encryption process. This scheme
was tested using histogram analysis, a cross-correlation analysis, entropy values,
MSE and NIST analysis. Histogram analysis, NIST analsysis and Entropy shows
a very similar results as [40]. The correlation coefficient diagrams shows that the
horizontal, vertical and diagonal correlation coefficients of the adjacent pixels for
the plain image are linear.
The authors of [42] presented a three-layer image encryption scheme using Cel-
lular Automata, S-Box and the Lorenz System. In the first layer uses Rule 30
cellular automaton to produce the first encryption key. While, the second layer
is where the diffusion happens using the S-Box. In this scheme a highly non-
linear S-boxes can be efficiently generated, each through a simple change in the
initial transformation parameters. Finally, the third stage employs a solution of
the Lorenz system to generate a second encryption key. In this paper the authors
tested their scheme using histogram analysis, a correlation coefficient analysis,
mean square error (MSE), mean absolute error (MAE), peak signal to noise ratio
(PSNR), Entropy, a differential attack analysis, comprising the number of pixel
changing rate (NPCR) and the unified average change intensity (UACI), a key
space analysis, a NIST analysis, and, finally, an execution time analysis. The
NPCR and UACI values are close to the values showed in [38][26][27]. While, The
31
scheme passed all the NIST analtsis tests. Furthermore, All the other tests showed
results that is very similar to [27] [22].
The authors of [43] initiated a new image encryption scheme based on Henon
chaotic system. The scheme basically, Shuffle and change the position of the grey
scale values of image pixels and then shuffle the relationship between the cipher-
image and the original-image. Firstly, they used Arnold cat map to shuffle the
position of the pixels. Secondly, the shuffled image is encrypted based on Henon’s
chaotic system pixel by pixel. Key space analysis and Histogram analysis were the
only two measurements applied on this scheme. The key space analysis was big
enough to resist brute force attacks but, the histogram results was uniform when
applied to the encrypted image but was not uniform enough compared to other
scheme like [32] [33].
Cheddad, Condell, Curran and McKevitt [44] proposed an image encryption
scheme based on cryptographic hash functions. The proposed scheme initially
takes a password derived from the user. Then it applies an extension of the SHA-
2 algorithm to handle 2D data. The term Irreversible Fast Fourier Transform
(IrFFT) was introduced in this paper as he reverse construction of the password
phrase is impossible. Finally, the produced map is XORed with the image’s bit
stream version. The output is then converted to grayscale values and rearranged
to create the encrypted image. Key space analysis, key sensitivity, adja- cent pix-
els analysis, randomness and other security merits are the 5 measurements applied
on the proposed scheme. All the values generated for this scheme shows similar
results with [35].
32
The authors of [45] proposed a sensitive image encryption algorithm based on
the Zaslavsky chaotic map. The proposed image encryption image uses the pseudo
random of the Zaslavsky chaotic map to generate the encryption key for this algo-
rithm. The pseudo-random numbers can be constructed by an iterative procedure.
They used a classical permutation substitution network. The histogram analysis
for this scheme showed a very uniform distribution of pixels like as the ones in
[40]. The entropy values are very close to 8. Comparing the results of this scheme
to [26] it is clear that this scheme gave a better results.
33
Chapter 3
Proposed scheme of AES image
encryption
3.1 Description of the scheme:
This chapter will show the code for the proposed scheme. It will illustrate how the
scheme encrypt and decrypt any colored image. It will also show the measurements
that was used to measure the performance of the scheme as well as comparison
with another schemes.
3.2 Code Implementation
3.2.1 Encryption and Embedding
To successfully encrypt an image multiple steps must be carried out, these steps
are going to be illustrated in the following codes. First of all, the desired image to
be encrypted must be imported and have a size of 256*256.
34
In[1]:= img =ExampleData[{"TestImage","Peppers"}]
Out[1]=
In[2]:= imgResized =ImageResize[img, 256]
Out[2]=
Then, The image is transformed into series of bit numbers and then the output
35
should be flatten to remove the brackets between the numbers. The matrix should
be simplified by dividing 10 for better code performance.
In[3]:= imgDataDecimal = Floor[ImageData[imgResized]*255]
In[4]:= imgFlattened = Flatten[imgDataDecimal]
In[5]:= hc = IntegerPart[imgFlattened/ 10]
Out[5]= {13, 1, 4, 17, 4, 11, 16, 3,.....,
19, 2, 13, 19, 2, 13, 19, 3,......,
17, 21, 16, 16, 20, 16, 18, 19, 15}
After that, The bits is going to be converted to ASCII code and then we must
make sure that its length is divisible by 8 as the code only take 8 bits at a time.
In[6]:= imgChar = FromCharacterCode[hc]
In[7]:= imgCharLength = StringLength[imgChar]
Out[7]= 196608
In[8]:= RL = Mod[imgCharLength, 8]
Out[8]= 0
Partitioning message into many sections, each section of a length of 8
36
In[9]:= Msgt =StringPartition[imgChar, 8]
Then, using AES–128 to encrypt the ASCII message, data is encrypted before
being embedded in order to increase security.
In[10]:= key =GenerateSymmetricKey[Method -> "AES128"]
Out[10]=
Creating empty arrays df and init.
In[11]:= dt = {};
In[12]:= init = {};
Looping to encrypt each partition of the message and inserting the encrypted data
in the array df while inserting the Initialization Vector in the array init.
In[13]:= Table[
eobjt =Encrypt[key,Msgt[[i]]];
bint =
eobjt["Data"] // Normal // IntegerDigits[#, 2, 8] & // Flatten;
initvect =
eobjt["InitializationVector"] // Normal //
IntegerDigits[#, 2, 8] & // Flatten;
dt = Join[dt, {bint}];
init = Join[init, {initvect}];
, {i, 1, Length[Msgt]}];
Then, flatten the encrypted binary data and compute its length
37
In[14]:= dft = Flatten[dt]
In[15]:= dflt = Length[dft]
Out[15]= {0, 0, 0, 1, 1, 0, 1, 0, 0, 0,.....,
1, 0, 1, 0, 1, 0, 1, 0, 0, 1,......,
1, 0, 1, 0, 0, 0, 0, 1, 1, 0}
Out[16]= 3145728
Then, this set of binary bits which is the output will be converted to integers and
then group them to from sets of RGB elements
In[17]:= Length[initvect]
y= Partition[dft, 8]
x2 = FromDigits[Transpose[y], 2]
y2 = Partition[x2, 3]
y3 = Partition[y2, 256]
eimage =ImageResize[Image[y3,"Byte"], {256, 256}]
Out[17]= {26, 6, 216, 255, 64, 230,
123, 154, 71, 17, 74, 159,
57, 210, 157, 166, 244, 47}
Out[18]= {{26, 6, 216},{255, 64, 230},
{123, 154, 71},{17, 74, 159},
{57, 210, 157},{166, 244, 47}}
38
Out[19]=
3.2.2 Extraction and Decryption
To decrypt this scheme we use the same way we used in encyption but in reverse.
So, we take both the extracted data and the initialization vector as characters
In[20]:= DeImg = Table[
eobj3t =
EncryptedObject[
Association[
"Data" ->
ByteArray[(FromDigits[#1, 2] &) /@
ArrayReshape[bint[[i]], {16, 8}]],
"InitializationVector" ->
ByteArray[(FromDigits[#1, 2] &) /@
ArrayReshape[initvect[[i]], {16, 8}]],
"OriginalForm" -> String]];
EnMSGt =Decrypt[key,eobj3t], {i, 1, Length[dt]}];
Now, the Decrypted image is generated in the variable DeImg but in the wrong
39
format so, the following lines of code shows how to get the original image back
again after decryption code. Fisrt, we need to remove the commas and concatenate
all the characters to be able to process it
In[21]:= r= Partition[DeMsgt, 1]
y= StringJoin[r]
StringReplace[y, Whitespace -> ""]
Out[21]= {{13, 1, 4, 17, 4, 11,
16, 3, 10, 15, 3, 10,
15, 3, 10, 17, 3, 12}
Then, we convert the characters into numbers
In[22]:= de = ToCharacterCode[y]
After this step we proceed with the same steps in the encryption but in reverse as
we are going to multiply the matrix by 10
In[23]:= de2 =de* 10
Out[23]= {130, 10, 40, 170, 40, 110,
160, 30, 100, 50, 30, 100,
150, 30, 100, 70, 30, 120}
Then, group each 3 numbers to create the RGB component and then convert them
into bits each 256 bits together
In[24]:= de3 = Partition[de2, 3]
40
Out[24]= {{130, 10, 40,},{170, 40, 110},
{160, 30, 100},{150, 30, 100},
{150, 30, 100},{170, 30, 120}}
In[25]:= de4 = Partition[de3, 256]
Then, the final line of code is the original image again after decryption
In[26]:= originalimage =Image[de4,"Byte"]
Out[26]=
3.3 Performance Evaluation Metrics and Numer-
ical Results
Evaluation performance metrics are used in research papers to measure the per-
formance and effectiveness of the scheme are Histogram analysis, Mean Square
Error (MSE), Peak signal to noise ratio (PSNR), Entropy and Structure similarity
index measurement (SSIM). The scheme was tested using 3 sample images which
are (Peppers and Lena)
1.Histogram Analysis
41
It is clear from figures 3.1 & 3.2 that shows the difference between the his-
tograms when before and after encryption.The histogram of the encrypted image
is fairly uniform and is significantly different from that of the original image. This
makes it very difficult for attackers to obtain the original image from encrypted
version.
Table 3.1: Histogram Analysis for Peppers image
Original image Encrypted image
Histogram of original image Histogram of encrypted image
42
3.PSNR Analysis
The values of PSNR are showed in Fig. 3.4.
Table 3.4: PSNR results.
PSNR
Peppers 8.12582
Lena 8.62525
4.Entropy
Fig. 3.5 shows the Entropy results for the proposed scheme.
Table 3.5: Entropy results.
Entropy
Peppers 7.99832
Lena 7.99472
5.SSIM Analysis.
Fig. 3.6 shows the SSIM results which are very close to 0.
Table 3.6: SSIM results.
SSIM
Peppers 0.0187008
Lena 0.0214706
44
3.3.1 Comparison With The Literature
The proposed scheme in this paper was tested with multiple performance measure-
ments and it generated good results. A comparison in the results of the proposed
scheme and another schemes that also perform image encryption is shown in Fig.
3.7. Where MSE, PSNR, Entropy values were measured and compared. When
comparing the results it shows that the proposed scheme is slightly better that
[40] in terms of MSE and PSNR. While, scheme mentioned in [42] was slightly
better that the other the other two schemes.
Table 3.7: Comparison.
Scheme MSE PSNR Entropy
Proposed scheme (Peppers) 10011.5 8.12582 7.99832
Alexan et al. [42] 10069.0756 8.13789 7.99894
Kandoz & Aexan [40] 10002.3 8.09089 7.9964
45
Chapter 4
Conclusions
4.1 Conclusions
The aim of this paper was to create an image encryption scheme that is as secured
as possible with good performance measurements. In the first chapter, a brief
overview on digital images was mentioned. In the second chapter, I talked more
about the definition of cryptography and it’s types. In the third, The lines of code
of the scheme was explained. The code was applied in Wolfram Mathematica.
Finally, a comparison was made between the proposed scheme and other scheme
doing the same thing.
46
References
[1] A. Dixit and R. Dixit, “A review on digital image watermarking techniques,”
International Journal of Image, Graphics and Signal Processing, vol. 9, no. 4,
p. 56, 2017.
[2] T. Sutter, “An overview of digital printing for advanced interconnect appli-
cations,” Circuit World, 2005.
[3] B. Kuriakose and K. Preena, “A review on 2d image representation meth-
ods,” Int. J. Eng. Res. Technol.(IJERT), vol. 4, no. 4, 2015.
[4] R. H. Wiggins, H. C. Davidson, H. R. Harnsberger, J. R. Lauman, and
P. A. Goede, “Image file formats: Past, present, and future,” Radiographics,
vol. 21, no. 3, pp. 789–798, 2001.
[5] C. Edge and D. O’Donnell, “Introduction to cryptography,” in Enterprise
Mac Security, Springer, 2016, pp. 497–499.
[6] D. Kahn, “A plausible pre-history of cryptography,”
[7] B. Oktaviana and A. U. Siahaan, “Three-pass protocol implementation in
caesar cipher classic cryptography,” IOSR Journal of Computer Engineering,
vol. 18, no. 04, pp. 26–29, 2016.
47
[8] A. Mishra, “Enhancing security of caesar cipher using different methods,”
International Journal of Research in Engineering and Technology, vol. 2,
no. 09, pp. 327–332, 2013.
[9] L. Kruh and C. Deavours, “The commercial enigma: Beginnings of machine
cryptography,” Cryptologia, vol. 26, no. 1, pp. 1–16, 2002.
[10] N. Crato, “The enigma machine,” in Figuring It Out, Springer, 2010, pp. 101–
104.
[11] F. L. Carter, “The breaking of the lorenz cipher: An introduction to the
theory behind the operational role of “colossus” at bp,” in IMA International
Conference on Cryptography and Coding, Springer, 1997, pp. 74–88.
[12] M. Bellare, A. Desai, E. Jokipii, and P. Rogaway, “A concrete security treat-
ment of symmetric encryption,” in Proceedings 38th Annual Symposium on
Foundations of Computer Science, IEEE, 1997, pp. 394–403.
[13] M. B. Yassein, S. Aljawarneh, E. Qawasmeh, W. Mardini, and Y. Khamay-
seh, “Comprehensive study of symmetric key and asymmetric key encryption
algorithms,” in 2017 international conference on engineering and technology
(ICET), IEEE, 2017, pp. 1–7.
[14] J. O. Grabbe, The des algorithm illustrated, 2010.
[15] S. Heron, “Advanced encryption standard (aes),” Network Security, vol. 2009,
no. 12, pp. 8–12, 2009.
[16] A. M. Abdullah et al., “Advanced encryption standard (aes) algorithm to
encrypt and decrypt data,” Cryptography and Network Security, vol. 16,
pp. 1–11, 2017.
48
[17] T. Nie and T. Zhang, “A study of des and blowfish encryption algorithm,”
in Tencon 2009-2009 IEEE Region 10 Conference, IEEE, 2009, pp. 1–4.
[18] P Fanfara, E Dankov´a, and M Dufala, “Usage of asymmetric encryption algo-
rithms to enhance the security of sensitive data in secure communication,” in
2012 IEEE 10th International Symposium on Applied Machine Intelligence
and Informatics (SAMI), IEEE, 2012, pp. 213–217.
[19] G. Singh, “A study of encryption algorithms (rsa, des, 3des and aes) for in-
formation security,” International Journal of Computer Applications, vol. 67,
no. 19, 2013.
[20] P. Mahajan and A. Sachdeva, “A study of encryption algorithms aes, des
and rsa for security,” Global Journal of Computer Science and Technology,
2013.
[21] N. Li, “Research on diffie-hellman key exchange protocol,” in 2010 2nd Inter-
national Conference on Computer Engineering and Technology, IEEE, vol. 4,
2010, pp. V4–634.
[22] M. Amara and A. Siad, “Elliptic curve cryptography and its applications,” in
International workshop on systems, signal processing and their applications,
WOSSPA, IEEE, 2011, pp. 247–250.
[23] C. Cid, “Recent developments in cryptographic hash functions: Security
implications and future directions,” Information security technical report,
vol. 11, no. 2, pp. 100–107, 2006.
[24] S. Debnath, A. Chattopadhyay, and S. Dutta, “Brief review on journey of
secured hash algorithms,” in 2017 4th International Conference on Opto-
Electronics and Applied Optics (Optronix), IEEE, 2017, pp. 1–5.
49
[25] Z.-H. Guan, F. Huang, and W. Guan, “Chaos-based image encryption algo-
rithm,” Physics letters A, vol. 346, no. 1-3, pp. 153–157, 2005.
[26] X. Wang, L. Teng, and X. Qin, “A novel colour image encryption algorithm
based on chaos,” Signal Processing, vol. 92, no. 4, pp. 1101–1108, 2012.
[27] X.-Y. Wang, Y.-Q. Zhang, and X.-M. Bao, “A novel chaotic image encryption
scheme using dna sequence operations,” Optics and Lasers in Engineering,
vol. 73, pp. 53–61, 2015.
[28] A. Sinha and K. Singh, “A technique for image encryption using digital
signature,” Optics communications, vol. 218, no. 4-6, pp. 229–234, 2003.
[29] G. Chen, Y. Mao, and C. K. Chui, “A symmetric image encryption scheme
based on 3d chaotic cat maps,” Chaos, Solitons & Fractals, vol. 21, no. 3,
pp. 749–761, 2004.
[30] Y. Zhou, W. Cao, and C. P. Chen, “Image encryption using binary bitplane,”
Signal processing, vol. 100, pp. 197–207, 2014.
[31] O. Mirzaei, M. Yaghoobi, and H. Irani, “A new image encryption method:
Parallel sub-image encryption with hyper chaos,” Nonlinear Dynamics, vol. 67,
no. 1, pp. 557–566, 2012.
[32] C. Li, G. Luo, K. Qin, and C. Li, “An image encryption scheme based on
chaotic tent map,” Nonlinear Dynamics, vol. 87, no. 1, pp. 127–133, 2017.
[33] Q. Zhou, K.-w. Wong, X. Liao, T. Xiang, and Y. Hu, “Parallel image en-
cryption algorithm based on discretized chaotic map,” Chaos, Solitons &
Fractals, vol. 38, no. 4, pp. 1081–1092, 2008.
[34] T. Li, B. Du, and X. Liang, “Image encryption algorithm based on logistic
and two-dimensional lorenz,” IEEE Access, vol. 8, pp. 13792–13 805, 2020.
50
[35] Z. Yun-Peng, L. Wei, C. Shui-Ping, Z. Zheng-Jun, N. Xuan, and D. Wei-di,
“Digital image encryption algorithm based on chaos and improved des,” in
2009 IEEE international conference on systems, man and cybernetics, IEEE,
2009, pp. 474–479.
[36] Y.-Q. Zhang, X.-Y. Wang, J. Liu, and Z.-L. Chi, “An image encryption
scheme based on the mlncml system using dna sequences,” Optics and Lasers
in Engineering, vol. 82, pp. 95–103, 2016.
[37] A Akhshani, A Akhavan, S.-C. Lim, and Z Hassan, “An image encryption
scheme based on quantum logistic map,” Communications in Nonlinear Sci-
ence and Numerical Simulation, vol. 17, no. 12, pp. 4653–4661, 2012.
[38] Y.-Q. Zhang, Y. He, P. Li, and X.-Y. Wang, “A new color image encryption
scheme based on 2dnlcml system and genetic operations,” Optics and Lasers
in Engineering, vol. 128, p. 106 040, 2020.
[39] N. K. Pareek, V. Patidar, and K. K. Sud, “Image encryption using chaotic
logistic map,” Image and vision computing, vol. 24, no. 9, pp. 926–934, 2006.
[40] M. T. Elkandoz and W. Alexan, “Image encryption based on a combination
of multiple chaotic maps,” Multimedia Tools and Applications, pp. 1–22,
2022.
[41] M. ElBeltagy, W. Alexan, A. Elkhamry, M. Moustafa, and H. H. Hussein,
“Image encryption through r¨ossler system, prng s-box and recam´an’s se-
quence,” in 2022 IEEE 12th Annual Computing and Communication Work-
shop and Conference (CCWC), IEEE, 2022, pp. 0716–0722.
51
[42] W. Alexan, M. ElBeltagy, and A. Aboshousha, “Rgb image encryption through
cellular automata, s-box and the lorenz system,” Symmetry, vol. 14, no. 3,
p. 443, 2022.
[43] C. Wei-Bin and Z. Xin, “Image encryption algorithm based on henon chaotic
system,” in 2009 International Conference on Image Analysis and Signal
Processing, IEEE, 2009, pp. 94–97.
[44] A. Cheddad, J. Condell, K. Curran, and P. McKevitt, “A hash-based image
encryption algorithm,” Optics communications, vol. 283, no. 6, pp. 879–893,
2010.
[45] R. Hamza and F. Titouna, “A novel sensitive image encryption algorithm
based on the zaslavsky chaotic map,” Information Security Journal: A Global
Perspective, vol. 25, no. 4-6, pp. 162–179, 2016.
52