Image Steganography Analysis Using GOST Algorithm and PRNG Based on LSB

Security in communication is very important for everyone to pay attention to. To prevent data leakage and illegal retrieval of data, cryptography and steganography can be used. In this study, GOST and XOR LSB with PRNG were used to inject text into images. The final result shows that the combination of these two methods is quite good in terms of image quality, message capacity, embedding speed, and imperceptibility (which cannot be seen with the naked eye). Of the 9 image formats tested, 7 images containing messages could be extracted properly with a median MSE of 0.0001935 and a median PSNR of 85.261. Then, in terms of rotation, all im-age rotations from 90°, 180°, and 270° fail to extract messages and in terms of resizing all sizes from 10%, 30%, 50%, and 80% also fail to extract messages. The average time required for encryption with test data 6 test data is 0.073 seconds with the GOST algorithm, using GOST + XOR LSB with PNRG is 0.485 seconds. By using the XOR combination method LSB with PRNG can store an average of 43.3 bits. From the imperceptibility test using 25 respondents and visualization using an RGB histogram, it can be seen that there is no difference between the cover image and the stego image.


INTRODUCTION
The development of information technology has an impact on convenience for everyone, especially in terms of communicating [1]. Security in communication is very important for everyone to pay attention to. Even so, we often forget about this when we are using various products and services available on the internet. Vital information on the internet such as business, health, education, and government data has a high risk of being a target for crime and illegal retrieval of information (cybercrime) [2]. The forms of cybercrime that exist on the internet vary, ranging from wiretapping, theft, alteration, and others [3]. The data that has been taken can then be used by irresponsible parties in various ways, such as personification, threats, and/or illegal resale.
From the amount of data and information available today, it can be divided into at least 4 basic forms, namely images, text, audio, and video [4]. Among the four forms of data, text data is one type of data that is often stolen and manipulated so that the authenticity of the data is not maintained [5]. With the internet and today's technology, illegal acts can occur quickly and are becoming more common if not properly monitored. Therefore, to reduce and prevent this from happening, several techniques can be used to secure data or information.
Cryptography and steganography are one of the most widely used data security techniques today [6] [7]. Cryptography is a data security technique through the plaintext encryption process into a ciphertext that is difficult for others to understand [8]. The word cryptography itself comes from the Greek, crypto, and graphia which when combined have the meaning of "secret writing" [9]. Steganography is a technique of hiding data into a file or storage media [10]. The word steganography (steganography) itself comes from the Greek words steganos (hidden) and graphein (writing) which when combined mean hidden writing [11].
The word steganography (steganography) itself comes from the Greek words steganos (hidden) and graphein (writing) which when combined mean hidden writing [12]. GOST is included in the Feistel network block cipher, where data will be split into several small blocks to be processed in each round in the algorithm [13]. LSB is the insertion of a message in a digital image by modifying the last bits (Least Significant Bit) in the color pixels of the image [14]. This method hides information by inserting a message at the rightmost bit of an image pixel (or file) [12]. Various attacks against GOST have been carried out in previous studies, where the best attack requires 2 32 data and 2 36 memory with a time complexity is 2 224 [13] [15]. To overcome the weaknesses of GOST and LSB, further modifications were made to the LSB using the XOR and PRNG logic functions [16].

RESEARCH METHODS
In this study, cryptography in the text is implemented through the GOST algorithm using the Python language with system specifications, namely Mac OS Monterey, M1 pro, SSD NvME 512 GB, and RAM 16 GB. To increase the security of the GOST algorithm, the text is then inserted into the image using the concept of XOR LSB steganography with PRNG. Broadly speaking, the cryptographic and steganographic processes can be described as follows:

GOST Algorithm
The GOST algorithm accepts a 256-bit key and 64-bit text (plaintext/ciphertext) per block [15]. If there is a text that is longer than 64 bits, then the text will be broken into several blocks and added padding if needed. To be able to perform the encryption and decryption process, the GOST algorithm uses 32 rounds where various processes are carried out such as XOR, rotating left shift (11 bits), and substitution of binary values with S-boxes.

Substitution Box (S-Box)
The substitution box or S-box is a table that is used as a reference for the exchange (substitution) of an input value into a new output value. The specification of the S-box table used in the GOST algorithm can be seen in the following table: The demonstration of using the S-box for a binary number input "1111000000010011" is as follows: 1.
For the first order, namely "1111" (15), then look for the intersection of column 15 and row 1 so that "0001" is produced (1) 3.
For the second order, namely "0000" (0), then look for the intersection of column 0 and row 2 so that it produces "0110" (6), and so on for the third and fourth binary sequences...

4.
The final result of the binary input in the form of "1111000000010011" will produce a binary output of "0001011000110001"

