Securing Text Messages Using Graph Theory and Steganography

: Data security is an important component of data communication and transmission systems. Its main role is to keep sensitive information safe and integrated from the sender to the receiver. The proposed system aims to secure text messages through two security principles encryption and steganography. The system produced a novel method for encryption using graph theory properties; it formed a graph from a password to generate an encryption key as a weight matrix of that graph and invested the Least Significant Bit (LSB) method for hiding the encrypted message in a colored image within a green component. Practical experiments of (perceptibility, capacity, and robustness) were calculated using similarity measures like PSNR, MSE, and SSIM. These measures had proved the efficiency of the system for image quality and hiding messages with PSNR ratio more than 85 dB, MSE ranged (4.537e-05 to 5.27546e-04) and SSIM=1.0 for using a cover file with size ranged from 256×300 to 1200×760 pixels and message ranged from 16 to 300 characters.


Introduction:
Securing information is an essential requirement for any process which involves the exchange of information. This is especially important in the case of financial transactions such as credit card or bank accounts…etc. and also for military and governmental information. Many researchers through last years presented many methods and approaches to secure data of any kind like text, images, and sound waves. These methods vary in applications due to the kind of key, type of mathematical approach, the strength of the method, and its immunity against attack. There are two types of securing art, first is cryptography which is the art of changing plain data to be not understandable and unreadable only by the one who has the encryption key, while the second is the art of steganography which is used to secure data by including it in another innocent file like a cover 1,2,3 . Therefore, the main difference between encryption and steganography is that when information is encrypted, the snipers can know that there is a connection between two parties (two or more) and the information is encrypted, however in the case of steganography, the third party (sniper) isn't able to know about the connection between two behind the scenes because this connection was hidden completely in a medium 4,5 .
Some studies used encryption to secure digital data and produced many types of methods like chaotic maps 6 , the Triple Data Encryption Algorithm (TDES) that uses symmetric encryption, and The Advanced Encryption Standard (AES) which is symmetric encryption also that depends on the Rijndael algorithm.
Whatever encryption developed methods had been used to secure information, the steganography still stands in hiding the secret information in digital cover files. Various steganography methods had been presented to secure data. Some of these methods in a spatial domain like Least Significant Bit (LSB) and others in the frequency domain as in DCT, FFT, and DWT transform. The type of data for secret and cover files also produced a way to differentiate the methods and domains 7 . This paper suggests a novel system to secure text messages by using graph theory; the graph is used to produce a key for encryption by generating a complete graph for the keyword and calculating an adjacency matrix of the graph, then applying it to text to obtain a cipher text. The cipher text is embedded in the green component of the cover image using the LBS (Least Significant Bit) technique that depends on hiding message bits within the LSB in cover file samples. The system permits the user to choose the keyword of n symbols (mixed letters, digits and special characters), also the system can encrypt many kinds of characters English, Arabic and special characters like ( +,-,*,>, etc.) using a table for transforming the characters to a number ranged from 0-100 prepared for this research. Statistical analysis like PSNR (Peak signal-to-noise ratio), MSE(mean squared error ) and SSIM(The Structural Similarity Index ) ratios are used to prove the efficiency of the system in securing text messages and produced very acceptable results.
To summarize our contribution, we find it important to use new methods in mathematics to secure data sent over the Internet and to develop some of the methods that have been put forward in previous research. Moreover, the importance of the time consuming factor in securing and retrieving messages appears due to its impact on the consumption of network resources. Our research proposes the idea of securing messages with a short time and with high efficiency, reducing calculations and time to an acceptable minimum and investing modern math methods in that.

