## Description

# Highlights

- This is the code that simulates the encryption and decryption of an image using random and private keys in MATLAB.
- After the pixel values are mapped onto the elliptical curve through the map table and then a public key is generated by the sender which is multiplied with each pixel value or point value.
- The online image encryption and decryption code are generated in the MATLAB tool.
- Another technique Logistic map and Arnold cat scrambling are used for the online image encryption and code is available at free-thesis.

This is the code that simulates the encryption and decryption of an image using random and private keys in MATLAB. This is the best online image encryption algorithm. In this, the elliptic curve cryptography is applied to achieve the security of any image before transmitting it to someone so that no other can see the data hidden in the image. At the receiver end, the destined user will already have the decryption key used for this. If the key is altered, the image will not be decrypted.

In the modern scenario, the digital images contain important information which required proper security while transmitting from one point to another. Security is valuable for some applications like military picture databases, medical imaging systems, and cable TV broadcasting. Image encryption has many benefits and it is the most popular security scheme of data or information processing.

# Thesis statement ( Image encryption/decryption thesis)

In industries, confidential images are required security functions so that unauthorized access of images is not possible. For the encryption or decryption of images, some public and private keys are used. The private key image encryption/decryption process follows the symmetric cryptographic scheme, whereas asymmetric cryptographic systems use in the public key encryption image. In public-key cryptography, the encryption and decryption keys are not the same.

The pixel value of the image is first converted into the points and formed groups onto the elliptic curve finite field. All the programs are developed in the MATLAB software, and performance is measured via some security analysis parameters. Simulate the MATLAB script and observe the results with different stages of encrypting and decrypting process.

### Elliptical Curve Cryptography (ECC)

Elliptical curve cryptography is a traditional approach to image encryption and decryption. The ECC (Elliptical Curve Cryptography) is a public key type and uses for those applications in which secure transmission channels are not available. In the image encryption process of ECC (Elliptical Curve Cryptography), the image message is mapped to the point on the curve and converting the mapped point into the message types. The quality of the image depends on the pixel value, and the image encryption process mapped these pixel values to point onto the curve.

Figure 1 graph of an elliptical curve [1]

The ECC (Elliptical Curve Cryptography) is a private-public key pair used to encrypt and decrypt the data. ECC is asymmetric in nature which means for encryption a public key is used and decryption is retained via private key. The image pixel value is encrypted with the public key and decrypts the ciphertext later using the corresponding private key. The image pixel value is converted into the points on the Elliptical curve, then the mapping process is applied in the finite field.

A map table is created with respect to the group of elliptic points. A private key is applied to the mapped points and encrypted the pixel values of the image. Later a corresponding public key is used for the decryption process and retained the actual image from the encrypted image. The image encryption and decryption code are written in MATLAB.

### Mapping Process

The image consists of pixel values for different formats, like a grayscale image containing 8-bit pixel values from 0 to 255. A color image consists of three octet values separately; shows Red, Green, and Blue intensity of color. An image is encrypted with ECC (Elliptical Curve Cryptography) considers each pixel as a message mapped to a point on the predefined elliptical curve. A map table is created with the help of the elliptic group generated first and then points are placed into the 256 groups. ECC(Elliptical Curve Cryptography) is used for the encryption of points after the mapping process of all pixel values of images related to point one by one. Mapping matrix generated after the code is debugging in MATLAB.

# MATLAB Code Execution in Steps (Generic)

MATLAB, a matrix laboratory, is the software used by engineers and computer scientists for designing algorithms, data analysis, exploration, visualization, application development, and many more things. They also do image encryption and decryption using Matlab. The above-mentioned Matlab code for image encryption and decryption will stimulate the same for you.

AES image encryption code algorithm is also implemented with the help of the MATLAB platform. AES image encryption Matlab code makes a cipher Image from the original and vice versa.

Encryption and Decryption using MATLAB TOOL

- The image pixel values generated the groups on the elliptical curve with different instant points after the mapping process. A point’s vector is added to all instant points generated in the group.
- After the pixel values are mapped onto the elliptical curve through the map table and then a public key is generated by the sender which is multiplied with each pixel value or point value.
- The pixel values of the image are encrypted using the public key onto the elliptic curve points.
- The mapped or converted image is retained using possession of a secret public key. Each pixel value is retained, and the real image is reconstructed from the encrypted image.

This thesis provided the secure encryption and decryption of an image using ECC. The online image encryption and decryption code are generated in the MATLAB tool.

*Another technique Logistic map and Arnold cat scrambling are used for the online image encryption and code are available at **free-thesis**.*

## This is the step by step execution of MATLAB code for Image Encryption using ECC along with the function dependency.

Disclaimer: The following code is for demonstration purposes only. Without required functions, it will not execute. To run the code, the complete repository has to be downloaded.

## Contents

## Step1: Generate Elliptic points

Each pixel in the image is considered as a message and it is mapped on a predefined elliptic curve. All possible points on the elliptic curve have to be generated first. The first step is to generate possible elliptic points on ECC curve.

p=123457; % Prime number is selected a=5376; % constants a and b that satisfy the eq 4*a^3+27*b^2~=0. b=2438; i=1; eccpoints=[]; for x=0:p for y=0:p if mod(y^2,p)==mod((x^3+a*x+b),p) % This equation must be satisfied by x and y for the given value of a, b and p. eccpoints(i,:)=[x y]; i=i+1; else end end end eccpoints_all=[eccpoints; 0 0; 0 0;0 0;0 0;0 0]; N=1; ii=1; for j=1:2:964 for i=N:1:N+255 x=eccpoints_all(i,:); % The above points are arranged to map the intensity of pixels of the image. maptab(ii,j:j+1)=x; % ii=ii+1; end ii=1; N=N+256; end x=(0:255)'; maptab=[x maptab];

