This site uses cookies for learning about our traffic, we store no personal details. ACCEPT COOKIES DECLINE COOKIES What are cookies?
univerge site banner
Review Article | Open Access | Aust. J. Eng. Innov. Technol., 4(3), 45-51 | doi: 10.34104/ajeit.022.045051

Data Encryption Using Image Processing: A Brief Study

Mahmud Rahman Parag* Mail Img ,
Tania Akter Setu Mail Img

Abstract

We can see considerable growth in the field of science and technology over the past few decades. This growth has also brought an enormous threat to the data used by users. Encryption and decryption of data play an important role in safeguarding the data. Many authors have contributed much outstanding research on unauthorized access to user data. In this journal, I have proposed an algorithm for data encryption using images. My main aim is to provide a new and highly customizable approach to protecting data using images and eliminating the use of plaintext. In my research, I will use images to encrypt and decrypt data rather than using plaintext. 

INTRODUCTION

In this digitalized era, data is everywhere. From daily messaging to storing friends information onour mobile, from Facebook to criminal information in police office databases, everything is digitalized data. Protecting it from unwanted access is becoming a must to keep our privacy. Cryptography protects this data by changing it into unclear data that can only be accessed via author-ized receivers, who then convert the uncertain data into the original textual content (Alemami et al., 2019). By this, we eliminate any kinds of unauthorized access and protect our data.

There are many existing solutions for data encryption. AES and RSA are one of the most used and popular algorithms. AES and RSA heavily relied on plaintext as a key. A long key made encryption much harder to break, but the catch is you have to remember the key. If someone uses different plaintext to encrypt different data then the 

problem gets much bigger. On top of that, if someone saves their key in a text file then anyone can suspect that text file is a key. On the other hand, AES has a key length limitation. Here, in my thesis, I have shown an alternate approach to eliminate plaintext and use an image as a key for data encryption.This algorithm uses image pixel values as a key and encrypts and decrypts data. On top of that, there is no key length limitation in this algorithm as long as someone has enough disk space and processing power.

Literature Review

Cryptography is a way to conceal confidential infor-mation from a third party by implementing keys that are only known by the communicating parties. For example, let us assume that two devices are comm-unicating with themselves. The sender will be A and the receiver will be B. When A will send the message A will the message using a key so that no other than A and B can see the message and when B will receive the message, B will use the same key as A to decrypt the message to get the original data back. While C who is an eavesdropper wont be able to get the original mes-sage as it is encrypted which is shown in Fig. 1

Fig. 1: Secure Data Transfer Between A and B.

Classification

Cryptography is classified into two categories: Symm-etricand Asymmetric Key Cryptography. Sometimes we can find a combination of symmetric and asym-metric key cryptography in some applications called hybrid schemes. It is because both types of algorithms have their strength and weakness. When they are com-bined, they protect each other weaknesses.

Symmetric Key Cryptography

Symmetric Key Cryptography is a type of crypto-graphy where a single secret key is used for both encr-yption and decryption. When parties send a message to another party, they use a single key to encrypt and decrypt their data.

Fig. 2: Symmetric Key Cryptography.

This Symmetric Key Cryptography has two types of structure.

Stream cipher

In this type data is encrypted bit by bit or byte by byte at a single time. The A5 algorithm is the best example of this type which is used in mobile phone calls.

Block cipher

In these types of cipher, data is divided into blocks and then encrypted at the same time. There are plentyof examples of this type of structure. One of the most popular algorithms which are used worldwide is the AES algorithm.

Asymmetric Key Cryptography

Asymmetric Cryptography is also called publickey cryptography. Inasymmetricor public-key cryptogra-phy, there are two keys: a private key and a  public key are used (Jirwan et al., 2013). When someone wants to encrypt their data, they generate these two keys and used their private key to encrypt their data and use their public key to decrypt. The RSA algorithm is the best example of this kind of cryptography.

Fig. 3: Asymmetric Key Cryptography.

Encryption and Decryption of Data Using Image Algorithim

Encryption and Decryption of data using images need several steps which are enlisted below:

Encryption Process:

1. Plaintext Processing

2. Key Generation

3. Encryption

Decryption Process:

1. Key Generation

