Upload File Security on the Server Using LSB and Hill Cipher

– The rapid development of technology not only has a positive impact, but also can have a negative impact such as the development of cyber crime that can cause messages to be unsafe. Message security can be protected using cryptography to convert messages into secret passwords. Steganography is a technique of hiding messages by inserting messages into images that are used to increase message security. In this study, it discusses a combination of hill cipher and LSB algorithms to secure messages. The message used is a 3-bit grayscale image for steganography and text messages with 32, 64 and 128 characters for cryptography. The measuring instruments used in this study are MSE, PSNR, Entropy and travel time (CPU time). Test results prove an increase in security without too damaging the image. This is evidenced by the results of the MSE trial which has a value far below the value 1, the PSNR is> 65 dB with a range of entropy values of 5 to 7, and travel times are almost the same.


INTRODUCTION
Server, as one of the storage and data exchange places is very vulnerable to data manipulation.Most servers only use the security model by using access rights, login functions or using multiple passwords.This is considered insecure because there are various confidential data that need to be secured.Safeguarding data by applying cryptographic techniques is one option.It is known that cryptography can be used in both text and file media.On the other hand, large data sizes and various perliu file formats are considered in the selection of cryptographic algorithms.
According to Sangeeta in his research explained about simteric cryptographic techniques that are faster than asymmetric cryptography [1].This is because simteris cryptography uses permutation and substitution calculations or a combination of the two.Some forms of symmetrical cryptographic algorithms are AES [2], DES.But the algorithm takes a long time with a long form of calculation.On the other hand, there are algorithms that are fast and safe because they only use substitution calculations, namely bit shifting [3].Bit shifting is done by shifting to a certain shift.This process is also very fast, so it does not add to the workload on the server.
In this study the cryptographic algorithm used is Hill Cipher.According to [1], Hill Cipher is one of the symmetrical key algorithms that has several advantages in data encryption.Steganography is the science used to hide secret messages into a media without changing its shape.The secret message will be inserted in a digital image, so that no one knows that in the image there is a secret message.The steganography method used in this study is the Least Significant Beast (LSB) method.This Least Significant Beast (LSB) method is a method used in hiding secret messages by replacing the lowest bits of data on several pixel images with sequential data bits [4].
In this study, the author will use a merger of two algorithms, namely the Hill Cipher algorithm and the Least Significant Beast (LSB) method which is expected to improve data security or encoded messages.The message used in this study is character and image.The image used is 256 × 256, and 512 × 512 pixels, while the characters used are 32, 64, and 128 characters.

Kirptografi
Cryptography is a science that discusses the encryption process where data will be encrypted by using an encryption key to be something that is difficult to recognize by someone who does not have a decryption key [2].Encryption is the process of encoding messages from plaintext into ciphertext.While decryption is the process of returning messages from ciphertext to plaintext.This encryption and decryption can be used on messages that have been sent or for messages that have been stored.

Hill Cipher
Hill Cipher was created by Lester S. Hill in 1929 [1].This method was created to produce ciphers (codes) that cannot be found by analyzing frequencies.Hill Cipher includes polyalphabetic cryptography which is classified as a block cipher, because the text messages to be processed are divided into several blocks of a certain size [3].Each character in one block will affect the results of other characters in the process of encryption and decryption.Therefore, the same character in the initial block is not mapped to be the same character also in the final block.
The Hill Cipher algorithm is an algorithm that is difficult to solve because this algorithm uses matrix multiplication for encryption and decryption [4], besides when using a larger key matrix, the frequency for the hiding technique will also be higher.The following will be elaborated on the key matrix on Hill Cipher, as in (1).
The encryption process in the Hill Cipher algorithm is carried out every plaintext block [1].The plaintext is then converted to a decimal number before the text is divided into rows of blocks, such as A = 0, B = 1, C = 2, etc. as described below: The Hill Cipher encryption process can be calculated using the following formula: Where: C = Ciphertext (Result of encryption with Hill Cipher) K = Key value in the form of matrix m x m P = Plaintext is a decimal number To return to the initial value, the decryption process is performed.This decryption process requires a key, the key used is the inverse of the key matrix.So that the key matrix is obtained using the following formula: While the decryption process on the Hill Cipher algorithm is obtained by using the following formula, as in (4).
where D is Plaintext before the encryption process is performed.

