An implementation of Hill Cipher and 3 × 3 × 3 rubik’s cube to enhance communication security

Introduction Information is a very significant asset for an organization because it becomes an essential resource in increasing business value. This causes information security to be essential for every organization. Information security refers to all aspects that are used to protect various types of threats or affect the organization's sustainability. It follows from (Indrajit, 2011) that information technology is like a double-edged sword because, on the other hand, it benefits from applications such as e-government, e-commerce, e-society, and e-education. On the other hand, information technology also has weaknesses such as commercial crimes, character assassinations, fraud, covert wiretapping. Today, human life is integrated with a network that is transmitted through the internet network every moment. In sharing this information, security is needed to ensure the safety of information from various attacks that can spread information that should be confidential (Kalaichelvi et al., 2017). Moreover, cryptography is designed as a science that uses mathematics to encrypt and decrypt messages to enhance the security of the messages. Furthermore, it follows from (Schneier, 1996) that cryptography can be seen as the art and science of keeping messages secure. One of the cryptosystems of cryptography is the Hill cipher. Lester S. Hill invented the Hill cipher in 1929. Hill cipher is a well-known symmetric cryptosystem that multiplies the plaintext A R T I C L E I N F O ABST RACT


Introduction
Information is a very significant asset for an organization because it becomes an essential resource in increasing business value. This causes information security to be essential for every organization. Information security refers to all aspects that are used to protect various types of threats or affect the organization's sustainability. It follows from (Indrajit, 2011) that information technology is like a double-edged sword because, on the other hand, it benefits from applications such as e-government, e-commerce, e-society, and e-education. On the other hand, information technology also has weaknesses such as commercial crimes, character assassinations, fraud, covert wiretapping. Today, human life is integrated with a network that is transmitted through the internet network every moment. In sharing this information, security is needed to ensure the safety of information from various attacks that can spread information that should be confidential (Kalaichelvi et al., 2017). Moreover, cryptography is designed as a science that uses mathematics to encrypt and decrypt messages to enhance the security of the messages. Furthermore, it follows from (Schneier, 1996) that cryptography can be seen as the art and science of keeping messages secure. One of the cryptosystems of cryptography is the Hill cipher. Lester S. Hill invented the Hill cipher in 1929. Hill cipher is a well-known symmetric cryptosystem that multiplies the plaintext 10.12928/bamme.v1i2.4252 vector by the key matrix to get the ciphertext. Hill ciphers are resistant to brute-force and statistical attacks. However, it can be hacked by plaintext-ciphertext attacks known as known plaintextciphertext attacks (KCPA).
A Hill cipher modification based on Pseudo-Random Eigenvalues (HCM-PRE) has been proposed in a previous study, which is still resistant to brute-force and statistical attacks and is also resistant to KPCA because it produces a dynamic encryption key matrix (Mahmoud & Chefranov, 2014). Furthermore, research conducted by Kalaichelvi (Kalaichelvi et al., 2017) also proposed a new variation of the Hill cipher encryption algorithm to provide data security by using Radix 64 to overcome the weakness when encrypting identical plaintext blocks to identical ciphertext blocks. Meanwhile, (Hraoui et al., 2019) proposed an improvement to the Hill cipher algorithm in the case of Affine transformation. In this study, the authors propose a cryptographic algorithm that combines the Hill cipher method with the Rubik's cube. Rubik's cube is used because it is a threedimensional mechanical puzzle game with 43 quintillion different configurations (Raymond, 2005). The Rubik's cube was invented in 1974 by a Hungarian sculptor and professor of architecture named Erno Rubik. In 2016, Abitha and Pradeep proposed communication security based on the Rubik's cube algorithm. One of the steps used is using the Rubik's Cube principle in encrypting an image (Abitha & Bharathan, 2016). In this study, the authors use Python software in the simulation and implementation process. Hence, this study aims to figure out how to combine the encryption and decryption processes from the Hill cipher method and the Rubik's cube.

Hill Cipher
Hill cipher is a polyalphabetic cryptosystem. This means that each character of the alphabet can be mapped to more than one-type of character. Now let be a positive integer and suppose = = (Ζ 26 ) . The idea the Hill Cipher is derived from linear combination formed by alphabet character in one-element of plaintext (Stinson, 2018). Let = 2. Then it can be written a plaintext, namely = ( 1 , 2 ) and a ciphertext = ( 1 , 2 ), where 1 , 2 are linear combinations of 1 and 2 . Suppose we have the following linear combinations 1 = 11 1 + 3 2 (1) We therefore have the following matrix representation of the equation (1) and (2) ( 1 , 2 ) = ( 1 , 2 ) [ 11 8 3 7 ] In general, by using a × matrix, namely , as a key. Now suppose that the element of −row and −coloumn of the matrx be , , then the matix can be written as = ( , ). Let = ( 1 , ⋯ , ) ∈ and ∈ , the ciphertext = ( ) = ( 1 , ⋯ , ) is described as follow: ( 1 , 2 , ⋯ , ) = ( 1 , 2 , ⋯ , ) In other words, = . Hence, it can be concluded that in Hill cipher process the ciphertexts derived from plaintext can be formed by using linear transformation. Thus, this condition motivates us to calculate how the decryption process works. By using the inverse matrix −1 of , the ciphertext can be formed into plaintext by decryption process with the formula = −1 (Stinson, 2018).

