Rotation Left Digits to Enhance the Security Level of Message Blocks Cryptography

Due to the availability of several social media platforms and their use in sending text messages, it is necessary to provide an easy and safe way to protect messages from being hacked especially in the presence of intruders and data thieves, and taking into consideration that most of those messages are confidential and personal, it is necessary to provide an easy and safe way to protect messages from being hacked. In this research paper, a simple and easy method of message cryptography will be proposed. The method divides a message into blocks with fixed sizes. The block size ranges from 2 to 60. The method uses a secret color image to generate an array with a size equal to the number of resulted blocks. The array will then be used as a private key. Each element of the private key will be used to calculate the number of rotation digits for the associated block in order to apply block rotation left operation. The proposed method will be examined using the parameter’s Mean Square Error (MSE), Peak Signal to Noise Ratio (PSNR), Correlation Coefficient (CC), and throughput. The proposed method will be compared with other standard methods of message cryptography, such as Data Encryption Standard (DES), Triple-DES (3DES), Advanced Encryption Standard (AES), and Blow Fish (BF). Experimental results show that the proposed method is secured enough based on using secret image, block size, and calculated Rotation Left Digits (RLD) for each block.


I. INTRODUCTION
W HEN information or data is shared over the Internet, it transmits through a series of network devices around the world. Through the transmission, there is a possibility that the data is hacked or stolen by hackers. In order to prevent that, users need to install certain software or hardware to ensure secure transmission of data or information. This process in network security is called Encryption [1]- [6].
The encryption process involves converting plain text that is readable to humans into unintelligible text, which is known as ciphertext. This generally means changing the readable data into a format that it appears randomly. The encryption process uses an encryption key that is a set of mathematical values agreed upon by both the sender and the receiver. The recipient uses the key to decrypt the ciphertext and convert it back to readable plain text [7], [8]. The more complex the encryption key, the more secure the encryption as third parties are less likely to be able to decrypt data through brute force attacks (i.e. trying random keys until the right one is found) [3]. The Encryption is also used for protecting passwords. It hashes a password to become unreadable for hackers [9].
One of the most important methods for protecting text messages (i.e., short and long messages) is Data Cryptography. It encrypts the data before sending and decrypts it after receiving [10]- [13]. Data Encryption-Decryption process is usually applied by using a secret private key (PK) that is only known by the sender and receiver. In our research paper, we will focus on symmetric cryptography while the encryption and decryption processes [14] use the same PK as shown in The encryption process destroys the original data so that it becomes incomprehensible and useless. The decryption process converts the encrypted data into the original data without any error by using the PK and specific methods. Mean Square Error (MSE), Peak Signal to Noise Ratio (PSNR) and Correlation Coefficient (CC) are used to compare the quality of two messages (i.e., the sent message and received message). The equations 1, 2 and 3 represent the MSE, PSNR and CC respectively [15]. The value between the source message and the encrypted message must be very low in PSNR and CC and must be very high in MSE, and vice versa in the decryption process [16], [17].
According to the studies [16]- [18], the selected method of data cryptography must meet the following requirements: Simple and easy to implement, optimal values of quality parameters during the encryption and decryption phases, efficient by maximizing the throughput (i.e., processed bytes per second), and thus minimizing the encryption-decryption times, and highly secure by preventing message hacking.
The equations show the CC computation.
where N = m*n.
where CC represents correlation coefficient, xi denotes values for first message, yi represents values of second message, and x and y indicate means for x and y. The digital color image [13], [18]- [22] has a huge amount of data that is organized in a three-dimensional matrix. Therefore, a two-dimensional matrix is allocated to each of the three colors (i.e., red, green and black), as shown in the Figure 2.
The matrix of a digital color image can be employed to carry out many processing operations that are necessary for many vital applications for many reasons. The most important of these reasons are: to the availability of multiple sources through which a digital color image can be generated [13], [23]- [25] 2) Ease of storing a digital image for reference at any time and when needed. 3) Possibility of dealing with a two-dimensional matrix separately for each of the three colors. 4) Ease of applying all arithmetic and logical operations on the colored graph. 5) Possibility of using parts of three color matrices. 6) Possibility of using a colored digital image to generate special secret keys and lengths on demand by implementing the process of resizing the image using the required dimensions.
In this research paper, the color image will be used as an image_key in order to generate a private key (PK) that will be used in the message block rotation operation. The length of the private key will be equal to the number of blocks in the secret message. Each value in PK will be used as a block rotation value (BRV) in order to calculate the number of rotation left digits (RLD) what are required to rotate the message block.
For the purpose of this work, we need to notice the following points: changing a block length will change the size and the values of PK, and replacing the image_key with another image will change the values of PK element, as shown in Figure 3, Figure 4, and Figure 5. Figure 6 shows all the images that will be used in this research paper as a source images in order to generate needed PKs. Table 1 shows basic information about these images.
The organization of this paper is as follows. Section 2 presents related work . Section 3 demonstrates the proposed approach. Experiments are conducted in Section 4, followed by the conclusion in Section 5.

