A Linear Feedback Shift Register (LFSR) is a fundamental component in the field of classical cryptography, particularly in the design and implementation of stream ciphers. The maximum period generated by an LFSR of degree
is a topic of significant importance due to its implications on the security and efficiency of cryptographic systems.
An LFSR is essentially a shift register whose input bit is a linear function of its previous state. The 'degree' of an LFSR, denoted as
, refers to the number of stages or flip-flops it contains. The state of the LFSR is typically represented by an
-bit vector, and the linear function that determines the feedback is often represented by a characteristic polynomial.
For an LFSR of degree
, the characteristic polynomial is of the form:
![]()
where
are coefficients that can be either 0 or 1. The feedback function is defined by this polynomial, and the new bit entering the register is a linear combination of the bits currently in the register, determined by the coefficients
.
The maximum period of an LFSR is the length of the sequence before it starts repeating. For an LFSR to achieve its maximum period, the characteristic polynomial must be a primitive polynomial. A primitive polynomial of degree
over the finite field
(Galois Field of two elements) has the property that it generates all the non-zero elements of
as its sequence of output bits. The maximum period of an LFSR of degree
is:
![]()
This period is achieved only if the characteristic polynomial is primitive. If the polynomial is not primitive, the period will be a divisor of
, but it will not reach the maximum possible value.
To illustrate, consider an LFSR of degree 3. The characteristic polynomial for this LFSR could be:
![]()
This polynomial is known to be primitive. Therefore, the LFSR with this characteristic polynomial will have a maximum period of:
![]()
The sequence generated by this LFSR will go through all possible non-zero 3-bit states before repeating. If we start with an initial state of
, the sequence of states will be:
1. [1, 0, 0] 2. [0, 1, 0] 3. [0, 0, 1] 4. [1, 1, 0] 5. [0, 1, 1] 6. [1, 0, 1] 7. [1, 1, 1]
After this, the sequence will repeat.
It is important to understand the role of the primitive polynomial in achieving the maximum period. The properties of primitive polynomials are deeply rooted in number theory and algebra. A polynomial
of degree
is primitive if it cannot be factored into polynomials of lower degree over
, and if
is a root of
, then
generates the multiplicative group of the field
.
Finding primitive polynomials is a non-trivial task. There are known algorithms and tables that list primitive polynomials for various degrees. For practical purposes in cryptographic applications, these precomputed tables are often used to ensure that the LFSR achieves the desired maximum period.
The significance of the maximum period in cryptographic applications cannot be overstated. A longer period implies that the sequence generated by the LFSR will take longer to repeat, which enhances the security of the cryptographic system. In stream ciphers, the keystream generated by the LFSR is used to encrypt the plaintext by combining it with the plaintext bits using the XOR operation. If the period of the LFSR is too short, the keystream will repeat, making the cipher vulnerable to attacks such as the known-plaintext attack.
Consider an example where an LFSR with a non-primitive polynomial is used. Suppose the characteristic polynomial is:
![]()
This polynomial is not primitive. The period of the LFSR with this polynomial will be shorter than
. In fact, the period will be 3, as the sequence of states will repeat after 3 steps. Starting with an initial state of
, the sequence of states will be:
1. [1, 0, 0] 2. [0, 1, 0] 3. [0, 0, 1] 4. [1, 0, 0]
This short period makes the LFSR unsuitable for cryptographic purposes, as the keystream will quickly repeat, exposing the encrypted message to potential attacks.
To ensure the security of stream ciphers, it is essential to use LFSRs with primitive polynomials that guarantee the maximum period. Additionally, the initial state of the LFSR should be chosen carefully to avoid the all-zero state, which would result in a degenerate sequence of all zeros.
In practice, multiple LFSRs are often combined to create more complex keystream generators with longer periods and better statistical properties. One common method is the use of a combination generator, where the outputs of several LFSRs are combined using a nonlinear function. Another method is the use of a shrinking generator, where the output of one LFSR is used to control the output of another LFSR.
The study of LFSRs and their properties is a rich field that intersects with algebra, number theory, and computer science. Understanding the maximum period of an LFSR and the conditions under which it is achieved is fundamental to the design of secure and efficient cryptographic systems.
Other recent questions and answers regarding Stream ciphers and linear feedback shift registers:
- Can lsfr be used in practical scenerio?
- What is lsfr
- Does GSM use two LSFRs coupled together in implementing a stream cipher?
- Can a linear feedback shift register (LSFR) be implemented using flip flops?
- What are correlation attacks and algebraic attacks, and how do they exploit the vulnerabilities of single LFSRs?
- Explain how the A5/1 cipher enhances security by using multiple LFSRs and non-linear functions.
- How does an LFSR generate a key stream, and what role does the feedback polynomial play in this process?
- What are the limitations of the one-time pad, and why is it considered impractical for most real-world applications?
- How does a stream cipher differ from a block cipher in terms of data encryption?
- With an attack on a single LFSR is it possible to encounter combination of encrypted and decrypted part of the transmission of length 2m from which it is not possible to build solvable linear equations system?
View more questions and answers in Stream ciphers and linear feedback shift registers

