Image Encryption Technique based on Hash Algorithm · 2018-07-15 · Image Encryption Technique...
Transcript of Image Encryption Technique based on Hash Algorithm · 2018-07-15 · Image Encryption Technique...
Image Encryption Technique based on Hash Algorithm
C. Christy 1 Dr. S. Arivalagan2
1 C. Christy, Research Scholar, Computer Science Department, Annamalai University.
2 Dr . S . Arivalagan, Assistant Professor, Department of Computer Science and
Engineering, FEAT, Annamalai University.
Abstract:
In the modern world, several algorithms have been existing that deals with text encryption.
Since for the last two decades research carried out to date on digital images encryption. So the paper
has been designed in such a way of encrypting digital image with password protection using 1D SHA-
2 algorithm coupled with a compound forward transform. Advantage of conjugate symmetry is used
for creating a spatial mask and the complex imagery part of the Fourier Transform is based on
frequency domain. This mask is then XORed with the bit stream of the original image. Exclusive OR
(XOR), symmetric operation, 0 means both binary pixels are zeros or both are ones and 1 otherwise.
Keywords:
Encryption, Cipher, Symmetric, digital image, Steganography
Introduction:
Much research has been done in the area of Steganography which is the science of hiding data
in a transmission medium. It is mainly used in content authentication such as smart Ids where
individual details are embedded in their photographs and in the field of medical imaging for secure
transmission of medical data.
Various hash algorithms are available such as MD5 (message digest 5) and SHA – 2 (Secure
Hash Algorithm) which hash data strings, thus changing their state from being natural to a seemingly
unnatural state. Here the aim is to extend SHA-2 (Secure Hash Algorithm – 2) to encrypt digital 2D
data. The introduction of two transforms combined with the output of SHA-2 creates a strong image
encryption [6] setting.
This paper is organized as follows: Section 1 deals with Literature Survey, Section 2 explains
the proposed method followed by conclusion and Reference in Section 3.
International Journal of Pure and Applied MathematicsVolume 119 No. 16 2018, 343-352ISSN: 1314-3395 (on-line version)url: http://www.acadpubl.eu/hub/Special Issue http://www.acadpubl.eu/hub/
343
Literature Survey:
According to [1], Many of the times while any message is transferring across the network for
security reasons they are normally encrypted directly to make user visibly intelligent to break the
encrypted images to get the original contents. So many systems are designed to become the
encryption and compression in single mould to provide greater security and he introduces presenting a
novel approach of encryption and compression using permutation and predictive coding. Converting
image into small blocks enhances the encryption and compression processes. Cluster and encryption
is applied on each block. After encryption compression method is applied to encrypted image. At the
receiver end exactly reverse process takes place.
Pathak[2] described that in any network communication like Internet, data encryption technique has
been widely used to ensure information security. Each type of data has its own internet characteristics.
Therefore, different encryption techniques should be used to protect the confidential data from
unauthorized access. There are other areas also where image encryption techniques are proposed for
security purpose. They survey several image encryption techniques with their flaws and advantages;
based on our survey we also suggested some future suggestions of image encryption, which may
provide better security enhancement in the case of various types of images. He discuss about the
chaos based cryptosystem for better analysis with data encryption standard (DES) encryption.
Mintu Philip and Asha das [3] Chaotic cryptography is more better than traditional encryption
methods. New direction of cryptography is Chaotic encryption. It makes use of chaotic system
properties such as sensitive to initial condition and loss of information. In the last two decades Many
chaoses – based encryption methods have been presented and discussed. In order to reach higher
performance, these methods take advantage of the more and more complex behaviour of chaotic
signals. Encrypting the entire image bit by bit using a fast conventional cryptosystem was discussed.
Techniques which are based on chaotic systems are emphasized, because these systems will improve
encryption algorithm security level by using properties of chaos including deterministic dynamics,
unpredictable behaviour and non-linear transform. Newly proposed image encryption techniques and
also enhance the security level by introducing more than one chaotic scheme for image encryption
algorithms.
Sourabhsingh[4] proposed that in network security applications, before transmitting data to a remote
machine it is encrypted at the sender side using any standard encryption algorithm. Most of the
encryption algorithms make use of secret key without which it becomes very difficult to retrieve the
actual data. In this paper, they suggested that a method which at first transforms the text into an image
using an RGB Substitution, and then encrypts the resulting image using AES algorithm, under this
International Journal of Pure and Applied Mathematics Special Issue
344
approach, the secret key is smartly sent along with the ciphertext in a single transmission, thus it also
solves the secret key exchange problem that generally arises in most of the encryption models. If a
hacker decrypts the image, then he got another image. This further confuses him whether the actual
information is in text or in image format? The group of text to image transformation and then AES
encryption makes actual information ( plain text ) highly secure for transmitting it on extremely
vulnerable and insecure network environment.
AES based Modified technique [7] is proposed by M. Zeghid, M. Machhout, L. Khriji, A. Baganne,
and R. Tourki. A secure symmetric image encryption technique is given by a new modified version of
AES.The main problem of AES encryption is textured zones exist in encrypted image. This problem
was removed by the support of keystream generator for image encryption. The two main keystream
generators used are (i) A5/1 keystream generator and (ii) W7 keystream.
Proposed Encryption Method:
SHA-2 extends the strength of a 1D hash algorithm to 2D data images. “Symmetric block
ciphers are one-way hash functions secure recurring tools in cryptosystems. They can be used to
obtain privacy, integrity and authenticity because of highly flexible primitives”.
SHA -2 hash standard underlies four secure hash algorithms SHA-224, SHA-256, SHA-384
and SHA-512. SHA algorithms are used to provide a condensed fixed length representation known as
message digest of an input message. The security of SHA-224, SHA -256, SHA –384 and SHA – 512
matches the security of AES with complexity of the best attacks as 2128
, 2192
and 2256
respectively.
SHA-2 can be described in two phases: pre-processing and hash computation. Pre-processing
comprises filling, parse the filled message into m-bit blocks, and setting any initialization values to be
used in the hash generation. The DCT and FFT are included into the process, to increase the built-in
level. Generate a random output that does not leave any distinguishable patterns of the original
image. The ordering of the transforms is very crucial since the algorithm’s strength lends itself to
exploiting the symmetrical property of the FFT’s imaginary part. The exhaustive step by step
description of the encryption algorithm is illustrated below.
The method works as a one-time pad cipher; therefore, the decryption will follow the same
digital process but with the cipher input into the system, i.e., symmetric encryption. The algorithm
generates a SHA-2 Starting with a password phrase K supplied by the user, i.e., SHA-256, which
forms the initial condition based hash string H (K). The vector H, treated as a string of hexadecimal
characters, is then converted to its decimal version and finally transformed to a bit stream matrix of
International Journal of Pure and Applied Mathematics Special Issue
345
fixed dimension K’ = {8 x 32}. The original image A is converted to a bit stream and reshaped to the
order 8 x MN. The partially extended key K, accommodate into the image bit stream.
Fig.1. Block diagram of the steps used in the proposed algorithm for image encryption
Therefore, the algorithm performs key full expansion towards the needed dimension, herein
8 x MN. Obviously, this step would result in repetitive patterns of ciphered image that would make
attacks by the prone, a problem that was independently noticed in Ref. [4]. To cope with this situation
the method applies a threshold DCT, where Eq. (2) is used, followed by FFT to provide security by
the diffusion requirement.
International Journal of Pure and Applied Mathematics Special Issue
346
Let the resized key be 8, MN ,where M , N denote the width and height dimensions of the
image. The FFT operates on the DCT transform of 8, MN subject to Eq. (2):
where the subscripts M and N denote the width and height dimensions of the
7 MN-1
f(u,v) = ∑ ∑ F(x,y) --------- ( 1)
x=0 y=0
Satisfying Eq. (2)
Where F(x, y) = DCT ( 8,MN ), subject to
F(x,y)= {
F(x,y) is the threshold DCT of 2D resized bit stream of the 1D hash string generated from
applying SHA-2 and denoted herein by 8, MN. Similarly f (u, v) is the threshold Fourier Transform of
the function F(x,y).
Generating a pseudo-random binary sequence from the orbit off (u, v) requires the mapping of
the state of the system to its binary values [0, 1]. One clear method for converting a real number to a
discrete bit symbol is to use a rule as shown in Eq. (2).
Map (x,y) = { ---------- ( 2)
of the password phrase is impossible, Hence the name Irreversible Fast Fourier Transform (IrFFT).
Where there is an appropriately selected threshold value and img ( ) denotes complex function
imaginary part which can be compared directly with a threshold thr. A balanced binary sequence and
robustness, thr should be chosen from the probability P (img (f (u, v)) < thr) = P (img (f (u, v)) > thr).
So, a signal of the imaginary part f (u, v) is always symmetrical around zero. Therefore, thr = 0 is an
explicit solution. Since the coefficients in this calculation are converted to a binary map the reverse
construction of the impossible password phrase. So the name Irreversible Fast Fourier Transform
(IrFFT). The generated bit-pattern exhibits sufficient randomness, which it will be proved, to provide
cryptographic security as shown in the security analysis section. This map finally is XORed with the
bitstream version of the image. The result is the conversion of grayscale values and then reshaped to
International Journal of Pure and Applied Mathematics Special Issue
347
form the ciphered image. A post-processing step is introduced providing pixel substitution based on a
new randomized image using K2 = H (H (K)).
The encryption Algorithm is summarised as follows:
1. Generate an SHA-based hash string of the user password.
2. Convert the hash into {8 x 32} binary matrix, SHA-256 is used. This step forms the initial
key expansion.
3. Resize this matrix to fit into the image binary matrix, this is denoted as 8, MN where M, N
are the original image dimensions.
4. Feed the result into a compound transform, DCT followed by FFT with those constraints
described in Eqs. (1) and (2).
5. XOR the result with the image bit stream.
6. Generate a new randomized binary Map of size (M x N) for the post-processing step (pixel
substitution) as shown with a simple example in Fig.1
7. Encrypted image.
The decryption process starts with step 6 as a pre-processing step then followed by steps 1–5.
Spatial domain is transformed into sensitivity. 2D-DCT and 2D-FFT can be applied to introduce the
above-mentioned sensitivity into two-dimensional spaces. Images can be easily encoded securely with
password protection. This scheme efficiently encrypts grayscale and binary images. To obtain some
traceable patterns RGB images using the same password for the three primaries inherited from the
original image (RGB colors are highly correlated). This is easily overcome through the following two
choices: either the user supplies three passwords each of which encrypts one color channel or more
conveniently the system generates other two unique keys from the originally supplied password. For
instance, To generate the different hash functions H(K), H(K) and H(H (K)) to encrypt the R, G and B
channels, respectively a single key can be utilized. Where K denotes the supplied key, → indicate the
string reading directions and H (H( )) denotes double hashing.
Experimental Analysis:
International Journal of Pure and Applied Mathematics Special Issue
348
In order to determine the secret key, an adversary might try to establish a relationship
between the plain image and its cipher version by observing the influence of a one-pixel change on
the overall encryption output. This influence is usually measured in percentage using the metric
NPCR ( number of pixel change rate) which calculates the number of pixel differences in two cipher
images relating to two plain images having only one-pixel difference and created using an identical
secret key.
Let the plain image’s cipher be and the one-pixel difference generated cipher be A`̀ , then
the NPCR can be obtained straightforwardly.
NPCR = x 100 %
Where,
Dij={
H and W denote the height and width of the image respectively.
The expected value of NPCR of two random images is estimated by:
NPCR = (1 -2-L
) * 100 %
Where, L corresponds to the number of bits that represent a color component, for
grayscale images L = 8 bits. Hence it is sought that NPCR = (1 – 2-8
) x 100 % = 99.6 %
Fig.2: The 2D-SHA-2 algorithm: (a) test image (mother of nature), (b) cipher using
‘steganography' as a password, (c) cipher using 'steganographic' as a password and (d)
difference between (b) and (c).
The results demonstrate the complexity of an algorithm and parameter requirements. Finally,
time complexity would be reduced greatly by adopting this work's method. It was coded the algorithm
using MATLAB tool.
International Journal of Pure and Applied Mathematics Special Issue
349
Fig 3: Camera man – Test Image Fig 4 : Encrypted Image
Table 1 shows the advantages of using the proposed encryption method in comparison with other
methods, particularly in steganography applications. The algorithm is capable of surviving JPEG
compression attacks up to 75% below of the hidden data to be destroyed totally.
Table 1: Comparison with Different encryption methods:
Method Encryption
matter
Steganography
matters
Balanced bit
distribution
Tolerance to
transmission faults
Suitability for
image coding
AES Excellent Weak Weak Average
Chaos Average Weak Average Very good
Bit Stream Ciphers Weak Very good Very good Very good
Proposed (SHA-2
Algorithm) Good Very good Very good Very good
Conclusion:
This paper has been presented a new encryption algorithm for two-dimensional data images.
This work bridges the extensive gap between cryptography and steganography. The proposed
algorithm is based on user’s password. Apply the extension of the SHA-2 algorithm to handle 2D
data. To generate more scattered data an Irreversible Fast Fourier Transform (IrFFT) is applied.
The proposed work is lightweight stream cipher tailored to digital images (2D data with high
correlation) and more precisely Digital Watermarking is needed for the digital image.
to handle 2D data. An Irreversible Fast Fourier Transform (IrFFT) is applied to generate
Bibliography:
[1] R. S. Kazi, P. N. Pokale, and P. S. Kamble, “Survey on image encryption and compression Techniques,” International Journal of Advanced Research in Computer Science Engineering and Information Technology Volume: 4 Issue: 3 pp.397–400, 2015.
International Journal of Pure and Applied Mathematics Special Issue
350
[2] S. Pathak, “A Review : Chaotic System with DES ( Data Encryption Standard ) Image Encryption Technique,” International Journal of Advanced Research in Computer and Communication Engineering Volume 2, Issue 7, vol. 2, no. 7, pp. 2536–2539, July 2013.
[3] M. Philip, “Survey : Image Encryption using Chaotic Cryptography Schemes,” IJCA Special Issue on “Computational Science - New Dimensions & Perspectives” NCCSE, 2011 pp. 2–5, 2011.
[4] S. Singh and A. Jain, “An Enhanced Text to Image Encryption Technique using RGB Substitution and AES," International Journal of Engineering Trends and Technology (IJETT) - Volume4 Issue5, pp. 2108–2112, May 2013.
[5] H. Gao, Y. Zhang, S. Liang, and D. Li, "A new chaotic algorithm for image encryption," ELSEVIER, vol. 29, pp. 393–399, 2006.
[6] T.E. Bavisha, Ms.M.MadlinAsha,” A KEYWORD BASED USER PRIVACY-PRESERVATION AND COPY-DETERRENCE SCHEME FOR IMAGE RETRIEVAL IN CLOUD”, International Journal of Innovations in Scientific and Engineering Research (IJISER),vol4,no1,pp30-35,2017.
[7] M. Zeghid, M. Machhout, L. Khriji, A. Baganne, and R. Tourki. “Modified AES Based Algorithm for Image Encryption” International Journal of Computer Science and Engineering “1 (1) (2006) pp.70.
International Journal of Pure and Applied Mathematics Special Issue
351
352