Image Encryption and Decryption Using BL PDF
Image Encryption and Decryption Using BL PDF
_________________________________________________________________
Proceedings of "National Conference on Emerging Trends in Information Technology (NCETIT-2012)"
Held at R.C.Patel Institute of Technology, Shirpur, Dist. Dhule,Maharashtra,India.
April 21, 2012
1Assistant Professor, Electronics Department, M.H. Saboo Siddik College of Engineering, Mumbai University, Mumbai, India
2,3,4Electronics Department, M.H. Saboo Siddik College of Engineering, Mumbai University, Mumbai, India
Abstract
This paper is about encryption and decryption of images using a secret-key block cipher called 64-bits Blowfish which is an
evolutionary improvement over DES, 3DES, etc designed to increase security and to improve performance. This algorithm
will be used as a variable key size up to 448 bits. It employs Feistel network which iterates simple function 16 times.
Specifically, in this algorithm, a combination of four S-boxes lookups, multiplications as well as fixed and data dependent
rotations will be used. In this paper we would be obtaining our results by simulating the image processing part in MATLAB &
encryption and decryption part in VHDL for better security.
Keywords:Blowfish, Cryptography, Image Encryption, Image Decryption, Feistel Network, Block Cipher.
INTRODUCTION
science of protecting information by encoding it into an unreadable
In the past few years the security and integrity of data is the format. It is an effective way of protecting sensitive information as it
main concern. In the present scenario almost all the data is is stored on media or transmitted through network communication
transferred over computer networks due to which it is vulnerable to paths.
various kinds of attacks. To make the data secure from various To encrypt the data various cryptographic algorithms such
attacks and for the integrity of data we must encrypt the data before DES, 3DES, blowfish, AES, etc are used. So we are implementing
it is transmitted or stored. Government, military, financial institution, blowfish algorithm which is strongest and fastest in data
hospitals and private business deals with confidential images about processing/storing compare to other algorithms which is mentioned
their patient (in Hospitals) , geographical areas(in research ) ,enemy above. Blowfish algorithm is highly secured because it has longer
positions (in defense), product , financial status. Most of this key length (more no of key size). The philosophy of proposal
information is now collected and stored on electronic computers and algorithm is to use the full menu of “Strong operations” supported in
transmitted across network to other computer. If these confidential modern computers to achieve better security properties and provide
images about enemy positions, patient and geographical areas fall high speed. The main aim behind the design of this proposal is to get
into the wrong hands, than such a breach of security could lead to the best security/performance tradeoff over existing ciphers. Here we
declination of war, wrong treatment etc. Protecting confidential would be considering a Tagged image file format (TIF).
images is an ethical and legal requirement.
We store information in computer system in the form of files. BLOWFISH ALGORITHM
File is considered as a basic entity for keeping the information.
Therefore the problem of securing image data or information on Blowfish is a symmetric block cipher that encrypts data in 8-
computer system can be defined as the problem of securing file data. byte (64-bit) blocks. The algorithm has two parts, key expansion and
It is word wide accepted fact that securing file data is very important, data encryption. Key expansion consists of generating the initial
in today’s computing environment. contents of one array (the P-array), namely, eighteen 32-bit sub-
Cryptography is a method of storing and transmitting data in a keys, and four arrays (the Sboxes), each of size 256 by 32 bits, from
form that only those, it is intended for can read and process. It is a a key of at most 448 bits (56 bytes). The data encryption uses a 16-
round Feistel Network.
The F function
*Corresponding Author
Figure 1 shows a block diagram of an algorithm with the
Irfan Landge Feistel structure for encryption, with 16 rounds of confusion and
Assistant Professor, Electronics Department, M.H. Saboo Siddik College of diffusion. Mathematically the functions can be expressed as below:
Engineering, Mumbai University, Mumbai, India Take a block of 64 bits and divide it into two equal halves: L and R.
Then define the iterated block cipher when the outputs Li and Ri of
Email: [email protected]
152 Landge, Patel and Choudhary
the i'th round are determined from the outputs Li-1 and Ri-1 of the The addresses a, b, c and d are 8-bits wide, while the S-box outputs are
previous round: 32-bits wide.
Li = Li-1 The process of data encryption can be described as in the
Ri = Li-1 F (Ri-1, Ki) pseudo code below:
where Ki is the sub-key used in the ith round and F is specific to the Divide X into two 32-bit halves XL and XR
particular algorithm. For i=1 to 16:
XL = XL Pi
XR = F (XL) XR
Swap XL and XR
End for
Swap XL and XR (Undo the last swap.)
XR = XR P17
XL = XL P18
Recombine XL and XR
Output X (64-bit data block: cipher text)
For decryption, the same process is applied, except that the
sub-keys Pi must be supplied in reverse order. The nature of the
Feistel network ensures that every half is swapped for the next round
(except, here, for the last two sub-keys P17 and P18).
Encryption Process
Decryption Process
Fig 2: F function
Fig 6: Encryption-1
Encrypted Output 1: F724DCE39143E75D
Fig 7: Decryption-1
Decryption Output 1: 0607998404E1B33C
Fig 5: Black & White Images
Plaintext (Input) 2: CFC982019FF00738
The above result shows the original image, encrypted image Here row 4 is been considered for the plaintext. Row 4 comprises of
& the decrypted image. We can clearly see that the decrypted image 64 bits.
is same as the original image.
Fig 8: Encryption-2
Encrypted Output 2: 3EEAC76656B872E3
154 Landge, Patel and Choudhary
The input text consists of bits. The Encrypted output is of 16 bytes. Here row 17 is been considered for the plaintext. Row 17 comprises
of 64 bits.
CONCLUSION
Both colour and black & white image of any size saved in
Fig 14: Decryption-2 tagged image file format (TIF) can be encrypted & decrypted using
Decryption Output 2: 3FFFFFFFFFFFFFF0 blowfish algorithm. Histogram of encrypted image is less dynamic
and significantly different from the respective histograms of the
HISTOGRAM ANALYSIS original image. Blowfish cannot be broken until an attacker tries
28r+1 combinations where r is the number of rounds. Hence if the
Here the original image and its corresponding encrypted number of rounds are been increased then the blowfish algorithm
image and their histograms of black & white images and colour becomes stronger. Since Blowfish has not any known security weak
images respectively are shown in fig 15 and fig 16. points so far it can be considered as an excellent standard
encryption algorithm.
REFERENCES
[11]Simar Preet Singh, Comparison of Data Encryption Algorithm, BLOW FISH Algorithm”,International Conference on Electronics
IJCSC, Vol 2 No.1, June-2011,pp 125-127. Communication and Instrumentation and Control
[12] Irfan Abdul Gani landge, Burhannudin Contractor Tauseef Engineering,2012,pp 34.
Companywala, “VHDL Based Encryption and Decryption using