Related Works
The securing mechanisms using cryptography and steganography have been studied by many researchers who sought to produce more immune schemes. Some of them used Chaotic systems to encrypt the data needed to be protected as well as decipher encrypted data like Deng Z. and Zhong S., they introduced an algorithm for digital image encryption based on the chaotic mapping, the authors analyzed the algorithm of chaotic and they ensured that it was simple and needed no prior knowledge of the orbital and the algorithm expanded the cryptographic space and reduced the number of iterations required in the mapping operation, and the image replacement method based on chaos that presented can resist the chosenplaintext attacks 8 . Pareek NK. et.al. produced an algorithm for Block Cipher using chaotic maps of 1D and 2D to encrypt data and decrypt the cipher data to retrieve the plain data again 9 . Kwon OM et.al. and Cao Y. used the chaotic maps to secure communication signals and images such that the entropy generated by the chaotic map produces the required confusion and diffusion 10 . Al-Bahrani EA and Kadhum RNJ. proposed a hybrid model that used a chaos system and Feistel network structure with a secret key of n-characters to give a new Feistel cipher that related with the message size 11 . Sahib Ogla RA. presented a complex method to hide information based on a spiral search method. The proposed system converted the image color system from RGB to HSV and hid the secret message in H component after dividing the H component into blocks and quarters, then started hiding from the center and spread in all direction 12 . Other researchers used the Graph theory to produce new methods in encryption. Yamuna M. et.al.
proposed a way to encrypt messages consisting of a binary string through a cipher chain blocking method. Musical notes of seven basic keys were used for encryption by taking the degree sequence of the graph constructed from that music note to form the key 13 . Akl SG. produced a model for securing the graph as a secret message itself, all the graph components as its vertices, its edges, and its edge weights need to be secured. The encryption algorithm depends on an alternative mapping, conjectured to be a one-way function, designed for securing graphs, and it requires a symmetrical key for both encryption and decryption 14 . Hraiz S and Etaiwi W. produced a new algorithm of a symmetric encryption using graph theory representation. Their algorithm encrypts text messages through converting them to a graph represented by adjacency matrix 15 . Etaiwi W. utilized graph theory properties to propose a symmetrical algorithm to encrypt and decrypt data securely. The algorithm used a cycle complete graph, and a minimum spanning tree to produce a cipher text .The author considered an undirected graph G(V,E) ,V represents vertices while E. is the edges between V. The algorithm represents data as vertices and each adjacent characters in the text represented as adjacent vertices in the graph, the vertices will keep adding until a cycle graph is formed. All alphabet characters are represented by a code in a special table. An adjacency matrix is created for the complete graph. Then the Minimum Spanning Tree (MST) is calculated from the complete graph and represented as adjacencymatrix that keeps data characters order in its diagonal. Adjacency-matrix of the complete graph is multiplied by the adjacency-matrix of MST. The resultant matrix is multiplied by the key matrix. The final matrix is the encryption data to be sent to the recipient for decryption a reverse multiplication is done with matrix inverse of the key and inverse of the matrixes sent by the sender, but the pitfalls of this algorithm is the increasing in size of cipher text more than 20 times of the plain text 16 . Akhter F. proposed a secured Graphstega system for securing information based on hiding principle to avoid steganalytic attacks. it converts the text message to graph word by word with Huffman encoding instead of letter by letter 17 . Kumari M. and Kirubanad VB modified a cipher algorithm to encrypt the data. The authors plotted the encrypted data onto a graph. Then, the graph was transformed into an image. A desired symmetrical key is selected by the sender and receiver to encrypt and decrypt original data. This system is used to secure data storing it in the cloud as a secret message inserted in the graphical image cover file in a network environment , the key of encryption is about 2 digits and this means there is a possibility to find out by trying or analyzing 18 .
Proposed System: The proposed system consists of two steps of securing techniques, encryption and steganography. The encryption algorithm is a symmetrical key system based on graph theory properties like edges, weight matrix and path while steganography is worked on spreading encrypted text bits randomly in the green component of a colored image as a cover file using replacement operation with Least Significant Bit (LSB) of Green-component

Encryption Algorithm:
The message is about a series of characters (English, Arabic, and special symbols) that need to be secured by an encryption algorithm with a key.
The key is a text also but processed by graph theory then used for the encryption process. Firstly a table of codes designed for this algorithm is used to substitute the text characters with its corresponding code number. The special codes are illustrated in Table 1.
The algorithm of encryption is consisting of several steps as below: Key Generation Steps:  (101)) to get the cipher text.

Convert the values from step 3 of cipher matrix
to obtain the encrypted message.

End
At the receiver side, the decryption process depends on the key generation algorithm and codes table. The encryption process takes two steps also: Decryption Key Generation Step: To create the decryption key we need to perform the encryption key generation steps then take the inverse of generated key to use it for decryption. Decryption Algorithm: 1-Put the cipher text in the matrix (m× n), where the number of columns equals the number of inverse key elements. 2-Convert the value for each letter of the cipher text using the Table (1). Then, the cipher code (Cipher) is hidden in a colored image as a cover and transformed via any communication media reaching to receiver side.

