LFSR
LFSR
▪ For clk = 1:
Shift the previous vector by one to the right so, FF0 = FF1 = 0 and FF1 = FF2 =
1, and then the left-most bit will be equal to FF1 FF0
clk FF2 FF1 FF0
0 1 0 0
1 0 0=0 1 0
▪ For clk = 2:
clk FF2 FF1 FF0
0 1 0 0
1 0 0=0 1 0
2 1 0=1 0 1
▪ For clk = 3 … 8:
clk FF2 FF1 FF0
0 1 0 0
1 0 0=0 1 0
2 1 0=1 0 1
3 0 1=1 1 0
4 1 0=1 1 1
5 1 1=0 1 1
6 1 1=0 0 1
7 0 1=1 0 0
8 0 0=0 1 0
▪ You will notice that the state vector is repeated from clk = 7.
▪ What is the maximum output length (non-repeated states) of LFSR? 2m – 1.
Here, 23 – 1 = 7.
▪ The key stream generated (Si) is the last column in the previous table;
Si = 001011100…….
o The generalized LFSR is shown in the figure below.
▪ Pi represents a feedback coefficient controlling an on-off switch, where a zero
represents an open switch (not connected with the XOR) and a one represents
a closed switch (connected with the XOR).
▪ For the previous example, the coefficients are (P2 = 0, P1 = 1, P0 = 1).
▪ The key stream Si generated is characterized by the following equations:
Si+m = Si+m-1Pm-1 + … + Si+1P1 + SiP0 mod 2
2. Encryption Process
3. Ciphertext: 011
Contact: [email protected]
Belal Tarek Hassan