Pseudorandom Binary Sequence Generation for Stream Ciphers

2 downloads 0 Views 127KB Size Report
RC4 is another popular stream cipher algorithm. But the problem of key sequence distribution is retained because the algorithm does not attempt to find a way.
Pseudorandom Binary Sequence Generation for Stream Ciphers Raghava Nallanthighal and Vijeta Rani Delhi Technological University Delhi, India [email protected], [email protected]

secrecy). A cryptographic algorithm is said to be unconditionally secure if the information in the cipher text cannot help in determining the plaintext uniquely. It is said to be computationally secure if the cost of breaking the cipher exceeds the value of encrypted information or the time required to break the cipher exceeds the useful lifetime of the information. In one time pad, a truly random key is used for only one time whose length is equal to the plaintext. The problem with this algorithm is the generation and the distribution of the key to the receiver side, especially when the key is of plaintext size. In other words, the cost of key distribution cannot be ignored.

Abstract The family of Shift Registers are used to generate pseudorandom binary sequences and are used extensively for synchronous steam ciphers. But the key sequences generated from LFSR, NLFSR or NLFFSR have a short period which repeats to balance the plaintext length. This increases the probability of a cryptanalytic attack. This paper presents a new algorithm that can be used to generate a long, highly random cryptographic binary key from any binary file. The file used as input to the proposed algorithm contains huge amount of redundancy. The proposed algorithm attempts to reduce the redundancy in the input file. The output obtained from the proposed algorithm is a long, highly random binary key. The generated key can be used to encrypt any type of data file using a stream cipher encryption algorithm. The key files obtained from the algorithm implementation are successfully tested by the well known ENT test suite for statistical validation.

Linear Feedback Shift Register (LFSR) technique is an attempt to solve this problem. But the limitation with LFSR is that the key repeats after a period p, where p is very small as compared to the plaintext length. The small period of the key makes the cipher text less secure. RC4 is another popular stream cipher algorithm. But the problem of key sequence distribution is retained because the algorithm does not attempt to find a way to easily distribute the key sequence to the authorized destination.

Keywords- cryptographic key, one time pad, pseudorandom binary sequences, stream ciphers.

The technique proposed in this paper can be used to generate a long binary key sequence. For this, a file having large binary data is taken for key sequence generation. The algorithm proposed in this paper attempts to reduce the redundancy in the data file in an effective yet simple way.

1. INTRODUCTION Various types of encryption algorithms are available at present. The security provided by these algorithms is conditional. Only one time pad, which is a stream cipher, is unconditionally secure (or provides perfect 34

Pseudorandom Binary Sequence Generation for Stream Ciphers

Step 10: Store the resultant bytes in X. Step 11: Compress X using some standard compression software like Win Rar or Win Zip. This increases randomness of the file. The resultant file serves as the key file during encryption. Step 12: Close all files.

2. PROPOSED METHOD The key generation algorithm consists of the following steps. Step 1: Input the source binary file in read mode. Open two other binary files, say X and Y in write mode. Step 2: Segment the source file in one byte segments each. Step 3: Remove those bytes from the source file whose ASCII value is either 0 or 255. Store the result in X. Step 4: Close X. Step 5: Open X in read mode. Step 6: Remove all those bytes from X, which duplicate to their immediate predecessor bytes and store the resultant bytes in Y. Step 7: Close X and Y. Step 8: Open X in write mode and Y in read mode. .

Fig. 2 The Proposed Algorithm

An authorized sender can use the key file generated through the proposed algorithm to encrypt the plain data file using the stream cipher algorithm like vernam cipher or one time pad into a cipher data file. An authorized receiver can generate the same key file at his own site and use it to decrypt the cipher data file.

Fig.1 Key generation Process

Step 9:

Scan Y, bit by bit, to get a sequence of n consecutive zeros or n consecutive ones, where 3 ≤ n ≤ 14. Note that there will be no sequence of 15 or more consecutive ones or zeros as the bytes with ASCII values 0 or 255 are already removed from the file. On getting such a sequence, invert the final bit of the sequence. As a result, there will be no sequence in the file, which is composed of more than n-1 consecutive zeros or n-1 consecutive ones. This n is kept secret

Fig. 3 Encryption Decryption Process

International Journal of the Computer, the Internet and Management Vol.19. No.2 (May-August, 2011) pp 34-37

35

Raghava Nallanthighal and Vijeta Rani

3. EXPERIMENT AND RESULTS

4. BENEFITS AND APPLICATIONS

We generated the key from the proposed key generation algorithm implemented in C programming language with a text file. The results of the experiment are as follows:

The algorithm mainly reduces the problem of large size key distribution to the authorized receiver. One just needs to tell the authorized receiver (in a secure way), the link for source file download (for example) with which the data file is encrypted and the secret value n. The authorized receiver can generate the key file at his own site using the same source file and decrypt the data file from it. An unauthorized receiver (intruder) cannot generate key file as he has no knowledge of source file. Moreover the brute force attack on source file using the file database is not possible as the file database is infinite. Also a brute force attack for the key file bits is not possible as the size of the key file is very large.

TABLE I FILE SIZE AFTER EACH STEP

We also performed ENT statistical test on the source file and the corresponding output files of the key generation algorithm to find the amount of randomness in the files. The results of the experiment are given in Table II.

5. CONCLUSION The algorithm may prove to be a practical implementation of one time pad if the source file and the secret value are not compromised in any way and the reduced bits from the source file in the key file are random enough. The results of our experiments show that the key file generated from the proposed algorithm is highly random. The proposed algorithm is simple, robust and universally applicable and the cost of key generation and distribution is very less.

TABLE II ENT RESULTS FOR N=8 ON A TEXT FILE

REFERENCES “ENT. A pseudorandom number sequence test program”, The ENT website homepage. [Online]. Available: http://www.fourmilab.ch/random. [2] Alireza Yavari (2009), “A Practical Research on Randomness of Digits of Binary Expansion of Irrational Numbers”, International Conference on Information, Communications and signal Processing ICICS 2009. [1]

36

Pseudorandom Binary Sequence Generation for Stream Ciphers

[3]

[4] [5]

[6]

[7] [8]

Giles Cotter (2002), “Generation of Pseudorandom Numbers from Microphone Input”, Computing Devices, University of Virginia. The Wikipedia website. [Online]. Available: http://www.wikipedia.com The howstuffworks website. [Online]. Available: http://www.howstuffworks.com William Stallings (2005), Cryptography and Network Security Principles and Practices, 4th ed., Prentice Hall. I. J. Kumar, Cryptology, Aegean Park Press, New York. Jan L. Harrington (2006), Network Security, an imprint of Elsevier, First Ed, pp. 286-288.

International Journal of the Computer, the Internet and Management Vol.19. No.2 (May-August, 2011) pp 34-37

37