Steganography
Steganography is a method for hiding secret messages in digital media, so that third parties will not know that a message has been inserted in the media.Steganography requires two properties, namely placeholders and secret messages that will be hidden [5].The steganography method uses digital media as placeholders, such as sound, text, video and images.
In general, there are 2 processes in the steganography method, namely the embedding process which is used to hide messages into the cover-object and extraction processes for message extraction from stego-objects [6] which will later require a secret key so that only authorized users can hide and message extraction [7].

Least Significant Bit (LSB)
Least Significant Bit (LSB) is a steganography method on the spatial domain that conceals messages by changing bits in the image segment with secret message bits including the easiest and simplest steganography method to implement [8].This method uses digital imagery as covertext.Digital images used are 1 bit (binary), 3 bits (grayscale), and 24 bits (color).LSB must have an imperceptibility value, the image can reach the limits of the Human Visual System (HVS) which is above 40 dBhis study, the image used for the LSB method is a grayscale image with a size of 3 bits.A grayscale image is an image whose pixel intensity value is based on the degree of gray.Many colors depend on the number of bits provided in memory to accommodate the needs of each color.The greater the number of color bits provided in the memory, the smoother the color gradation that will be formed [9].In addition, grayscale is also called monochromatic, because it has no other color than the variation in intensity of black and white.An image that is made grayscale will look different when compared to a colored image.To hide an image in LSB every byte of 3 bits, it can store 1 byte in each pixel.
Changes from the inserted image cannot be seen significantly with visible eyes [10].However, this change can be proven by means of testing using measuring instruments such as Peak Signal Noisy to Ratio (PSNR) and Entropy from the resulting image.

RESULTS AND DISCUSSION
In this study measurements were made on stego images using PSNR and MSE.PSNR is a comparison between the maximum value of a signal as measured by the amount of noise that affects the signal.In general, PSNR is measured using decibel (dB) units.
In general, the greater the PSNR value, the higher the level of similarity between the inserted image and the original image.Inserted images have good quality images with PSNR levels above 40 dB.PSNR is also used to measure the comparison of the quality of the original image before and after the message is inserted.In determining PSNR, the value of Mean Square Error (MSE) must be determined beforehand.MSE is an error value from the result of the average square between the original image and the stego-image.MSE testing is said to be good if it has a low value.To calculate the MSE value use the following equation: Tests are performed on the encryption and insertion of messages.To be able to understand the two processes of Hill Cipher-LSB, we can see the two processes given in Figure 1 and Figure 2. The process of encryption and insertion of messages can be described in Figure 1, while the extraction process and decryption process can be described in Figure 2.This study using two types of digital image sizes, namely with a size of 256 × 256 pixels and 512 × 512 pixels with tiff format.The digital image is a grayscale image that has been widely used in various studies.This study aims to facilitate the comparison process for further research.The following is a sample of grayscale images that can be seen in Figure 3 and Figure 4.By using the Hill Cipher algorithm, the data used for messages is an alphabetical character with range A -Z, where the character will be encrypted.Message encryption aims to hide a message into an image so that the message is difficult to recognize, so that it can improve security in a message.In this study using 32, 64, and 128 characters length.Message samples and encryption results can be seen in Figure 5. From Figure 1, it can be seen if messages that have the same character length do not necessarily have the same encryption results.This is because encryption is affected by key values and key matrices in the message.From the three images, it can be seen that the results of encryption can also change the character value of the original message which will be used in the insertion process with the LSB algorithm.Changes from the encryption message value will also affect the LSB algorithm insertion process.
To determine the quality of the stego-image, a standard measuring instrument is needed, namely using PSNR, MSE, Entropy, and travel time (CPU time).The results of the inserted encryption do not appear to change significantly.This can be seen in table A and table B for digital dreams measuring 256 × 256 pixels and 512 × 512 pixels below.  1 and Table 2, it is evident that the results of steganography using 32, 64 and 128 characters did not change significantly.Therefore, the comparison between steganographic image results cannot be seen in plain view.In addition, in the two tables above it is evident that the insertion image with the number of characters results in a value of MSE that is far below the number 1.This indicates that the insertion image is not significantly damaged.In the table above, it can be seen that pixel size and the number of characters inserted will affect the value of MSE.The smaller the pixel size of the image and the more the number of characters the message is inserted, the greater the value of MSE.The image that has the highest MSE value is plane.tiff,moon.tiff,chemical.tiff,and arial.tiffwith a size of 256 x 256 pixels and 128 characters insertion that has a value of 0.009094.While the image that has the lowest MSE value is aerial.tiff,boat.tiff, and bridge.tiffwith a size of 512 x 512 pixels and a 32 character insertion that has a value of 0.000576.
The PSNR test results in the table above show that the image quality is very good because the PSNR value in each image is up to 65 dB.The PSNR value is also influenced by the maximum pixel value and MSE value.The smaller the maximum pixel value and the greater the MSE value, the smaller the PSNR value will be.The image that has the highest PSNR value is aerial.tiff,boat.tiff and bridge.tiffwith a size of 512 x 512 pixels and a 32 character insertion that has a value of 80.526433 dB.While the image that has the lowest PSNR value is plane.tiffwith a size of 256 x 256 pixels and insertion 128 character that has a value of 67.722096 dB.
(a) in image size 512x512 pixels   In Figure 6, the entropy test shows that the highest entropy value lies in the lena.tiffimage with a size of 512 x 512 pixels which has an entropy value of 7.347888.While the image that has the lowest entropy is bridge.tiffwith a size of 512 x 512 pixels which has an entropy value of 5.715885.In testing the travel time to insert the message character as given in Figure 7, it can be seen that the fastest travel time is in the chemical.tiffimage that is equal to 0.014036 s with 128 characters insertion and measuring 256 × 256 pixels, while the travel time is late in the lena.tiffimage which is 0.198767 s with 128 characters insert and measures 512 × 512 pixels.Therefore, it can be seen that travel time is influenced by the size of the image and memory capacity on the computer.

