A combination of hill cipher and RC4 methods for text security

ABSTRACT


INTRODUCTION
Security issues are an important aspect in sending data and information over the network [1].This is due to computer networks with an open system concept that can make it easier for someone to enter the network, which can result in the process of sending data being insecure and can be used by people or other parties who are not responsible for taking information in the middle of the road.One way to maintain the security of confidential data or information is to use cryptography [2].Cryptography is an encryption technique in which "original text" (plaintext) can be scrambled using an encryption key to become "random text that is hard to read" (ciphertext) [3]- [5].Cryptography has many methods, namely hill cipher and Rivest Cipher 4 (RC4) [6]- [8].Hill cipher is a symmetric key cryptographic algorithm that has several advantages in data encryption [9].To avoid invertible key matrices, key matrices are generated using newton's binomial coefficients [10], [11].The encryption and description process uses the same key, plaintext can use image or text media.RC4 is a stream cipher type so that it can process units or input data, messages or information.The unit or data is generally a byte or sometimes even a bit (a byte in the case of RC4) so that in this way the encryption or decryption can be carried out at variable lengths.
Cryptography is the science of encryption techniques where data is scrambled using an encryption key to be something that is difficult to read someone who doesn't have the decryption key.Decryption using the decryption key gets back the original data.The encryption process is carried out using an algorithm with several parameters.Encryption that relies on the secrecy of the algorithm is considered something that is not good.The secret lies in the several parameters used.It is the parameter that determines the decryption key that must be kept secret.Cryptography is a security method for protecting information by using passwords that can only be understood by people who have the right to access the information.Cryptography is the only method used to protect information through communication networks that use landlines, communication satellites, and microwave facilities.Cryptography is a science that studies mathematical techniques related to aspects of information security such as confidentiality, data integrity, and authentication of data senders/recipients.Cryptography is an art or science to maintain the confidentiality of a text so that it remains safe without being noticed by unauthorized parties.But now cryptography is not just art or secrecy but also integrity, authentication, and data validity.

CRYPTOGRAPHIC WORK SYSTEM
In general, cryptography is the practice and study of techniques for securing communication and data from third parties.Cryptographic systems are employed in various areas such as securing communication over the internet, protecting sensitive information, ensuring the integrity of data, and more.The keys that can be used for encryption and decryption need not be identical, depending on the system used [12], [13].Mathematically the process of encryption and decryption can be written: EK (M): C (encryption process) DK (C): M (decryption process) Where E: (encryption process) K: key M: original message C: encrypted text D: decryption process During the encryption process, the message (M) will be coupled using the encryption key (K) to a password that cannot be understood (C) [14], [15].While in the decryption process, the password that is not understood (C) will be deciphered using the decryption keyword (K) so that it can produce the same message (M) as the previous message.The fundamental functions in cryptography are encryption and decryption [16], [17].a. Encryption Encryption is the process of changing an original message (plaintext) into a message in coded language (ciphertext) [18], [19].Encryption is part of cryptography and is very important so that the security of the data sent can be kept confidential [20].Encryption can be interpreted as a cipher or code, where the original message (plaintext) is converted into separate codes according to the method agreed upon by the message and the recipient of the message. = () where =message in coded language (ciphertext), =encryption process, and =original message (plaintext).Figure 1 describes both the encryption process and the decryption process.Decryption is the process of changing messages in a coded language (ciphertext) into original messages (plaintext) [21], [22].Decryption is the reverse process of encryption which returns the passwords or information that has been traced to the original file form by using a key or code. =  () where =original message (plaintext), =decryption process, and  message in coded language (ciphertext).In addition to using certain functions for encryption and decryption, these functions are often given additional parameters called keys.Cryptographic algorithms can also be called ciphers, namely the rules for encrypting and decoding, or the functions used for encryption and decryption.The security of cryptographic algorithms is often measured by the amount of work required to break ciphertext into plaintext without knowing the key used.If the more processes needed mean the longer it takes, the stronger the algorithm is and the more secure it is used to encode messages.In cryptography there are various cryptographic algorithms based on the key, namely symmetric algorithms, asymmetric algorithms, hill cipher algorithms, and RC4 algorithms.c.Symmetric algorithm This algorithm is also often called the classical algorithm because it uses the same key for encryption and decryption [23].To send messages using this algorithm, the recipient must be informed of the key to the message so that it can decrypt the message to be sent.In Figure 2, it explains the security of messages using this algorithm depending on the key, if the key is known by someone else then that person can encrypt and decrypt the message.Asymmetric cryptography algorithms are algorithms that use different keys for the encryption and decryption processes [24].Figure 3 explains the asymmetric cryptography algorithm, also known as the public key algorithm, because the key for encryption is public (public key) or can be known by everyone, but the key for decryption can only be known by authorized people who know it with the encoded data.Or often called private key.Hill cipher is an application of modulo arithmetic to cryptograph [25].This technique uses a square matrix as a key that can be used to perform encryption and decryption.Hill cipher cryptography does not replace every other letter that is the same in the ciphertext because it uses matrix multiplication based on encryption and description.Hill cipher is a polyalphabetic cipher which can be categorized as a block cipher because the selected text will be processed and divided into blocks of a certain size.Each character has a block that can influence other characters in the encryption and decryption process, so that the same character is not differentiated into the same character.The hill cipher was created by Lester S. Hill in 1929.The hill cipher does not replace every letter that is the same in plaintext with another alphabet in the ciphertext, because hill cipher uses matrix multiplication in its encryption and description.Hill cipher is a vulnerable symmetric encryption algorithm against known-plaintext attacks.If cryptanalysis can collect plaintext and ciphertext with the same key, then cryptanalysis can find out the key from hill.f.