Rubik's Cube
Rubik's Cube is a three-dimensional mechanical puzzle game invented in 1974 by a Hungarian sculptor and professor of architecture named Erno Rubik. The standard 3 × 3 × 3 Rubik's cube is one of the combinatorial problems that is well known for its complexity. There are 43,2 × 10 18 different configurations that may be generated in the randomization process (Raymond, 2005). The illustration of the 3 × 3 × 3 Rubik's cube can be seen in the Figure 1. Notation on the Rubik's cube is essential stuff since it helps to demonstrate the algorithm to be more clear. There are various method to show the side of the Rubik's cube. The British mathematician, David Singmaster, invented some adapted notation to show the order of the Rubik's cube movement. The capital will denote the Rubik's cube side. The notation are described as F (depan/ front), U (atas/ up), D (bawah/ down), L (kiri/ left), R (kanan/ right) (Khuyen, 2016). Furthermore, the Rubik's cube movements are illustrated in the Table 1.

Phyton
Python is a multipurpose interpretive programming language with a design philosophy that focuses on code readability. Python is considered as a language that combines capabilities with a very clear code structure, and it is equipped with an extensive and comprehensive standard library functionality. Python primarily supports multiple programming paradigms but is not restricted in object-oriented programming, imperative programming, and functional programming. One of the features available in Python is as a dynamic programming language that is equipped with automatic memory management. As with other dynamic programming languages, Python is generally used as a scripting language, although in practice, this language is used more broadly to include contexts of use that are usually not done by using scripting languages. Python can be used for various software development purposes, and it can be run on various operating systems. Python is distributed under several different licenses from several versions. But in principle, Python can be obtained and used freely, even for commercial purposes. The Python license does not contradict either the definition of the open-source or the General Public License (GPL) (Sinaga, 2017

Method
This research is qualitative research with the literature review resources to gain some mathematical aspects and concepts. We start the research by reviewing some resources related to basic cryptography, Hill cipher, 3 × 3 × 3 Rubik's cube, and its properties. Furthermore, the fundamental concept gained from the previous resources is managed to be a tool to solve the formulated problem, that is, the combined Hill cipher and 3 × 3 × 3 Rubik's cube. Moreover, we use this result to implement the combined Hill cipher and 3 × 3 × 3 Rubik's cube by using Phyton, an open-source software license. It follows from (Danandjaja, 2014) that Library searches are not only the first step in preparing a research design but also at the same time utilizing library resources to obtain research data.

Encryption Process
In this research, we will use the following steps to encrypt the plaintext in the Hill cipher process.
a. Considering the plaintext, b. Separating the plaintext into blocks, c. Determining the key, which is relatively prime to 54, d. Converting the characters of the plaintext using the part of ASCII symbol described in Table  2, which was started previously by adding %, e. Encryption using Hill cipher method, f. Converting the numbers into alphabet or character, g. Gaining the ciphertext.
Before the encryption process, the plaintext should be converted into a character from Table  2. The key used in this method is an invertible matrix so that the ciphertext can be returned into its plaintext. Since the space used in this research is 54 = {0,1,2, … , 53}, the matrix used in this process should be an invertible matrix modulo 54. 10.12928/bamme.v1i2.4252

Encryption using Hill cipher
In this part, we will simulate the encryption result by using a plaintext: UNIVERSITAS AHMAD DAHLAN. We consider the key as JH67 since it is invertible modulo 54. It follows from the character representation illustrated in Table 2. We, therefore, have Table 3. ]. Since the key used in this process is a 2 × 2 matrix, the converted text will be separated into some part, namely, blocks which consist of 2 alphabets, so we have Table 4. It follows from the encryption processes starting from the block I to block XI, we have the following ciphertext PO*I*MSQ&P7-D&X?(<3J*Q

Encryption using 3 × 3 × 3 Rubik's Cube
The process of encoding or encryption on the Rubik's cube is carried out in the following stages: a. Determine the position or location of the plaintext to be encrypted in the Rubik's cube blocks. The existing plaintext characters are then placed on the Rubik's cube blocks in the order shown in the Figure 2.  Figure 3. c. Specifiy the desired key. The key used is obtained from the notation of the movement of the Rubik's cube can be 10 steps or more, so that the resulting password is more complicated. d. Randomize the Rubik's Cube with a predetermined key. e. Write down the ciphertext that has been generated.

Figure 3. Example of laying plaintext on rubik
The ciphertext derived from the Hill cipher process will be considered as a plaintext for the encryption by Rubik's cube. Hence, we have the following message as the plaintext and the chosen key.
Plaintext: PO*I*MSQ&P7-D&X?(<3J*Q Key: R U' L U R' B D L' R' F' The initial process of the Rubik's cube can be seen in Figure 4.

Figure 4. Initialize the encryption process on rubik
We use several steps to gain the final ciphertext as follows a.
Step 1 At the initialization step, the Rubik's cube is rotated on the right by 90 0 clockwise (R). Hence, the position of the white Rubik's block fills the blue position, blue block fills the yellow block position, yellow fills block the green block position and green block fills the white block position so that the resulting rubik is as described in Figure 5. Step 2 The results in the first step, the resulting Rubik is rotated at the top by 90 0 counterclockwise (U'). Hence, we therefore the rubik as described in Figure 6. Step 3 The Rubik generated in the second step is rotated on the left by 90 0 clockwise (L). We have the Rubik's cube as described in Figure 7. d.
Step 4 The Rubik generated in the third step is rotated at the top by 90 0 clockwise (U). We have the Rubik's cube as described in Figure 8. e.
Step 5 The Rubik generated in the fourth step is rotated to the right by 90 0 counterclockwise (R'). We have the Rubik's cube as described in Figure 9. The Rubik produced in the fifth step is rotated on the back by 90 0 clockwise (B) as illustrated in Figure 10. Step 7 The Rubik generated in the sixth step is rotated on the bottom by 90 0 clockwise (D) as illustrated in Figure 11. Step 8 The Rubik produced in the seventh step is rotated on the left by 90 0 counterclockwise (L') as illustrated in Figure 12. i.
Step 9 The Rubik's cube in the eighth step is rotated on the right by 90 0 counterclockwise (R') as illustrated in Figure 13. j.

Decryption Process Decryption using Rubik's Cube
The process of the decryption of the ciphertext using Rubik's cube is carried out in the following steps: a. Form a rubik based on the determined key, b. Put the ciphertext sequentially based on the determined order, c. Determine the inverse of the key (the key is in the matix form), d. Decryption process using the inverse of the key e. Gain the plaintext (encrypted by the Hill chipher) Take the process analogously as illustrated in the encryption process so we have the following Rubik's cube as described in Figure 15. It follows from the decryption process that we will have the following plaintext PO*I*MSQ\&P7-D\&X?(<3J*Q\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\% \%\%\%\%\%\%\%

Decryption process using the Hill cipher
The process of decryption is will be done analogously like the encryption process. However, the key used is the inverse of the key in the encryption process. Therefore, before we are going to 10

Encryption and Decryption Process Using Phyton Encryption
The encryption process in Python is divided into 2 stages, namely encryption with Hill cipher and Rubik's cube. The encoding process with the Hill cipher method in Python is as shown in Figure  16. In Figure 16, the initial plaintext "UNIVERSITAS AHMAD DAHLAN" will be encrypted. The encryption process begins by entering the sentence to be encrypted in the "Message" column, then entering a key that is relatively prime to 54 in the "Input 4 letter cipher" column, then we have the encrypted text or ciphertext: PO*I*MSQ&P7-D&X?(< 3J*Q. After the encryption process is fugured out using the Hill cipher method, then it will be encrypted with a Rubik's cube. In the process, adjustments are made to the rotation key used, as illustrated in Table 5.
The key to be used is "R U' L U R' B D L' R' F'", then based on table 3, the key to be used in Python is "C1 R4 C6 R6 C3 L1 R1 C4 C3 L4". Hence, we will have the following appearance shown in Figure 17. Moreover, the encryption result is converted using ASCII character standard. We therefore have the following as illustrated in Figure 18.

Conclusion
Based on the results and discussion in this paper, it can be concluded that the encryption process by combining the Hill cipher method and the Rubik's cube algorithm produces a more random and complicated ciphertext than if we implement only the one of them. The color arrangement of the Rubik's cube in the encryption results is also one of the keys so that if we want to decrypt the ciphertext with the general formula of the Rubik's cube without using the inverse key in the encryption process, we must previously know the position or color arrangement in order to put the ciphertext to be decrypted. As for using Python, it makes it easier and minimizes the processing steps or errors that can be obtained when using a manual process.