You are on page 1of 4

IMAGE ENCRYPTION & DECRYPTION MODEL

Dr. D. M. Shah, Reader, G.H.Patel Post Graduate Department of Computer Science and Technology Sardar Patel University, Vallabh Vidyanagar 388 120 (Gujarat, INDIA) ABSTRACT Internet based communications are evolving at a tremendous rate. Encryption of data has become an important way to protect data resources especially on the Internet, intranets and extranets. Encryption involves applying special mathematical algorithms and keys to transform digital data into cipher code before they are transmitted and decryption involves the application of mathematical algorithms and keys to get back the original data from cipher code. The goal of security management is to provide authentication of users, and integrity, accuracy and safety of data resources. Moreover, an image-based data requires more effort during encryption and decryption. The model for encryption and decryption of an image using suitable user-defined key is developed with the same objective.

1.

INTRODUCTION AND NEED

Considerations of privacy and confidentially in a computer environment have given recognition to the need for protecting certain communications and stored data from theft and misuse. A suitable methodology for protecting communicated or stored data involves the use of cryptographic techniques. Cryptography is the study of mathematical techniques related to aspects of information security such as confidentiality, data integrity, entity authentication and data origin authentication. [06] A message is plaintext. The process of disguising a message in such a way as to hide its substance is encryption. An encrypted message is ciphertext. The process of turning ciphertext back into plain text is decryption.[05]. Basic operations that can be carried out in encryption/decryption are: substitution and transposition. Due to advent of computers, these operations are carried out on binary bits.[04] The Internet has facilitated the development of a worldwide Virtual Community free from the constraints of time and geography. Due to the Internet there is no distance between a person located in one place and experts around the globe. Through electronic mail / voice mail / video mail it is possible to solicit the opinion of experts. Moreover, Telemedicine is becoming popular in the specialties of radiology, pathology, critical care and psychiatry, where data is in the form of image. It is required to ensure confidentiality and security for transmitting certain image-based data over the Internet. The aim of security management is to provide authentication of users and integrity, accuracy & safety of data resources. The model for encryption & decryption of an image is designed with the same purposes.

2. OBJECTIVES
The model for encryption and decryption of an image is designed with the objectives to have confidentiality and security in transmission of the image based data as well as storage in the data warehouse, with the help of suitable user-defined key.

3. ARCHITECTURE
For encryption and decryption a symmetric key model has been used. The architecture of image encryption and decryption model is described in Figure 1: Image Image Encryption Model

User Defined Key Decrypted (Original) Image

Cipher Code (an encrypted image)

Image Decryption Model

User Defined Key

Figure 1 : The Architecture Figure - 4 of the Image Encryption and Decryption Model

4. IMAGE ENCRYPTION MODEL


To aid in encryption, the function encrypt has been designed. It takes two parameters the byte value mybyte to be encrypted and a long integer curindex that is used to parameterize the encryption. The function uses the following algorithm. step 1. The length of the key is calculated. step 2. Considering the key as a circular list of characters, the character at the ith position in the key is extracted where i is the parameter curindex. step 3. The remainder k, when the character extracted in step 2 is divided by 8, is found. step 4. k is multiplied by 17 and added to mybyte, modulo 256. step 5. The byte in mybyte is rotated (k+1) bits towards right hand side. After that the byte is reversed. step 6. The bits in mybyte are separated and their positions are interchanged as follows. 6 8, 2 7, 7 6, 3 5, 1 4, 8 3, 4 2, 5 1 step 7. The resulting byte value is returned. Using the above function, the m x n image is encrypted by performing the following two steps on all pixels. step 1. The Red, Green and Blue components of the color value of the pixel at position (i, j) are encrypted individually by calling the encrypt function with the curindex parameter as i x n + j. step 2. The resulting Green, Blue and Red color values are stored in the Red, Green and Blue components of the result image.

In addition, one extra row is added to the end of the result image. The first pixel in this row contains the length k of the key in encrypted form. Next k pixels store the characters of the key in encrypted form. Both of these are encrypted using the same key as that supplied by the user. That is, Encrypted key = encryptkey key The rest of the pixels in this row are filled with random values.

5. IMAGE DECRYPTION MODEL


To aid in decryption, the function decrypt has been designed. It takes two parameters the byte value mybyte to be decrypted and a long integer curindex that is used to parameterize the decryption. It implements the exact opposite process of encryption. The function uses the following algorithm. step 1. The bits in mybyte are separated and their positions are interchanged as follows. 3 8, 6 7, 8 6, 1 5, 2 4, 5 3, 7 2, 4 1 step 2. The length of the key is calculated. step 3. Considering the key as a circular list of characters, the character at the ith position in the key is extracted where i is the parameter curindex. step 4. The remainder k, when the character extracted in step 2 is divided by 8, is found. step 5. The byte in mybyte is reversed. After that, the byte is rotated (k+1) bits towards left hand side. step 6. k is multiplied by 17 and subtracted from mybyte using unsigned byte arithmetic. step 7. The resulting byte value is returned. To decrypt the image, first the last row of the image is examined. The key length and characters of the key stored in that row are decrypted using the key supplied by the user. If the key supplied by the user is correct, the decrypted key is same as the key supplied by the user because Decrypted key = decryptkey (Encrypted key) = decryptkey (encryptkey key) = key otherwise it contains garbage. Once the authenticity of the key has been verified, the image is decrypted by performing the following two steps for each pixel in the m x n image. step 1. The Red, Green and Blue components of the color value of the pixel at position (i, j) are decrypted individually by calling the decrypt function with the curindex parameter as i x n + j. step 2. The resulting Blue, Red and Green color values are stored in the Red, Green and Blue components of the result image.

6. APPLICATIONS AND USABILITY


The models for encryption and decryption of an image transforms an image into cipher code using the user-supplied key, which allows users to have confidentiality and security in transmission of the image based data as well as in storage in the data warehouse.

7. FEATURES
An image encryption and decryption model uses user-defined key in generating cipher code from an image. Hence, the same image may have different cipher codes, depending on the key supplied by the user.

8. CONCLUSION
The image encryption and decryption model is designed and implemented to provide confidentiality and security in transmission of the image based data as well as in storage in the data warehouse, with the help of suitable user-defined key.

REFENRENCES
[01] Earl Gose, Richard Johnsonbaugh And Steve Jost: Pattern Recognition And Image Analysis, PHI, 1999. [02] [03] Anil K. Jain: Fundamentals Of Digital Image Processing, PHI, 1997. Harry Katzan, Jr.: The Standard Data Encryption Algorithm, Petrocelli Books, Inc, 1977. [04] Ranjan Bose: Information Theory Coding and Cryptography, Tata McGrawHill Publishing company Limited.(2002) [05] [06] Bruce Schneier: Applied Cryptography, replica press Pvt Ltd. (2001) Alfred menezes, Paul C. van Oorschot and Scott A. Nanstone: Handbook of Applied Cryptography, CRC press LLC (1997)

You might also like