RC4 stream algorithm
The RC4 algorithm is a symmetric key in the form of a stream cipher that can process input data or messages or information [26].Input data is generally a byte or even bits.In this algorithm you don't have to wait for a certain amount of input data or information to add bytes to encrypt.The RC4 algorithm has two S-boxes, namely, an array of length 256 which contains permutations from 0 to 255, and the second S-box is a function of keys with variable lengths.The way the RC4 algorithm works is to initialize the first S-box array, S[0], S[1] ,...., S[255], with numbers 0 to 255.Fill in the first thing sequentially S[0]=0, S[1]=1 ,..., S[255]=255.Whereas the second S-box is for example an array K with a length of 256.An array of K with keys that can be repeated until the entire array is K[0], K[1] ,..., K[255] is completely filled.In general, in the encryption-decryption process, there are two types of ciphers based on how the encoding works, namely a stream cipher is a system where the encryption and decryption process are done bit by bit.In this system the key bit stream is generated by a random bit generator.This key stream is subjected to an XOR operation with a stream of plaintext bits to produce a stream of ciphertext bits.

RESULTS AND DISCUSSION
In a system required an analysis of the system to be designed.This study uses observation of data security by using a database and using the hill cipher and RC4 cryptographic systems.Hill cipher is a software that is used to secure data.The way the hill cipher works is quite simple and easy to understand so that it determines the security level of a cipher so that it cannot be dismantled.Meanwhile, RC4 is a byte-oriented stream cipher system, then it performs XOR operations with a byte key by generating cipher bytes.a. Hill cipher cryptography 1) Encryption process on hill cipher Hill cipher is a symmetric key algorithm that falls under the category of polygraphic substitution ciphers.It operates on blocks of plaintext, typically groups of two or three letters.The key for the hill cipher is a matrix.Cryptographic analysis using the 3×3 hill cipher encryption method is as: Plaintext: "HARIMAUSUMATERA" Key: "O R A N G U T A N" If there is Plaintext "HARIMAUSUMATERA" and the key "ORANGUTAN" then it must be converted first to: Plaintext: "7 0 17 8  Applying the encryption process to the original text (plain text) "HARIMAUSUMATRA" using the hill cipher method, obtains an encrypted text (ciphertext) which reads "UPQEUWOOQMQHHYY".The hill cipher method uses linear algebra principles to convert blocks of text into blocks of encrypted text, producing a ciphertext that does not show any obvious or easily recognizable patterns from the original text.