II. RELATED WORK
Information security is defined as a set of processes and practices that aim to protect and preserve information from external threats, such as destruction, theft, and sabotage. It mainly depends on the protection of all kind of information wherever it is found in a way that is largely determined by the policy of the company or the individual owning it [7].
Many Internet users suffer from data penetration problems,  which have become a real threat to the security of the Internet and to the devices and electronics that are associated with it. In order to deal with this threat and enhance data privacy and protect it from espionage, some of users and business owners resort to depend on closed Internet networks that are protected by special codes and ciphers. Some of other users and business owners prefer to dispense with the transfer of important or confidential data over the Internet. Therefore, they use external storage cards or disks to transfer data between devices [8], [9]. Other users and business owners are concerned in anti-virus programs and electronic piracy and they seek to obtain the programs from reliable companies that are more careful in adopting new and updated programs for detecting new viruses and malware. Various text messages are widely circulated through various and disparate social media. This imposes on us a responsibility to protect these messages, which are confidential and highly personal nature, from stealing, viewing and understanding by intruders or data thieves [23], [25]. Encryption algorithms are used to convert data into ciphertext. They use encryption keys to change the data in a predictable way, so it can be converted back to plain text by using the decryption key. According to the literature, there are several different types of encryption algorithms that are designed to suit different purposes. Furthermore, new encryption algorithms are also developed when old algorithms are unsafe. Some of the most popular encryption algorithms are a follows [26]- [30].

1) Encryption according to the Data Encryption Standard
The Data Encryption Standard (DES) is an obsolete symmetric encryption algorithm that is not suitable for today's use. Therefore, other new encryption algo- This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication.  is a symmetric key algorithm. It is called "triple" because the data is passed through the original DES algorithm three times during the encryption process. It is being phased out from the use of the triple standard for data encryption. However, it can still create a reliable encryption solution for the financial services and other industries [1]- [3].

3) Encryption according to the Advanced Encryption
Standard The Advanced Encryption Standard (AES) is developed to update the original DES algorithm. Some of the most popular applications of the AES include messaging applications, such as Signal or Whatsapp and WinZip [27]- [30]. 4) Encryption with the Rivest, Shamir, and Adelman algorithm The Rivest, Shamir, and Adelman algorithm (RSA) is the first available asymmetric cipher algorithm that uses a pair of keys. It is popular and widely used for secure data transmission because of its key length. The algorithm has this name according to the FIGURE 6: Images used for the proposed approach family surnames of the three mathematicians who first described it, i.e., Ronald Rivest, Addie Shamir, and Leonard Adelman [31], [32]. 5) Blowfish Encryption The Blowfish algorithm is used in both hardware and software. It is considered one of the fastest of its kind. Blowfish is not patented, and this makes its encryption freely available to anyone who wants to use it. As a result, the Blowfish algorithm is built into a different encryption software like Photo Encrypt, GPG, and the popular open-source program True Crypt [23].
Many methods are used for message cryptography. Many of these methods are based on the standards (i.e., DES, 3DES, AES and Blowfish). Many of these methods have some disadvantages which are to be solved. However, these methods provide good values of the quality parameters (i.e., MSE, PSNR and CC), and have many advantages. The advantages are as follows [26]- [29]: 1) Block size: The block size is fixed for each of the standard methods of data cryptography and it differs from method to another with a minimum size equal to 8 bytes (64 bits) for the DES method. 2) PK: The standard methods use a fixed length of a private key. and sometimes it can be hacked . 3) Other keys: The PK is used to generate other needed keys for the encryption-decryption phases. 4) Round: Each standard method uses a number of round in order to apply the process of cryptography. 5) Throughput: Most of the standard methods provide a low throughput, especially if the data to be encrypted has a big size. 6) Flexibility: The standard methods require a sequence of arithmetic and logic operations in order to maintain the data cryptography, and it is very difficult to do any modifications to these operations. 7) Security: Some standard methods provide a low level of security. Therefore, new methods should be adopted in order to protect messages and to make the hacking process more difficult. 8) Structure: All the standard methods have a Feistel structure using Feistel sub functions in order to perform various logical operation and to make methods not simple and difficult to modify.
In this article, we take these advantages into consideration and introduce a new method of message cryptography to achieve the following points: [31]- [37]: 1) Increase the size of the message block that be encrypted and make the size variable and be selected by the user. 2) Select a PK from a secret message and must be kept in secret in order to protect it from being hacked. The PK can be of any length and its size depends on the message block size. The PK can be changed from block size to another and from selected image_key to another. 3) Increase the efficiency of cryptography by increasing the throughput. Therefore, the method must decrease both the encryption ET and decryption times. 4) Get an acceptable values of quality parameters (i.e., MSE, PSNR and CC). Process all data, messages and images regardless the data length. Ability to modify the PK and the block size with no need to modify the process of cryptography.
Many techniques were introduced for message cryptography. In [38] a method base on chaotic map model was introduced and the throughput was improved and reached 0.1691 M byte per second, while in [39] the introduced method gave a throughput equal 0.71 M byte per second. The benefits of our study is to solve the disadvantage of mostly introduced methods of data steganography by increasing the throughput, increasing the level of security, allowing using variable length blocks and variable length acting secret keys.