2. Decryption

All designs of theseprocesseswill be explained in detail below. Before entering encryption and decryption 3 key variables should be initialized.

1) NUMBER_OF_COLUMN_TO_MAP

2) NUMBER_OF_ROW_TO_MAP

3) RANDOMIZE_BOX

These three variables should be implemented in the algorithm for encryption and decryption and must be the same for both. If all values of these three are chan-ged in the algorithm, then all values of these three variables have to be changed and have to be the same in the decryption algorithm also for a given conne-ction. For instance, if a and b want to transfer data to each other then a will encrypt his data and b will dec-ryptas data using the same value of these three variables.

Encryption Process

Plaintext Processing

It is a mapping-like algorithm. It maps several chara-cters to several boxes. We use two important para-meters:

1) Number of characters to map per row (character = byte)

2) The number of rows and columns need to map into

Number of Characters to map per row have to be sma-ller than or equal to the number of rows needed to map. These two parameters are hardcoded in the algo-rithm. Now, it takes the plain text and split the text depending on those two parameters if there are any remaining characters it will take those characters after doing the encryption of previous characters. For exam-ple, let us assume the plain text is “001122334-45566778899AABBCCDDEEFF”, the Number of characters to map per row is 2, the Number of rows needs to map into is 16, and the number of columns needs to map is 10. So, the actionsare,

1) Convert every character to their ascii value. So, the ascii hex value of plaintext will be ‘48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 65 65 66 66 67 67 68 68 69 69 70 70

2) Then, from the parameter, every two ASCII val-ues will be mapped into every 10 rows. It will be like this Fig. 4

Fig. 4: Plaintext mapping into boxes.

Simple MATLAB Code

Fig. 5: Simple MATLAB Code for plaintext processing.

Key Generation

In this part, we take an image as a key. Let us assume, we take a 20 X 20 size image which is 20 * 20 = 400 * 8 = 3200 bit key. We take any channel from R, G, or B and use it as a key.

Fig. 6: A 20 X 20 Size Image as a key.

Fig. 7: Image Red Channel.

Fig. 8: Image Green Channel.

Fig. 9: Image Blue Channel.

Lets take the red channel for demonstrating the exam-ple. After taking a channel, split it according to the value of the Number column to map. So, we split it on every 10 values until we reached the end of the red channel. If the last split misses some value, we will fill up those values using the beginning value of the red channel. Fig. 9 will depict the process.

Fig. 10: Final Processed Key.

Simple MATLAB Code

Fig. 11: Simple MATLAB Code for Key processing.

Encryption

We begin the encryption by XORing all mapped plain-text by the first key row.

Fig. 12: First Row of the key.

Fig. 13: XOR of the first row and all rows of mapped plaintext.

After that, we do a circular right shift to the first row of the result of XOR where the amount is the number of rows needed to map subtract to the current row number.

Fig. 14: Circular right shift of the first row.

After that, we generate a fixed random matrix/array where the length of it is equal to the number of the column. These random numbers are unique and should not be greater than the number of columns.

Fig. 15: A Fixed Random Matrix/array.

Then, we randomize the right-shifted row cells accor-ding to the random number.

Fig. 16: Randomized Cells of the First Row.

And we continue to do the Circular Right Shift and Randomize the Row until all the rows of the result of XOR are done.

Fig. 17: Full result of Circular Right Shift, and Randomize of every Row.

Then we again do a circular right shift to the entire matrix/array. Where the amount of right shift is the number of keys subtracted from the row number of the current key.

Fig. 18: The full matrix of the result of the circular right shift.

Then we repeat the full process until all of the keys are used. In other words, all of the rows of the key matrix are used. And the final matrix will be the chipper text.

Fig. 19: The Chipper Matrix.

Flow Diagram

Fig. 20: Flow Diagram of Encryption Process.

Simple MATLAB Code

Fig. 21: MATLAB Code for encryption.

Decryption Process

Key Generation

Generating a key in the Decryption processis the same as the key generation processes of Encryption.

Decryption Process

The decryption algorithm is the exact opposite of the encryption algorithm. First, we convert the chipper text to the number of columns needed to map by the Num-ber of rows needed to map the matrix then we do a full circular left shift and then we reconstruct the row from the randomized row and do a circular left shift until all row is done and then XOR it from the last row number or the last key until the first. And the result will be plain text.