2) Decryption process on hill cipher
To carry out cryptographic analysis and decrypt messages that have been encrypted using the hill cipher method, the first step is to change the encryption key in the form of the word "ORANGUTAN" into a series of numbers according to the position of the letters in it, where A=0, B=1, …, Z = 25.The key "ORANGUTAN" is converted into a set of numbers K= (14,17,0,13,6,20,19, 0, 13), based on the alphabet.In proving the inverse of matrix K with inverse K-1, the proof step is carried out by performing a multiplication operation between matrix K and its inverse, namely K-1.The goal of this step is to ensure that the multiplication produces an identity matrix.The success of producing the identity matrix after the multiplication operation is proof of the validity that K-1 is the appropriate inverse for the K matrix, thus reaffirming the truth of the inverse relationship between the two, the proof is as: In the context of information security, the process of decrypting an encrypted note or data requires the initial step, namely changing the ciphertext that has been generated during the encryption process.The process of decrypting the record must first change the ciphertext C = "UPQEUWOOQMQHHYY" to letters in numerical sequence C = "20 15   RC4 is a type of symmetric stream cipher encryption that has been widely used in various applications to secure data transmission.To understand how RC4 works, use a case example by taking the text "TIGER" as the data you want to encrypt, and using "LEUSER" as the encryption key.RC4 encrypts this data into a ciphertext that cannot be read without the appropriate key.
In Table 1 there are the results of cryptographic analysis carried out using the RC4 algorithm.This algorithm has been implemented to secure data by generating random keys that are used in the encryption process.The analysis includes an evaluation of the performance of the algorithm, the strength of the encryption provided, and the possible vulnerability to cryptanalysis attacks.2) Initialize the 7-byte Ki array key, for example the key consists of 7 bytes namely "LEUSER" then the sentence to be converted into decimal form "76 69 85 83 69 82".Repeat the key until it fills the entire K array so that the K array becomes something different, as shown in Table 2.
3) Next mixes the operation which will apply variables i and j to the index array Iterations are carried out to perfect each step in the process, while S-box exchange (swap) becomes a key strategy in increasing resistance to possible attacks.After carrying out iterations from 0 to 255 iterations and S-box exchanges, the results obtained after carrying out all iterations from 0 to 255 iterations and S-box exchanges (swaps) are shown in Table 3. RC4 encryption is an encryption process that is XORing bytes with the plaintext "HARIMAU".Plaintext consists of 7 characters, so 7 iterations occur.The previous iteration must be converted into binary form as shown in In the initial step of the algorithm, the initial values of variables  and  are initialized as 0. This initialization is a critical step that prepares the algorithm's iterative process for key setting and data randomization.Initialize  and  with  = 0;  = 0.By performing seven iterations using the "TIGER" key, the results were recorded and presented in Table 5.This table provides a detailed description of the key changes after each iteration, showing sequential data transformations.After successfully finding the key for each character, the next step is the XOR operation between the character in the plaintext and the key that has been generated.This process is an integral part of the encryption algorithm, where XOR is used to combine information from both sources and produce a ciphertext that cannot be easily reconstructed without knowing the correct key.The resulting key is as shown in Table 6.
The decryption process is XORing pseudorandom bytes with the ciphertext being % Ϛ? -ȳ ȁ -.Ciphertext consists of 7 iterations which will be converted into characters in the form of binary numbers as in the data contained in Table 7.

CONCLUSION
Hill cipher is a cryptographic substitution encryption method that works with matrices.This method converts bright text letter blocks into cipher letter blocks using the key matrix.This method is capable of encrypting messages in block form, so it can overcome some of the vulnerabilities in the simple substitution method.This method is more powerful than the simple substitution method because the correlations between letters are not clearly visible in encrypted text.RC4 is a cryptographic flow algorithm that uses a key to generate a stream of random bytes, which are used to encrypt messages.RC4 is an algorithm that is fast enough to perform encryption and decryption.and this algorithm is relatively easy to understand and implement.Both hill cipher and RC4 have their own strengths and weaknesses.However, at this time, RC4 is generally considered less secure for use in security-critical scenarios because of its vulnerability to attacks.In practice, for higher data security, it is recommended to use modern and stronger encryption algorithms such as advanced encryption standard (AES) which has been tested and proven to be more robust against modern attacks.

Figure 1 .
Figure 1.Encryption process and description

Figure 1 .
Figure 1.Encryption Process and Description

Table 2 .
[]  [].The first step is initialized for  and  with 0. The mixing operation is repeating the formula ( + [] + []) mod 256 followed by swapping [] for [].Because it uses an array with a length of 256 bytes the algorithm becomes: Array initialization A combination of hill cipher and RC4 methods for text security (Azanuddin)

Table 4 .
Character results to binary numbers

Table 5 .
Key formation results