III. THE PROPOSED METHOD
The proposed method is based on implementing two basic operations. The two operations are PK generation and message block rotation. A secret color image will be selected to be used as an image_key. The image must be resized to get a PK with a size equal to a message block size. The generated PK contains a set of elements. A value of each element will be used as a block rotation value (BRV). Furthermore, it will be used to calculate rotation left digits (RLD) which is needed as a number of rotation left digits required to rotate the associated message block. The second operation is rotating left the message block RLD times. The rotation left is implemented as shown in Figure 7.
The value of RLD used in the encryption phase must be less than 500 because MATLAB cannot apply rotation left for a digit greater than 500. The retaliation left digits of the decryption process will be equal to a message length VOLUME 4, 2016 . Then, we have to subtract RLD from the resulted value. The resulted RLD must be less than 55. We have to notice an important fact that is obtained experimentally. The fact is that the RLD value must be greater than the block size (in byte) to avoid the occurrence of message characters in the encrypted message as shown in Table 2.
The proposed algorithm of the encryption and decryption process is shown as in algorithm 1. Figures 8 and 9 show a calculated example of the rotation process in the encryption and decryption phases.

IV. IMPLEMENTATION AND EXPERIMENTAL RESULTS
The proposed method is implemented using I5 processor, with 8 GB RAM using MATLAB. The proposed method will increase the security level of data cryptography based on (1) The image_key must be kept in secret, (2) The generated PK size depends on the block size, if the block size equal 50 elements, the number of combinations required to hack the key is equal ((2 8 ) 50 = 2 400 , this satisfies the requirement for good key security.  This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3187317 Several messages and image_keys are used in the proposed approach. The following message block is implemented using various values of RLD. The images 1-12 (see Figure  6) are used to generate the needed BRV. Table 3 shows the obtained experimental result of a message block: 'Amman is the capital city of Jordan'. Table 3, the proposed method provides excellent values of the quality parameters, i.e., MSE, PSNR, and CC. Furthermore, the proposed approach gives a high and acceptable throughput value. The Average estimated time VOLUME 4, 2016 7 This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3187317  is 0.0060,and the average throughput is 5833.3 (byte per second). Different random message blocks was used as an im-age_key. Table 4 shows the experimental results when image 2 is used as an image_key. The results of PSNR, MSE and CC listed in the table are between the original message and the encrypted one, but these value between the original message and the decrypted one were MSE=0, PSNR =infinite, and CC=1.

As shown in
Furthermore, Table 4 shows that the proposed method provides excellent values of the quality parameters, i.e., MSE, PSNR and CC. Table 4 also reports that the proposed method gives a high and acceptable throughput value. The Average estimated time is 0.0052 and the Average throughput is 5279.7.
Considering the results shown in Tables 3 and 4, we notice the following important facts: 1) The block size of an image can range from 1 to 60. In our experiments, the limitation of the block size of an image is due to the MATLAB. 2) In general, increasing the size of an image_key will increase the encryption/decryption time. In the proposed method, the encryption time for the large images is still acceptable and the method remain efficient. Therefore, it is safe to select an image with any size and get a high value of throughput. 3) According to the results shown in Figures 10 and 11, there is a best block size selection that the method achieves best throughput value. That size is 20 bytes.
The standard methods of message cryptography are also implemented using various methods or algorithms . Table 5 summarizes the results of different algorithms compared to the proposed method: The Speedup of the proposed method is the ratio of TP of the proposed method and TP of other methods. Table 5 shows that the proposed method is more efficient and has a significant speedup comparing to the other standard methods of data cryptography. The image shown in figure 12 was selected as an image_key, several messages were encrypteddecrypted using block size=50, table 6 shows the obtained results: Clearly, the obtained average throughput and speedup were like (1856.4) and (1.8129 M byte per second) for encryption and decryption processes respectively. The average speedup The obtained throughput also better than those obtained in the studies [38], [39]. Here we must select a block size with

