An Algorithm Based on Gsvd for Image Encryption

This paper represents a new image encryption algorithm based on modifying generalized singular value decomposition (GSVD) by decomposing the plain‐image into two segments using GSVD with an exchanged key‐image to produce the cipher‐image. The exchanged key‐image is used as an encrypting and decrypting image. Mathematically, this procedure is represented by transforming the plain‐image's matrix into two different matrices and applying the GSVD with the exchanged key‐image's matrix to obtain the cipher‐image's matrix. The two encoded segments can be kept in several places or assigned to a group of authorized persons. No one can obtain the information of the image easily without the knowledge of the decrypting key. This proposed algorithm is represented as one of the digital image encryption techniques used to enhance the security of images that have been sent between recipients.


Introduction
The most important thing in real-time image communication is the processing time of encryption and decryption procedures along with the required processing time compression and decompression.The computational process that accompanies encryption and decryption algorithms makes it impossible to handle a very big amount of processed data.It is very expensive to encrypt the whole compressed bit stream because of the processing time [1].One of the best techniques for data protection is to encrypt these data so that the original information cannot be accessed by anyone other than the sender and receiver without decrypting the data using a private key.The original data is known as plain data and the encrypted data is called cipher data.Encryption can be defined as the science of using mathematical algorithms to hide data in coded form, which can be decoded by the intended receiver, who is the only one with the decrypting key [2].Encryption can be applied to text messages, images, or videos for data protection [2].Also, encryption is defined as the process of encoding multimedia so that it cannot be read by anyone other than the licensed persons.The enciphered data is the outcome of this process.Decryption is the procedure of decoding the encoded data to obtain the original data [3].Many encryption techniques have been frequently used for text data or image data.Many researchers have tried to invent better cryptosystems to secure the transmission of images [4].The aim of this paper is to provide high security for the digital images that have been sent between participants to keep them safe from spying and hacking.Also, it aims to obtain encryption and decryption algorithms with high accuracy.