## Step 2: Encrypt any image

This encryption code is scalable code and can be used on any size of image. Though we are demonstrating it on Lena image. As the image size increases, the computation time increases. The gray image conversion is done as preprocessing step. Generated Elliptic points in the previous step are used here. You need to enter the public and private keys and the same has to be used for the decryption.

%this code is used to encrypt and decrypt the image useng ECC img=rgb2gray(imread('lena.jpg')); % load any image [Enc_Msg]=Encryption_1(img); % This is process for encryption and output argument is having the set % off point for each pixel which are mapped at % the ECC curve.

## Step 3: Decrypt the image

Input the encrypted image and public-private (same as in the encryption step) keys to decrypt.

Decryption_1(Enc_Msg) % This is the decryption process which recieve the ECC points as input % and decryption key is generated and subtracted % from all these points one by one. Again mapping % is used to get the original image pixel.

### Advantages of ECC

- The ECC method is completely sensitive to the secret key so that the encrypted image cannot be decrypted while making some changes in the secret key.
- The entropy value is higher (8) which provides the optimal length of the code assigned to the pixel of an image.
- The range of the correlation coefficient must be lie between 0 to 1. The adjacent pixels correlation coefficient is maximum for better security.
- The input image contains some information that can be extracted for the encryption process. So histogram analysis provided the spectrum analysis of information of input and encrypted image.
- The secret key size is smaller.
- Low mathematical complexity.
- High-speed encryption.
- Brute force attack is impracticable for elliptical curve cryptography due to its logarithmic type of nature.

### Conclusion

In this work, the ECC (Elliptical Curve Cryptography) algorithm is proposed for the online image encryption and decryption process. ECC (Elliptical Curve Cryptography) is provided fast encryption and use for high information images. The mapping is performed for the conversion of pixel value into the point of an affine elliptic curve over a finite field using the map table. The encryption process is very fast and low complex in nature. The strength of the algorithm is checked by the security analysis function like histogram, key security, and correlation.

#### Published Paper similar to this work

This image encryption code can be used in the following and other similar research papers.

- Latha, H. R., and A. Ramaprasath. “Optimized Two-Dimensional Chaotic Mapping for Enhanced Image Security Using Sea Lion Algorithm.” In
*Emerging Research in Computing, Information, Communication and Applications*, pp. 981-998. Springer, Singapore, 2022. - Dastidar, Ananya, and Sonali Mishra. “Encryption and Decryption Algorithms for IoT Device Communication.”
*Electronic Devices and Circuit Design: Challenges and Applications in the Internet of Things*(2022): 97-112. - Hafsa, Amal, Anissa Sghaier, Jihene Malek, and Mohsen Machhout. “Image encryption method based on improved ECC and modified AES algorithm.”
*Multimedia Tools and Applications*80, no. 13 (2021): 19769-19801. - Chillali, Sara, and Lahcen Oughdir. “ECC Image Encryption Using Matlab Simulink Blockset.” In
*International Conference on Digital Technologies and Applications*, pp. 835-846. Springer, Cham, 2021.

### References

*Soleymani, Ali, Md Jan Nordin, Azadeh Noori Hoshyar, Zulkarnain Md Ali, and Elankovan Sundararajan. “An image encryption scheme based on elliptic curve and a novel mapping method.”Â International Journal of Digital Content Technology and its Applications7, no. 13 (2013): 85.**Astya, Dr ParmaNand, Ms Bhairvee Singh, and Mr Divyanshu Chauhan. “Image encryption and decryption using elliptic curve cryptography.”Â International Journal of Advance Research In Science And Engineering IJARSE3 (2014).**Singh, Laiphrakpam Dolendro, and Khumanthem Manglem Singh. “Image encryption using elliptic curve cryptography.”Â Procedia Computer Science54 (2015): 472-481.**Soleymani, Ali, Md Jan Nordin, and Zulkarnain Md Ali. “A Novel Public Key Image Encryption Based on Elliptic Curves over Prime Group Field.”Â Journal of Image and Graphics1, no. 1 (2013): 43-49.**Nagaraj, Srinivasan, G. S. V. P. Raju, and K. Koteswara Rao. “Image encryption using elliptic curve cryptograhy and matrix.”Â Procedia Computer Science48 (2015): 276-281.**Shankar, Tarun Narayan, and G. Sahoo. “Cryptography by karatsuba multiplier with ASCII codes.”Â International journal on computer applications(2010): 53-60.*

gajanan.bhusare(verified owner)–good

gajanan.bhusare(verified owner)–good

gajanan.bhusare(verified owner)–good

aaryan.aggarwal(verified owner)–good

aaryan.aggarwal(verified owner)–good

krisma.ziliwu(verified owner)–good

krisma.ziliwu(verified owner)–how

subham.pramanik(verified owner)–Excellent

nandan.kumar(verified owner)–N/a

alal.lolo(verified owner)–good

jjj.jjj(verified owner)–c

aaryan.nehra(verified owner)–nais

alaa.elbanna(verified owner)–it is okey

alaa.elbanna(verified owner)–it is very good to have such as code in my research

kavipriya.suresh(verified owner)–good

kavipriya.suresh(verified owner)–good