Fig. 22: The Plain text Matrix.

Flow diagram

Fig. 23: Flow Diagram of Decryption Process.

Simple MATLAB Code

Fig. 24: MATLAB Code for Decryption Process.

Evaluation

Introduction

To implement it in a system, it hasto pass some speed tests. To evaluate it properly we are going to do a speed test for different keys so that we can conclude which key is most appropriate for general use in terms of length.

Speed Measurement

For the speed test, we will use 256-bit text and 3200-bit, 28800-bit, and 20280000-bit images. We are going to five times for every key and going to take their ave-rage.

3200-bit KEY: 

Plaintext:00112233445566778899AABBCCDDEEFF

Encryption

Table 1: Encryption Time Measurement for 3200 bit KEY.

Decryption

Table 2: Decryption Time Measurement for 3200-bit KEY.

28800-bit KEY: 

Plaintext: 00112233445566778899AABBCCDDEEFF

Encryption

Table 3: Encryption Time Measurement for 28800-bit KEY.

Decryption

Table 4: Decryption Time Measurement for 28800-bit KEY.

20280000-bit KEY:

Plaintext: 00112233445566778899AABBCCDDEEFF.

Encryption

Table 5: Encryption Time Measurement for 20280-000-bit KEY.

Decryption

Table 6: Decryption Time Measurement for 2028-0000-bit KEY.

CONCLUSION AND RECOMMENDATIONS

People use cryptography to safeguard their personal and commercial data. There are many algorithms avail-able for that like AES, and RSA but a problem with those is a limited length of key and every complex alg-orithm to implement. On top of that, remember plain text key is a tough job. In this research, I have used an image as a key, which opens up a door to remove the plain textkey and introduce a limitless bit of key which doesnt require memorization of the key. It also pro-vides a highly customizable algorithm where we can also use any kind of matrix-based mathematical fun-ction which produce an 8-bit int result and has an inve-rse function.This algorithm has a huge amount of chance for customization. Combining it with AES may create more security than it is now. Also,through some research,there are some possibilities of optimizing this algorithm for the longer keys to reduce time comp-lexity.

ACKNOWLEDGEMENT

First of all, I would like to express my profound-gra-titude to my honorable supervisor, Ms. Tania Akter Setu, for her constant and meticulous supervision, valuable suggestions, patience, and encouragement to complete the project work. I would also like to thank the CSE department of the UITS for providing us with the opportunity to have an industrial-level design ex-perience as part of our curriculum for the masters pro-gram. Finally, I would like to thank our families and everybody who supported us and provided us with guidance for thecompletion of this project.

CONFLICTS OF INTEREST

The authors state that there is no potential conflict of interest in publishing this research article.

Article References:

  1. Nitin Jirwan, Ajay Singh, Dr. Sandip Vijay, (2013). Review and Analysis of Cryptography Techni-ques. International Journal of Scientific & Engineering Research. 4(3), 1-6. https://www.ijser.org/paper/Review-and-Analysis-of-Cryptography-Techniques.html  
  2. Yahia Alemami, Mohamad Afendee Mohamed, Saleh Atiewi, (2019). Research on Various Cryptography Techniques. International Journal of Recent Technology and Engineering (IJRTE), 8 (2S3), 395-405. https://www.ijrte.org/wp-content/uploads/papers/v8i2S3/B10690782S319.pdf 

Article Info:

Academic Editor

Dr. Toansakul Tony Santiboon, Professor, Curtin University of Technology, Bentley, Australia.

Received

April 15, 2022

Accepted

May 21, 2022

Published

May 30, 2022

Article DOI: 10.34104/ajeit.022.045051

Corresponding author

Mahmud Rahman Parag*

Department of Computer Science and Engineering, UITS, Dhaka, Bangladesh.

Cite this article

Parag MR., and Setu TA. (2022). Data encryption using image processing: a brief study. Aust. J. Eng. Innov. Technol., 4(3), 45-51. https://doi.org/10.34104/ajeit.022.045051 

Views
203
Download
404
Citations
Badge Img
Share