A Comparison of One Time Pad Random Key Generation using Linear Congruential Generator and Quadratic Congruential Generator

One Time Pad algorithm always requires a pairing of the key for plaintext. If the length of keys less than a length of the plaintext, the key will be repeated until the length of the plaintext same with the length of the key. In this research, we use Linear Congruential Generator and Quadratic Congruential Generator for generating a random number. One Time Pad use a random number as a key for encryption and decryption process. Key will generate the first letter from the plaintext, we compare these two algorithms in terms of time speed encryption, and the result is a combination of OTP with LCG faster than the combination of OTP with QCG.


Introduction
Research on data security is very interesting. This study is also always discussed to improve the convenience of using confidential data. Cryptography depends on key strengths, by using a strong key on the process of encryption and decryption, we can improve the security of confidential data [1] [2]. The One Time Pad (OTP) algorithm is characterized, in that the key is used only once in every encryption process [3] [4]. The OTP algorithm uses random numbers that can be constructed from different types of random number generator algorithms. An OTP algorithm key will be established along the plaintext to be encrypted. If the plaintext is longer than the key, the key will be repeated throughout the plaintext [5][6] [7]. Because of this unique key, the OTP algorithm can be considered as the most powerful algorithm in cryptography [8].
Muhammad Iqbal et al [5] implements the OTP algorithm in the SMS app to keep the security of confidential messages. XOR operators are used in encryption and decryption processes. Key selection is done manually by selecting some characters that will be converted into ASCII code. Messages generated from this application are messages that can be guaranteed confidentiality because the message can only be read by the sender and the recipient. The OTP algorithm is the latest version of the Vernam Cipher algorithm [9]. The keys used in the OTP Algorithm can also be generated through a random number generator algorithm. The first random number to be referred to is called Seed [10]. Jhessica Clawdia et al [11] uses the Linear Congruential Generator (LCG) algorithm to generate random numbers. This algorithm is used to avoid generating repetitive keys. From the key generation process can be seen that the longer the range of m values the less likely the key will be repeated.
Using the LCG algorithm to generate keys, can also generate dynamic keys. As has been done by Zeenat Mahmood et al [12] it appears that the cryptographic algorithm is already diff icult to solve by cryptanalys is. Random number generator algorithms have an important role in cryptography because they have resistance to cryptanalysis attacks. Mina Mishra et al [13] he did some research on testing some random number generator algorithms, one of them is LCG. The LCG algorithm has resistance to cryptanalys is attacks and has a good key sensitivity.
Various combinations of algorithms are also performed to generate random numbers. Massoud Sokouti et al [14] he generates random numbers with a genetic algorithm. The key that has been formed will be used by the OTP algorithm. The results of this study, OTP algorithm has a strong resistance and able to maintain data security from cryptanalyst attacks. In addition to the LCG random number generator algorithm, there is also a Quadratic Congruential Generator (QCG) algorithm. This algorithm generates random numbers with mathematical formulas and quadratic ranks as written by Jurgen Eichenauer et al [15].
From some previous research, researchers are still conducting trials to generate random numbers that aim to form a strong cryptographic key. In this study we propose and compare the combination of OTP with LCG algorithm and OTP with QCG algorithm. And we also compare these two algorithms in terms of time speed encryption. The author will also modify the OTP algorithm. Differences exist in the encryption and decryption processes that do not involve the first plaintext characters.

One Time Pad Algorithm
One Time Pad Algorithm (OTP) is a symmetric key cryptography algorithm with encryption and decryption process using the same key [1]. In this research, we use 256 characters from the table of ASCII so we will do encryption and decryption process in mod 256. OTP encryption formula is [16]: AndOTP decryption formula is [16]: Description of formula : Mod 255 is mean total of ASCII numbers

Linear Congruential Generator Algorithm
This is the formula of Linear Congruential Generator [1]: Description of formula : X n = Random number to n of the series X n-1 = previous random number a = multiplier

Quadratic Congruential Generator Algorithm
This is the formula of Cubic Congruential Generator [1]: Description of formula : X n = Random number to i of the series X n-1 = previous random number a,b,c = multiplier d = increment m = modulus

One Time Pad Algorithm Modified with LCG
In this chapter, we perform the encryption and decryption process with a combination of the modified OTP and LCG. The modified OTP algorithm is not different from the original OTP algorithm. Differences exist in the encryption and decryption processes that do not involve the first plaintext characters. In generating the keys we use a = 3; b = 17; and m = 101.

Encryption Process:
There are several steps to perform the encryption process : Step -1: Retrieve the plaintext to be encrypted Step -2: Convert the first letter into ASCII code Step -3: Make the number in Step -2 as Z0 (seed) to generate a random number Step -4: Leaving the first letter unencrypted Step -5: Key = Z Step -6: Perform encryption process on next letter Step -7: Generate a random number Zn using LCG Step -8: Return to step 5 until all letters are encrypted Here is a table forperforming the encryption process :

Decryption Process :
There are several steps to perform the decryption process : Step -1 : Retrieve the ciphertext to be decrypted Step -2 : Convert the first letter into ASCII code Step -3 : Make the number in Step -2 as Z 0 to generate a random number Step -4 : Leaving the first letter undecrypted Step -5 : Key = Z Step -6 : Perform decryption process on next letter Step -7 : Generate a random number Zn Step -8 : Return to step 5 until all letters are decrypted Here is a table forperforming the decryption process :

One Time Pad Algorithm Modified with QCG
In this chapter, we perform the encryption and decryption process with a combination of the modified OTP and QCG. The modified OTP algorithm is not much different from the original OTP algorithm. Differences exist in the encryption and decryption processes that do not involve the first plaintext characters. In generating the keys we use a = 3; b = 17; c = 19, and m = 101.

Encryption Process
There are several steps to perform the encryption process : Step -1: Retrieve the plaintext to be encrypted Step -2: Convert the first letter into ASCII code Step -3: Make the number in Step -2 as Z0(seed) to generate a random number Step -4: Leaving the first letter unencrypted Step -5: Key = Z Step -6: Perform encryption process on next letter Step -7: Generate a random number Zn using QCG Step -8: Return to step 5 until all letters are encrypted Here is a table forperforming the encryption process : There are several steps to perform the decryption process : Step -1 : Retrieve the ciphertext to be decrypted Step -2 : Convert the first letter into ASCII code Step -3 : Make the number in Step -2 as Z 0 to generate a random number Step -4 : Leaving the first letter undecrypted Step -5 : Key = Z Step -6 : Perform decryption process on next letter Step -7 : Generate a random number Zn Step -8 : Return to step 5 until all letters are decrypted Here is a table forperforming the decryption process :

Result and Discussion
The testing is done in the text file (.txt) thus get all the characters that have been symbolized on ASCII code. In reality, there are still many file types that need to be tested. Testing is also done on text files with large size and test results are really stable. This is influenced by the use of modulo 255 in the encryption process and decryption process. So all of ASCII characters can be encrypted and decrypted properly. The process through which Encryption and Decryption are the same, then decryption test is not performed.

Conclusions
Based on the above experiments it is concluded that the LCG process is faster than CCG. Future work needs to be tested about how the treatment of documents that have special codes such as the use of font size, italic, bold, underline, and also the use of color. Thing need to be tested on the spreadsheet file and how it affects the formula on the spreadsheet and also against the existing table. In the future are still many more need to be tested with OTP using this dynamic key.