Rotate Left Shift (RLS)
Rotate Left Shift or Left Circular Shift is a simple binary rotation method where the leading binary position (MSB) is deleted and reset to the last binary position (LSB). In the GOST algorithm, the RLS process is used only for the first 11 binary bits. Suppose a binary has the value "11111111 11100000 00000000 00000000", then after the 11-bit RLS the output is "00000000 00000000 00000111 11111111".

GOST Encryption
The GOST encryption process is carried out in stages. These stages are: 1. Convert plaintext (64 bit/8 characters) and key (256 bit/32 characters) into binary form 2. Split the key binary into 8 parts with the rule K0 = 32 to 1 bit, K1 = 64 to 33 bit, and so on until K7 = 256 to 225 bit 3. Split the plaintext binary into 2 parts (R0 and L0) with the rules R0 = 32 to 1 bit, and L0 = 64 to 33 bits 2. After that, the process consists of 32 rounds (rounds) with the pseudocode for each round as follows:

GOST Decryption
The GOST decryption process is carried out in stages and has only a slight difference from the previous encryption process. These stages are: 1.
Split the key binary into 8 parts with the rules K0 = 32 to 1 bit, K1 = 64 to 33 bits, and so on until K7 = 256 to 225 bits 4.
After that, the process consists of 32 rounds (rounds) with the pseudocode for each round as follows:

XOR LSB Steganography Method with PRNG
The LSB algorithm is one of the easiest steganographic algorithms to implement [17]. However, in exchange for its simplicity, this algorithm is also very susceptible to modification and the messages it inserts are easy to detect. To overcome the weakness of the usual LSB algorithm, PRNG and logical XOR functions can be used to randomize the number of message bits entered per image pixel (3-6 message bits per pixel) [8]. The XOR LSB algorithm with PRNG is based on the publication by Chandra Kumar Deo, et al (2020) [16].

Message Insertion
Adapun alur dari proses embedding (penyisipan pesan) pada algoritma ini yaitu: 1. Select the stego image to which the message will be retrieved 2. Request the seed or PRNG key that was used in the previous insertion process 3. Use PRNG to generate a random number with a range of 1 to 6. If a number 1 or 4 is generated, then the indicated channel is red; if number 2 or 5 then the channel is green, and if number 3 or 6 then the channel is blue 4. Based on the previously selected indicator channel (red, green, or blue), look at the 3-bit MSB value that is on that channel. This 3-bit MSB will be used as a reference for message retrieval with the following rules:

5.
Perform an XOR operation between the message bits you want to insert at this time and the color channel bits in the previous PRNG result sequence. For example, if the result of PRNG is 6, then perform the message bit operation XOR the blue channel bit of the 6th sequence. For clarity in the next step, call this 6th sequence blue channel bit as an indicator bit 6.
The XOR results from the previous step 6 are then inserted into the LSB of one of the channels with the rules as in step 5. Repeat steps 6 and 7 with different message bits and channel colors. The indicator bit XORed with the message bit is always the same as long as it hasn't changed pixels 7. Perform steps 3-5 repeatedly as long as there are still message bits that must be inserted. Then, save all the bit changes to a stego image

Message Extraction
The flow of message extraction is not much different from message insertion. The flow of message extraction is: 1.
Select the stego image to which the message will be retrieved 2.
Request the seed or PRNG key that was used in the previous insertion process 3.
Use PRNG to generate a random number with a range of 1 to 6. If a number 1 or 4 is generated, then the indicated channel is red; If it's number 2 or 5, then the channel is green, and if it's number 3 or 6, the channel is blue 4.
Based on the previously selected indicator channel (red, green, or blue), look at the 3-bit MSB value that is on that channel. This 3-bit MSB will be used as a reference for message retrieval with the following rules:

5.
Perform an XOR operation between the current LSB color channel (as defined in step 4) and the color channel bit in the previous PRNG result sequence. For example, if the result of PRNG is 6, then perform the LSB operation on the current color channel XOR the blue channel bit of the 6th sequence. For clarity in the next step, call this 6th sequence blue channel bit as an indicator bit 6.
The XOR result from the previous step 5 is then stored as message bits (and combined with other message bits). Repeat steps 5 and 6 with different color LSBs and channels. The indicator bit XORed with LSB is always the same as long as it hasn't changed pixels 7.
Perform steps 3-5 repeatedly as long as there are still message bits that must be inserted. Then, save all the bit changes to a stego image

Testing Methods
Tests are carried out to see the success rate of inserting text messages on cover images using the GOST and XOR LSB algorithms with PRNG. One success rate is based on the MSE and PSNR values in the image. Mean Square Error (MSE) can be interpreted as the average squared error value between the modified pixels and the original pixels [18]. MSE is also generally calculated with the Peak Signal-to-Noise Ratio (PSNR) which is nothing but the ratio of the pixel color ratio value to the MSE (in loga-rhythm form) [19]. A small PSNR value means that the quality of an image is bad, while the greater the PSNR value, the better the quality of an image [20].
Then, there are also other tests based on several aspects of cryptography and steganography. Some of these aspects are: 1.
Fidelity: The quality between the cover image and the stego image has not changed much. It can be proven through the MSE and PSNR values as previously described 2.
Imperceptibility: Changes are difficult to detect at least with the naked eye. It can be proven by histograms and surveys from several respondents 3.
Capacity: The larger the message capacity that can be inserted, the better the steganographic algorithm used 4. Speed: Speed in performing the algorithm computation process. The sooner the better [21].

