Professional Documents
Culture Documents
Image Encryption Using SCAN Patterns Amp Hill Cipher
Image Encryption Using SCAN Patterns Amp Hill Cipher
Abstract— Encryption can be done in many ways for transport encryption. It intricately replaces the mapping of image with a
of image, data, video and audio over wireless networks. A new sequence of scan patterns randomly chosen from SCAN
technique for image encryption is proposed in this paper. The library by a key. A Modified Hill encryption and decryption
method uses a combination of SCAN patterns, carrier image and technique for images has been proposed in [6-7] which uses an
Hill-cipher technique. This ensures more security for the image.
involuntary random key matrix [6-7]. S.R.M. Prasanna, Y.V.
The SCAN is a language based spatial accessing methodology
generating a wide range of scanning paths. The carrier image is SubbaRao and A. Mitra [1] have presented a method for image
created with the help of an ASCII string. The obtained carrier encryption which involves known methods for magnitude and
image together with the payload is encrypted with SCAN patterns phase encryptions using carrier images. The methodology is
and XOR operation is performed between them. Then Hill-cipher done on grayscale images, by dividing the image into its
technique is applied for the resultant image to obtain the final corresponding bit planes. Encryption is done by using a scan
encrypted image. Applying reverse operation to the encryption path which is kept in secret. Chao-Shen Chen, and Rong-Jian
process, the decrypted images are retrieved. Chen have also presented an image encryption and decryption
process which is based on scanning patterns [2-5]. This image
Keywords—SCAN Patterns, Carrier, ASCII keywords, Hill-
cipher, Encryption and Decryption.
encryption method is based on the rearrangement of the pixels
of the image. The rearrangement is done by scan patterns that
are generated by the SCAN methodology.
I. INTRODUCTION
The confidentiality & security of sensitive With an aim to increase the key space of the
communication is one of the main concerns of cryptography. algorithm the concepts of SCAN patterns & Hill cipher are
Encryption is a process of restructuring the data into some combined in this work. The main objective of the proposed
unknown form controlled by a known random key to ensure algorithm is to encrypt an image using a technique different
privacy by keeping the message hidden from anyone for whom from the traditional permutation based pixel scrambling
it is not intended. Encryption and decryption techniques schemes.
usually require some secret message, referred to as a key to
enable authentication. Decryption is the reverse process of The organization of the paper is as follows:
encryption. The encryption process may use different keys for Following the introduction, the basic concept of SCAN
encryption and decryption. The message recipient creates a patterns, a method of generating carrier key and the Hill-cipher
private key and a public key. The public key is distributed are discussed in section II. Section III presents the proposed
among the message senders and they use the public key to method of image encryption by combining SCAN patterns and
encrypt the message. The unencrypted data is referred to as the Hill-Cipher algorithm. In section IV experimental results are
plaintext and the encrypted data as cipher text. The security of given. Finally, section V gives some conclusions.
encryption lies in the ability of an algorithm to generate cipher
text that is not easily reverted to the original plaintext. One can I. IMPLEMENTATION STEPS
use a two dimensional polygraphic substitution cipher such as
Hill cipher which increases the level of security. Hill cipher A. SCAN Patterns
uses Linear Matrix Algebra & Modular Arithmetic to encrypt The SCAN is a formal language-based two
and decrypt the information. A cipher key is the information dimensional spatial accessing methodology which can
that allows only those that hold it to encode and decode a represent and generate a large number of wide varieties of
message. Keys come in many different forms such as scanning paths. SCAN language uses four basic scan patterns.
passwords, numbers generated by an algorithm, digital They are continuous raster C, continuous diagonal D,
fingerprints and even electronic devices. A key allows both the continuous orthogonal O, spiral S, Right orthogonal A,
sender and the recipient of the message to understand how the diagonal parallel E, vertical symmetry S, continuous
message has been encrypted and assures them that nobody else orthogonal L, zeta Z, block Band raster R.
knows how it has been encrypted. Coming to the traditional
image encryption in non-transform domain it basically
involves the matrix based pixel location and/or pixel value
affine transformations causing histogram reshaping. One can
also use complex scan pattern based permutations for image
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.
A given input image is encrypted by rearranging the pixels of The structure of a scan pattern can be shown in matrix form.
the image using a set of scanning patterns. In this paper we For example, here two scan paths are shown in Fig. 2 below
assume that the maximum image size is 512×512 and the considering the continuous raster C and spiral-in I.
partition size is 8×8 blocks uniformly throughtout. Fig. 1
below depicts some standard scanning paths.
P(1,1) P(1,2) P(1,3) P(1,4) P(1,5) P(1,6) P(1,7) P(1,8)
(a)
(c) (d)
(b)
(c)
(e) (f)
Fig. 2: (a) Matrix form of a Scan structure, (b) Matrix form for Continuous
Raster C, and (c) Matrix form for Spiral In.
B. Carrier image
Generally a carrier is used to carry or transfer the secret
message or some image information. The carrier image can be
created by transforming text into an image by using ASCII
codes & 2D repetition. Keywords of size equal to original
image size are formed into a matrix form. Here, a carrier
image is generated with the help of a key “ECE Dept., SRKR
Engg College, Bhimavaram”, as password and is shown
below in Fig. 3. Once a carrier image is created it can be used
(g) (h) in the encryption process by XOR operations.
Fig. 1: Different Scan Patterns (a) Spiral-In (b) Zeta-Z (c) Block-B (d) Raster-
R (e) Right Orthogonal-A (f) Diagonal-D (g) Continuous Raster-C (h)
Diagonal parallel-E
1984
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.
orthogonal L, zeta Z, block B, raster R and their combination.
These patterns are taken as first key-P.
C. Hill cipher
The Hill cihper is a modular matrix multiplication
operation. It is a multi-symbol cipher, developed by the
mathematician Lester Hill in 1929 for data encyption. In
classical cryptography, the Hill cipher is a polygraphic
substitution cipher based on linear algebra. For text
encryption, the algorithm takes m-suceessive plain text
charcters represented by a vector R of numerical values. The
Hill cipher key M is a m*m matrix, and the cipher text block S
is given by, S MR mod128 . On the decryption side, a
modular inverse of key matrix M 1 is used. M and M-1 satisfy Fig. 4. Block diagram for the proposed scheme for Image Encryption using
Carrier image, SCAN patterns and
MM 1 M 1M I . For a 8-bit image encryption, we Hill-Cipher
partition the image into non-overlapping blocks R of equal size
M*M and use a key matrix M of size 4*4 with elements The Carrier image uses a second password key-R. The
chosen from {0, 1, 2, …, 255}. Thus R becomes an image carrier image is created with the help of ASCII values of mod-
block of size 4*4 of pixel values. Calculating this solution by 128 and is further encrypted by using another SCAN sequence
standard linear algebra algorithms takes a very little time. The controlled by a third key-Q. The resulting images from the
key size is the binary logarithm the number of possible keys. above steps are XOR'ed together to form an image to which
n2 Hill-cipher operation is applied which uses another & final
For 8-bit images there are 256 matrices of dimension n × n fourth key-M to get the final hill-Cipher encrypted image. For
creating a huge key space. The main equations depicting decryption all the above encryption steps are reversed
encryption and decryption are sequentially to get the original Einstein image. More number
of keys will produce higher security to the encrypted image.
1985
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.
(a) Original image (b) Cell & Scan encrypted image
(c) Histogram after XOR (d) Histogram after Hill-Cipher Encryption
MSE
1 M N
>
¦ ¦ Corg (P1, P2) Cenc (P1, P2)
MN P1 1 P 2 1
@
¦ S p, q
p ,q
NPCR u100 ,
R
where
°0 Corg p, q Cenc ( p, q)
S k, l ® ,
°̄1 Corg p , q z Cenc ( p , q )
and
ª
c p, q c p, q º» u100 .
(a) Histogram of the original image (b) Histogram after SCAN
1 «
¦
org enc
UACI
M « p ,q 255 »
¬ ¼
1986
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.
C. ENTROPY & Correlation
Different
Entropy is used to calculate the disorder in any image. Scan MSE/
Correlation:
Correlation is used to calculate the quality of the encryption Vertical
patterns PSNR NPCR UACI Entropy
algorithm. The correlation coefficient is used to compute the Horizontal
for image
correlation between two vertical and two horizontal and two Diagonal
EINSTEIN
diagonally adjacent pixels of cipher image. The expressions for
1.3814*104
entropy, covariance and correlation coefficient are reproduced Continuous 101.8721 99.6090 10.6064 7.6727
7.9655*104
below. The values of Horizontal, Vertical, and Diagonal raster C 28.0502
2.0911*104
correlation for encrypted image are also listed in the Table-1.
0.0028
The horizontal, vertical and diagonal correlations for the BlockB 101.7249 99.6162 10.5959 7.6721 2.5731*104
original image are shown in Fig. 7. Similarly Figs. 8, Fig.9, and Raster C 28.0565 8.5602*104
Fig. 10 depict the horizontal, vertical and diagonal correlations
for the SCAN encrypted, XOR operated, and the final Hill- 0.0045
Zeta Z 101.9144 99.6235 10.6155 7.6716 2.3415*104
cipher encrypted images respectively. Raster R 28.0484 0.0050*104
L 1
Entropy ¦ p log
i 0
i 2 pi
cov u, v E u E u v E v
Cov(u, v)
ruv
var(u ) var(v)
Different
Correlation:
Scan MSE/
Vertical
patterns PSNR NPCR UACI Entropy
Horizontal
for image
Diagonal
EINSTEIN
4.5210*104
Spiral in I 101.8094 99.6212 10.6473 7.6811 0.0021
28.0529 0.0025 Fig.7. Correlations for Original image
0.0041
Raster R 101.5863 99.6170 10.6091 7.6723 2.3404*104
28.0625 0.0015
0.0023
Vertical 101.4980 99.6113 10.6560 7.3256
symmetry 28.0401 6.8478*104
0.0025
S
1987
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.
REFERENCES
[1] S.R.M Prasanna, Y.V. Subba Rao and A. Mitra, “An Image Encryption
method with Magnitude and Phase Manipulation using carrier images,”
IJCS, vol. 1, No 2, pp.132-137, 2006.
[2] N.Bourbakis, “Image data compression encryption using G-SCAN
patterns,” IEEE conference on SMC, October 1997, pp.1117-1120.
[3] Shalin J Patel, “Image Encryption and Compression using Scan Pattern,”
IJSRD - International Journal for Scientific Research & Development
Vol. 3, Issue 03, 2015 | ISSN (online): 2321-0613
[4] Chao Shen Chen and Rong Jian Chen, “Image encryption and decryption
using SCAN methodology,” Proc. PDCAT, 2006.
[5] S.S. Maniccam and N.G. Bourbakis, “Image and video encryption using
SCAN patterns,” Pattern Recognition, vol. 37, pp. 725-737, 2004.
[6] Sinha, K. Sing, “A technique for image encryption using digital
signature,” Optics Communication, 218, pp.229-234, 2003.
[7] S.S. Maniccam, N.G. Bourbakis “Lossless image compression and
encryption using SCAN,” 0031-3203/$2000,2001.
[8] Prerna, Urooj, Meena kumari, Jitendra Nath shrivastava, “Image
Fig. 9. Plot of correlations after XOR Operation Encryption and Decryption using Modified Hill Cipher Technique,”
ISSN 0974-2239 Volume 4, Number 17 (2014), pp. 1895-1901
1988
Authorized licensed use limited to: Nitte Meenakshi Institute of Technology. Downloaded on June 14,2022 at 15:47:45 UTC from IEEE Xplore. Restrictions apply.