LFSR

Linear Feedback Shift Register

Used to generate a stream for OTP.

Defined by:

  • BitSize (Length of internal state)

  • CharacteristicPolynomial (Function to be calculated for generating new values)

  • InitialState (Initial state)

By knowing the CharacteristicPolynomial of an N-BitSize, it is possible to recover the internal state by observing a subsequence of N outputs. This makes it possible to predict subsequent sequences and recover old ones. Moreover, even if one does not know the CharacteristicPolynomial, it is possible to recover it with a sequence of observations. Berlekamp-Massey algorithm allows finding LFSR for a sequence of outputs.

Code

From HERE.

Last updated

Was this helpful?