dear friends and respected Seniors, I have designed one stream cipher
based on LSFR for the fullfilment of my master degree. As I am novice
in this area. So I need yours suggestions and support, will it be
secure against attack if not how I can make it secure.
While testing of randomness of keystream, it is clearing 14 tests
except random excursion and random excursion variants..
Hope to hear soon from yours side.
Best Regrds
Manmohan
Design and Implementation of LFSR based stream cipher
Suppose in a system there are 4 shift register. Each shift register
will generate a PN sequence. The length of sequence will depend on the
size of shift register and the total period of the system will be the
LCM of the periods of the 4 shift registers. The
Keystream of the 4 shift registers are mixed with the input data
bits(plain text) using the XOR operation. This will be the output
sequence bit (ciphertext)
Mathematically if X1,X2,X3,X4 are the output sequence bit of the 4
shift registers R1, R2, R3 and R4 and P is the plain text(in ASCII)
form . Then we can say
PTK = C
Where value of Keystream(K) is calculated by using the function
(X1^X2)T X3TX4 = K
Assuming the stages of 4 Linear Feed back shift registers are
31,29,27 and 41 . The primitive polynomials for each shift registers
will be:
1) x31+x3+1 = 0
2) x29+x2+1 = 0
3) x27+x5+x2+x+1 = 0
4) x41+x3+1 = 0
These sequences will be used as the tapping point ie for 31 stage shift
register the tapping point will be 31 and 3rd . For 29 bit shift
register tapping point will be 29 and 2nd and so on.
These potions are XOR ie for 31 stage shift register 31 and 3rd bit is
XORed . In this way these are XOR and right shifted.
Same operation is applied for each shift register.
Suppose we get output X1 from LFSR R1, X2 from shift Register R2, X3
from shift Register R3 and X4 from Shift register R4 .
Then these all result set are XOR with the input text P(this is
converted into ASCII code) to get the cipher text.
At the receiving end the system is again activated so that the 4 shift
registers in the system will again generate the sequence and the crypt
bit will be XOR to get back the initial input.
For Encryption of plain text the function used is PTK=C
Where P is plain input text, C is the Cipher text and K is the Key
stream given by
Keystream K = (X1^X2)T X3TX4 = C
Similarly for Decryption the function used is CTK=P
Period of Key Sequence: For the Register R1, time period(T1) will be
231 -1
Register R2 ,time period(T2) = 229 -1
Register R3 ,time period(T3) = 227 -1
Register R4 ,time period(T4) = 241 - 1
Knuth shows
GCD(2p - 1, 2q -1 ) = 2GCD(p,q) - 1
GCD(T1,T2,T3,T4) = 2GCD(31,29,27,41) -1
= 21 -1 = 2 -1 = 1
Period of key Sequence will be product of T1,T2,T3,T4 which is
approximately 2128.
Randomness tests : Using NIST test suite most randomness tests were
passed by the key stream (X1^X2)T X3TX4 =K. Report of which is
attached here with.
Feeding of shift register(Key generation) : User is asked to enter 16
character password so that 128 bits can be generated. Out of this each
shift register is feeded with bits sequentially i,e first 31st bits for
first shift register, next 29 bits for second shift register , next 27
bits for 3rd shift register, and next 41 bits for 4th shift register.
Same operation is applied at the receiving end too for decryption of
bits to get the original plain text.
Received on Thu Sep 29 21:44:37 2005