5.
Recovery: Messages that have been pasted can be retrieved or extracted again 6.
Robustness: Strength or security when carried out various attacks or modifications to the stego image.

Figure 2. GUI Application
There are 4 main components visible in this program, namely "Secret Key", "Select Image", "Debug Information", and "Secret Message". "Secret Key" is the part to enter the key that will be used in GOST and PRNG. Then, "Select Image" is used to select an image to insert or retrieve the message. "De-bug Information" is another important section that will show the MSE value, PSNR, SHA256 checksum, and information where the stego image is stored. Finally, "Secret Message" is the section for writing/retrieving messages on images.  Table 6. PSNR comparison between methods

XOR LSB With PRNG
Based on the experimental data, 1-bit LSB (91.13) has the highest PSNR compared to the GOST + XOR LSB method with PRNG (85.939), while random bit substitution (80.58) has the lowest PSNR. This means that GOST + XOR LSB with PRNG has better image quality than the random bit substitution method, and slightly worse than other methods.
Then, an imperceptibility test was also carried out on each cover and stego image to see signs of significant differences between the two types of images. The test was carried out through a histogram comparison (by converting the image to grayscale) as well as a survey method with 25 respondents. The answers from each respondent and histogram results can be seen in tables 7 and 8 below.

Capacity Testing
The next test is testing the message storage capacity of each image. In theory, the 1-bit LSB and random bit substitution methods can only store 3 message bits per pixel, while 2-bit LSB can store 6 message bits per pixel. Thus, there are 2 other methods, namely XOR LSB with PRNG and GOST + XOR LSB with PRNG, each of which can store 3-6 bit pixels per image. The results of the capacity test look like the following: Based on the test results, there is no difference between the XOR LSB method with PRNG and GOST + XOR LSB with PRNG (both can store an average of 43.33 bits per 10 image pixels). Then, compared to the other 3 methods (which can accommodate 30 bits, 60 bits, and 30 bits respectively), these two XOR LSB methods with PRNG occupy the median position which means they are neither too bad nor good.

Recovery and Robustness Testing
Finally, in terms of recovery and robustness, message extraction back to the GOST + XOR LSB algorithm with PRNG after modifications to the stego image shows that the LSB algorithm is quite good at inserting messages into lossless image formats (PNG, TIFF, TGA, etc.) but is very bad for a lossy format like JPEG. Then, based on the image modification test (rotation and resizing) it also shows that the LSB is very weak if various modifications are made to the stego image. The results of the recovery and robustness tests can be seen in tables 11 and 12. As can be seen in tables 11 dan 12, message extraction failed in GIF and JPEG formats with PSNRs of 51,203 and 33,878, respectively. Of the 9 tested image formats, the remaining 7 messages can be extracted well with the median MSE 0.0001935 and median PSNR 85.261. Then, in terms of rotation, all image rotations from 90°, 180°, and 270° fail to extract messages and in terms of resizing all sizes from 10%, 30%, 50%, and 80% also fail to extract messages.

CONCLUSION
After doing some testing of the results and analysis in the previous stages, several conclusions can be drawn, namely: 1.
The GOST and XOR LSB algorithms with PRNG are quite good in terms of image quality, message capacity, embedding speed, and imperceptibility (cannot be seen with the naked eye). Even so, this algorithm is still very weak if carried out various attacks/modifications on the resulting stego image (eg rotation and resizing).

2.
Testing on the robustness aspect, from 9 tested image formats, 7 images containing messages can be extracted properly with a median MSE of 0.0001935 and a median PSNR of 85.261. Then, in terms of rotation, all image rotations from 90°, 180°, and 270° fail to extract messages and in terms of resizing all sizes from 10%, 30%, 50%, and 80% also fail to extract messages. 3.
Testing the computational time, the average time required for encryption with test data 6 test data is 0.073 seconds with the GOST algorithm, using GOST + XOR LSB with PNRG is 0.485 seconds.

4.
Testing on the aspect of capacity, using the XOR LSB combination method with PRNG can store an average of 43.3 bits.

2.
Testing on the imperceptibility aspect using 25 respondents and visualization using an RGB histogram showed no difference between the cover image and the stego image.

3.
Testing on the fidelity aspect of the 3 tested images, 1-bit LSB (91.13) has the highest PSNR when compared to the GOST + XOR LSB method with PRNG (85.939), while random bit substitution (80.58) has the lowest PSNR. This means that GOST + XOR LSB with PRNG has better image quality than the random bit substitution method, and slightly worse than other methods.