Open Access
At the receiver side, the keyword is transformed to a code as in Table (1) then extracting the weight matrix as in encryption phase. An inverse key is built: The key inverse used for reconstructing a plain message as in relation: PlainCode= A replacement operation is implemented for codes of plain code with Table ( The second step or proposed algorithm is steganography that hides the encrypted message in a cover file, the cover file is chosen as a colored image in RGB format and using the LSB method for hiding the secret message. The hiding algorithm steps are done as follows: • The encrypted text message is delivered from encryption algorithm as a series of numbers, these numbers are transformed to ASCII code that is 7bits to represent each number. the first two pixels that make us able to hide a message with 2 16 characters. • Reconstruct the R-G-B components to form the image again. • Send the image to the receiver. • End. Figure 3 shows the image before and after hiding a message "GOOD LUCK".

Figure 3. the cover image (256×300) pixels
At the receiver side the cover image is manipulated reversely to retrieve the encrypted text, as bellow: • The image is separated into its color components (RED-GREEN-BLUE), the BLUE component is transformed to ASCII code. • Taking the 16 bits of the LSB of the first 16 pixels to calculate the length L of the hidden message.
• Each bit of the LSB in the green component of the cover image is taken to build the ASCII code of the hidden message characters with the length L. • After the cipher message is built depending on the Table (1), the decryption algorithm is used to expose the plain message. • End.

Experimental Results Analysis:
Different lengths of secret messages were encrypted and hidden in different RGB images with the proposed system. The system proves its efficiency in securing text messages with less time in the range between (0.03-0.07) seconds for encrypting messages in lengths between (9-300) characters and(0.035-0.1) seconds for hiding algorithm.
In this paper, the PSNR was calculated for the cover image before and after hiding. PSNR is a common analysis mostly used for comparing noise ratio between two matrixes (two images in case of image processing field). Typical values for the PSNR in lossy image are in range (30-50) dB, for the 8 bits images, where higher is better 19,20 . It is based on mean squared error (MSE) between them. MSE and PSNR (in dB) are defined as: Here I1 is the original cover image and I2 is the cover image after the message was hidden, the PSNR ratios for all experimental images before and after hiding were very high and MSE were low that means there is less noise for the cover image after and before hiding process for different sizes of messages and image resolution, Fig. 4. Also SSIM is calculated to check the imperceptibility requirement of the proposed system; the results are shown in Table 2.  As shown in Table 2, the PSNR scores more than 85 dB for images before and after hiding process that means it is much better in securing and hiding information with less noise ratio. And that was proved also with the values of MSE as well as SSIM comparing this methods with DMWT and DWT system in (4) that ranged from (30-51) dB for the images (256×256) pixels. The most common attacks on stegosystem is traffic analysis. In it the intruder monitors the network traffic between sender and receiver and tries to capture any unusual communication pattern of information 17 . When something seems suspicious to the intruder means there are secret information. The steganography stage in this paper served the immunity of the system against traffic analysis, thus the innocent appearance of the cover letter concealing the secret message from attackers.
Statistical analysis, on the other hand, is used to analyze the content of the message to uncover a secret message 21 . The intruder can transform the message to ASCII code to check some pattern of numbers or counts the characters frequency… etc... So, the encryption process comes to distort the data before being covered, using a graph properties in generating the key matrix makes it hard to be found out and the encryption process encodes the message block by block with advantage of graph properties and this blocking encoding makes the system strong against common attacks that works on letter by letter analysis attacks.
comparing the proposed method of encryption with others like in (15) shows the advantages of proposed algorithm in many aspects like the size of cipher text regarding to plain text, Table(3) shows that the number of characters generated with (15) for n characters of plain text is n 2 character while proposed algorithm produced n cipher characters. Also time consumption in this algorithm was less than in (15) as shown in Fig. 5. Table 3. Relationship between plain text and cipher text size.

Conclusion:
Securing data of any type like text, images, sound, etc. became an essential matter to take care of many researchers and web users. Many researchers produced systems of the enormous variety in this scoop to support web and data manipulators with more and more securing approaches, at the opposite side the snipers and eavesdroppers develop methods for breaking security. This paper proposed an algorithm programmed by MAPLE and MATLAB. The algorithm is combined of two methods, encryption using the graph theory and steganography by LSB technique for securing text messages in a cover file of RGB image. The experimental tests using PSNR, MSE and SSIM proved the efficiency of the algorithm via testing many types and sizes of secret messages and cover image with the condition the cover is always bigger than the secret. The time consumption for a total process (encryption and hiding) was low.
Many enhancements can be added in future to strengthen the encryption and hiding algorithms by studying and investing more graph properties and types for encryption, like directed and complete and trivial graphs. Also, development can be directed towards securing different types of data such as images, video and audio, which reduces coding time, and improves the performance of the algorithm by investing more mathematical optimization methods.