V. CONCLUSION
In this article, we have proposed a method for secret message cryptography. It has been shown that the method is very secure and provides a high degree of protection in a way that making the process of hacking secret messages is very difficult. The method uses a secret image_key to generate a PK that is needed to extract BRV. The extracted BRV will then be used to calculate the RLD for each block. The key is changeable and depends on the size of a message block and on the selected image_key. The image_key must be kept in secret by the message sender and receiver. It can be replaced at any time when needed by another image without any method modification. The proposed method has no constraints on the selected image_key, i.e., the image VOLUME 4, 2016 9 This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3187317 key can be any image with any type and size. Although increasing the size of an image will increase the encryption time, the proposed method will remain efficient for large size of images. The message is divided into blocks. The size of blocks is varied between 1 to 60. In our experiments, each size has been examined and all the obtained results are acceptable. Furthermore, a maximum throughput value has been achieved when the block size is equal to 20 bytes. The obtained experiment results have shown that the proposed method provides excellent values of the quality parameters, i.e., MSE, PSN, and CC, and so it satisfies the requirements of good cryptography. The proposed method is very efficient and provides good values of encryption (decryption) time.
The proposed method has been compared with standard methods of message cryptography. The experimental results have shown that the proposed method outperforms the standard methods and has a significant speedup. ABEER AL-HYARI Abeer Al-Hayri is an assistant professor at the electrical engineering department at Al-Balqa Applied University, As Salt, Jordan. Abeer's research involves cryptography, in addition to the application of machine learning, deep learning, recurrent neural networks to problems in FPGA CAD. Abeer received her Ph.D. degree in Computer Engineering from University of Guelph, Guelph, Canada.
KHALED ALDEBEI is an Assistant Professor at the Information Technology Department/The University of Jordan (Jordan). He received a Phd in computer science from the University of Technology Sydney, Australia. Aldebei has the higher degree by research publication award from the University of Technology Sydney. He has an Oracle Certified Associate (OCA) and Oracle Certified Professional (OCP). Aldebei worked in the computer centre at the University of Jordan as a computer programmer and system analysis. Then, Aldebei worked in the Faculty of Information Technology and Systems, University of Jordan, as a teaching assistant. Since 2018, Aldebei works in the same faculty as an assistant professor. Aldebei has many programming skills, e.g. Python, Oracle (Form and Report Builder), MATLAB and Database (SQL, PL-SQL). He has published many articles in high rank journals and international conferences. Currently he is the head of Information Technology and Computer Information Systems departments. His current research interests include machine learning, data mining, text processing and natural language processing. ZIAD A. ALQADI received the B.E., M. E., and Dr. Eng. degrees from Kiev Polytechnic Institute. in 1980Institute. in , 1983Institute. in , and 1986, respectively. After working as, a researcher from 1986, an assistant professor from 1991 in the department of Electrical Engineering, Amman Applied College, and an Associate Professor from 1996 in the Faculty of Engineering Technology, he has been a professor at Albalqa Applied. since 2010. His research interest includes signal processing, image processing, data security and parallel processing. This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3187317