CONCLUSION
Based on the results of testing in message hiding on digital images by combining the Hill Cipher and Least Significant Bit (LSB) algorithms, it can be concluded that the process of hiding messages using the Hill Cipher algorithm in digital images can improve security and cannot be seen in plain view, because the results of steganography did not change after the insertion of text messages using the LSB method, so there was no significant change when It is evident that the PSNR value of each image is> 65 dB which is shown in Table 1 and Table 2.In addition, the PSNR value is also quite stable because all PSNR values produce values with very small differences or no more than 1 dB.The highest PSNR value is owned by aerial.tiff,boat.tiff, and bridge.tiffimagery at 80.526433 dB.The entropy value in the stego image is up to 5. The highest entropy value is owned by the lena.tiffimage of 7.347888.While the travel time (CPU Time) generated in running these two algorithms is less than 1s.So that both of these algorithms can be used to increase the security of the message.In addition, both of these algorithms are proven to have the advantage of good image results using algorithms that are simple and fast in processing and have a high similarity to the original image.
and N = Dimensions of the image i and j = coordinates of a point in the image I (i, j) = insertion image (stego-image) K (, j) = Original image (cover image) MAX = The biggest pixel value in the entire image

Figure 6 .
Figure 6.A comparison between entropy value in size 512 and 256 pixels.
(a) in image size 512x512 pixels (b) in image size 256x256 pixels Figure 7.A comparison between CPU Time value in size 512 and 256 pixels.
Size 256x256 pixelsthe image before and after steganography.The combination of these two algorithms has been successfully applied to the gray 3-bit (Grayscale) image.The results of the merger between the Hill Cipher and LSB algorithms produce a very good image.The gray image used has a size of 256 × 256 pixels and 512 × 512 pixels.While the text messages used for the insertion process are 32, 64, and 128 characters.Based on the results of the comparison on the image it can be seen that the LSB method has advantages in the quality of stego images.

Table 1 .
Result Comparison between original image and stego image in size 512x512 pixels

Table 2 .
Result Comparison between original image and stego image in size 256x256 pixelsBased on Table