Implementation of Linear Congruential Generator (LCG) Algorithm, Most Significant Bit (MSB) and Fibonacci Code in Compression and Security Messages Using Images

The use of technology makes information spread more quickly compared to conventional methods that humans used before they knew technology. However, there is information that is only intended for certain people or institutions because the information is very confidential. The obstacle in exchanging information is the problem of information / data security. Because of that, an electronic message security algorithm which is quite well-developed is cryptographic (cryptography) and steganographic (steganography) algorithms. The development of increasingly advanced technology and the addition of more and more computer users also cause data to accumulate and transfer data from one device to another. The data is generally compressed first so that the exchange process does no take too long. Therefore, we need a system that can secure messages while reducing image data to be more efficient in the process of transmission and delivery. To implement this problem the system is designed using the Linear Congruential Generator (LCG) algorithm and the Most Significant Bit (MSB) as a security medium and using the Fibonacci Code algorithm as compression of the image. In implementation the system has a weakness in compressing images that not dominate colors because the size of the data becomes larger. In addition, the compression ratio on the variation of text length has decreased and has increased in the image variation experiments where if the compression ratio decreases, indicating better compression.


Introduction
Nowadays technological developments have greatly influenced human life, especially in the field of information data. There are various types of data that can be loaded, such as text, images, audio (sounds, sounds, music) and videos. These four types of data are generally known as multimedia. Exchange of information by utilizing technology enables information to spread more quickly compared to conventional methods that were used by humans before they knew technology. This is a strong reason for informants to use Internet media [12].
However, sometimes there is information that is only intended for certain people or institutions because the information is very confidential. And the obstacle in exchanging information like this, of course, is the problem of information / data security. For this reason, a well-known electronic message security algorithm was developed, namely the cryptographic (cryptography) and steganographic (steganography) algorithms.
The development of increasingly advanced technology and the addition of more computer users has caused the accumulation of data and the transfer of data from one device to another. The data is generally compressed first so that the exchange process does not take too long.
Data compression is one of the processes used to reduce file size thereby reducing data storage space. This is very useful because the better file quality requires a very large size, so that with the use of data compression methods, file size can be reduced without reducing the quality of the file [11].
Fibonacci code compression method is a type of compression method based on coding with a universal code system where the positive integer value of the data forms a binary code word using Fibonacci numbers [7].
The method used to insert messages into an image file is the Most Significant Bit (MSB) method. This method will replace the leftmost (largest) bit of the image pixel with the insertion bits. To insert a message into a color image, the image and the insertion message must be changed to binary. Converting a color image into a binary image is used to get one value at one pixel image, where one pixel of the binary image will be replaced by one bit from eight bits of one insertion message character.

Related Works
Linear Congruential Generator (LCG) is the most basic and popular PRNG. The initial values of X0 or Xn+1 and the constants (a, b, and m) determine the quality of the random numbers obtained. A good category of random numbers is the repetition of the same random number after many random numbers are generated and it is not predicted when the repetition will occur. The key to generating the number is X0, which is called seed. The LCG period is not greater than the value of m. If a, b, and m are chosen correctly with b relatively prime to m and b <m, then LCG will have a maximum period, m -1.
Steganography comes from the Greek word steganos, which means "hidden / veiled," and graphein which means "writing." Herodotus is known as a Greek historian who first introduced the word steganography [16]. The process of inserting messages into a covertext media is called encoding, while the extraction process from stegotext is called decoding. There is a steganography algorithm that may require a secret key (called a stego-key) so that only certain parties are entitled to the process of inserting and extracting messages. [19]   The steps in making Fibonacci codes are as follows: • Determine a positive integer n which is greater or equal to 2.
• Determine the biggest Fibonacci number that is smaller or equal to n, subtract the value of n by f, and note the remainder of the subtraction of n value by f. • If the number subtracted is the number contained in the Fibonacci F series (i), add the number "1" to i-2 in the Fibonacci code to be formed. • Repeat step 2, exchange the value of n with the remainder of the subtraction of n value by f until the remainder of the subtraction of n value by f is 0. • Add the number "1" to the rightmost position of the Fibonacci code to be formed.
In the process of inserting a message into a digital image using the Most Significant Bit (MSB) method, the message is inserted at bit 1.

Material and Method
The process in the general architecture diagram of the system above has 2 actors, namely the sender and receiver, where the sender will first insert the character and compress the image then send it to the receiver.
The message will be inserted in the last bits of each element of the cover image binary in the order of R, G, B. Cover pixels to be manipulated are pixels (3), (7), (4), (6), (0). The insertion process is in Table 1 below:  After distributing 8 bits as above, each block will be converted into decimal form which can be seen in the results below 255 249 249 153 221 157 217 141 177 182 219 The results will be saved into a file with the .fb format which will then be sent to the receiver of the message.
To test the system, user does the "embed user" process by pressing the "Embed -compression" menu then "Browse text" to find the text file to be inserted into the image. After that the image will be a cover object. After doing that user will be asked to press the "Embed" button to embed the text into the image. The embed process is complete and will be displayed in the "MSB Results" picture box. The process will display the image, the running time and the original size of the image after the insertion process. Once the insertion process is done, user can do the compression process in order to reduce the size of the embed image.
To do compression, user must press the compression button and they will get some information, including compression ratio, compression time, compress ratio, space saving, and compress size. After performing the compression process, user can do the "save" process to save the results of the compression in the *.fb extension. The results obtained from this study are the results of the embed-compression process and the extract-decompression process of images and text files with 5 variations of resolution for each image and 5 length variations for each text file.   On the chart above, it can be seen that on the compression comparisons of each process and types of compresses, the compression ratio increases but the space string decreases. Compression ratio increases because the size of the data experiences a greater difference between before and after compression. In this experiment, 5 variations of image resolution were tested, including 100x100 pixels, 200x200 pixels, 300x300 pixels, 400x400 pixels, and 500x500 pixels. Each pixel is inserted with text that has a length of 100 characters. The test details are made in the form of the following table: Table 5. Experiment with variations in image resolution.  On the chart above it can be seen that in the compression comparison of each process and types of compresses, the compression ratio increases and the space string increases significantly. Compression ratio increases because the comparison between data sizes experiences a greater difference between before and after compression.

Conclusion
The conclusions that can be drawn based on testing the data compression system and message security using the Linear Congruential Generator (LCG), Most Significant Bit (MSB) and Fibonacci Code methods are as follows: • The designed application is able to insert and compress images using the Linear Congruential Generator (LCG) algorithm, Most Significant Bit (MSB) and Fibonacci Code and decompress the compression results. • The Fibonacci Code Algorithm has the disadvantage that if the input image does not have a predominant color value, the resulting compress can become larger than the original file. • Compression ratio in the text variation experiment with text lengths of 100, 200, and 300 characters (1.85) decreases compared to text lengths of 400 and 500 characters (1.84), and in the experiment of variations in image resolution of 100x100 and 200x200 pixels (2.07) increases compared to the resolution of images 500x500 pixels (2.31). • On file sizes, all experiments experience increases, with a slight increase in the text variation experiment and rapid increase in the image variation experiment.