SVD and GSVD
The Singular Value Decomposition (SVD) of a matrix is the factorization of into the product of three matrices with positive real entries where the columns of and are orthonormal and is a diagonal matrix.The Generalized Singular Value Decomposition (GSVD) is a matrix decomposition , which is more general than the SVD.It is usually applied to images' encryption [3].
These two versions are different, because one version decomposes two (or more) matrices and the other version uses a set of constraints imposed on the left and right singular vectors.
The first version can be explained in the GSVD for k matrices Theorem, which is mentioned in [14 -16] as the following: Consider a set of k matrices with compatible dimensions: Then there exist  Unitary matrices and . Matrices , 1,2, … , 1 of the form: The integers represent the rank of satisfying: (  A matrix of the form: The matrices are diagonal with positive diagonal elements.and are, in general, not diagonal matrices or quasi-diagonal matrices such that the only nonzero blocks of , j l . . . . .k 1 are identity matrices and the nonzero blocks of are diagonal matrices with positive diagonal elements.The inverse of a nonsingular matrix is taken to be the last factor in every factorization.


For the other version, let be a given matrix, then the generalization of the singular value decomposition involves using two positive definite square matrices that have the size and respectively.These two matrices express constraints imposed respectively on the columns and the rows of .Formally, if the matrix expresses the constraints for the rows of and the matrix expresses the constraints for the columns of [4], then matrix is decomposed into: The generalized singular vectors are orthogonal under the constraints imposed by and .This decomposition is the result of the standard singular value decomposition.The matrix is defined as [3,4]: Then, the SVD is computed as such that: The matrices of the generalized eigenvectors can be obtained as: and The diagonal matrix of singular values is the matrix of singular values of That can be verified as the following: ∆ By substituting: The conditions in Equation (1) hold as the following; (10) And (11)

An Algorithm for Image Encryption and Decryption
This algorithm, based on GSVD, can be applied in image encryption and decryption using MATLAB (version 6.0.0.88,USA) as follows:

Encryption Procedure
The encryption procedure of this algorithm is shown in the following steps:  Start with virtual dimensions rather than mandatory dimensions and the algorithm is applied for any image and in any dimensions  Input an image of any size; in this case, 512 × 512 (this algorithm is applied for any image and in any dimensions).


Convert the image to a matrix .


Select an initial key to generate the following two matrices: * *  Choose an encrypting key image that can be converted to a matrix .


Compute the GSVD for each matrix and with the encrypting key matrix as the following: , , , ,  ,  , , , , ,


Compute the following: * * * *  Construct the encrypted matrix as such that,  Obtain the encrypted image form .  End.

Algorithm for Decoding
The following steps show the decryption procedures of the proposed algorithm when the decrypted image reaches the intended receiver:


Start. Download the encrypted image.


Obtain the matrix of the encrypted image, which is called . Split into and .


Obtain the decrypted key matrix , which is the same encrypted key matrix.


Compute the GSVD for each matrix and with the decrypting key matrix as the following: , , , ,  ,  , , , ,  ,   Compute the plain matrix as the following: * *   End.

Applications of the Proposed Algorithm
The proposed algorithm for an image can be applied to different types of images of any format and size using MATLAB.The following shows applications of this algorithm to Child and Lena images [13], with two different key-images: To determine whether the encryption time is accurate for this algorithm, we used the time complexity, which is a mathematical notation used to estimate the complexity level of an algorithm based on its data set, moving from 0 elements to an infinite number of elements.This complexity is represented by Big-O notation, which depends on the number of backtracking loops and transformations of the encryption algorithm that have to be performed on parts of the data.This proposed algorithm performs an accurate calculation for the encryption operation time since it has a very accurate time and sensitive process.Determining the decryption time relies on the number of possibilities to determine the encrypting key.Therefore, we can determine the time required to break the encryption if we can compute the number of possibilities for determining the encrypting key.In this proposed algorithm, there are an infinite number of possibilities for determining the encrypting key; therefore, this algorithm is very secure since it has an excellent decrypting time.

Experimental Results
The results are obtained by applying the algorithm of the generalized singular value decomposition to the image encryption procedure.The method of producing an output image with uniform distribution of pixel intensity is called histogram equalization [5,6].Figure 2 shows the images after decryption can be as exact as the original images.However, Figure 1 shows this algorithm has a very good encryption technique.Table 1 shows the encryption and decryption time, mean error, mean squared error (MSE), and peak signal to noise ratio (PSNR) for this algorithm of the generalized singular value decomposition when it is applied to the above images (Child and Lena images).They are defined in [10] as the following:


Mean Error is defined as the average of all the errors. MSE refers to the mean squared error, which tells you how close a regression line is to a set of points. PSNR refers to the peak signal to noise ratio, which is a mathematical measurement of an image's quality based on the pixel difference between two images and is equal to 10 .The precision standards in Table 1 show the accuracy of the encryption and decryption algorithms and the quality of the results of the PSNR value, which exceeds 145.Therefore, these readings indicate the concordance between the original image and the decrypted image.
There are many global features applied to the above Lena and Child images such as entropy, standard deviation, correlation, number of changing pixel rate (NPCR), and unified averaged changed intensity (UACI), which are defined in [7][8][9] as the following:


The entropy of an image can measure the information content of images but it has a limitation such as the amount of information which must be coded for by a compression algorithm.


In the standard deviation for a discrete (the probability density function), is denoted by sigma , where ∑ since the standard deviation is the square root of the variance .


Correlation coefficient is a single summary number between −1 and 1 that gives a good idea about how closely one variable is related to another variable. NPCR is the number of changing pixel rate. UACI is the unified averaged changed intensity.
Table 2 shows the correspondence and equality in each of the readings (entropy before encryption and entropy after decryption; standard deviation before encryption and standard deviation after decryption).Therefore, these readings indicate that there is no loss of the information of the image during the encryption and decryption procedures.Moreover, Table 3 shows a comparison between the proposed algorithm with other algorithms such as, MIE (Mirror-like Image Encryption) [11]; VC (Visual Cryptography) [12]; and MK-4 (Mohammed al-Kufi-level 4) [13].

Conclusions
This algorithm of the generalized singular value decomposition has the following properties that make it a good cryptosystem used for encrypting any type of image with the help of MATLAB program: i.
This method represents a new way to encrypt an image using a GSVD technique.ii.
The strength of this method depends on the knowledge of its two encryption keys.The first is a real number, and the second is a color image.Therefore, it is very hard for this cryptosystem to be broken by anyone other than the sender and the intended receiver.iii.
From Table 2, the correlation coefficient shows that the algorithms of this proposed algorithm have good strength, because the correlation coefficient between the plain-image and image after decryption reads the highest possible value for this criterion, which is 1.The value of 1 refers to the strength of the relationship between the original image and the image after the decryption procedure.Similarly, the correlation coefficient between the original image and encrypted image, which represents the absence of any connection between the original image and the encrypted image, reads the lowest possible standard value, which is (−1).iv.
The change of the color values in the encryption procedure, as shown in Table 2 for NPCR, has reached (99.9995%); this reading indicates precisely that the encryption has changed all the color values of the images.v.
Table 3 shows that the encryption and decryption time does not exceed 3.57 seconds-lower than the times recorded with the other algorithms.

Table 1 .
Encryption and Decryption Time (time/s), Mean Error, Mean Squared Error (MSE), and Peak Signal to Noise Ratio (PSNR).

Table 2 .
Feature extraction before and after encryption images.

Table 3 .
Comparing the proposed algorithm with other algorithms.