The Berlekamp–Massey algorithm finds the shortest LFSR—its taps and initial state—that generates a given binary sequence, even when the register length is unknown. section 4.2.2
For a practical exploit, testing candidate lengths can replace the harder algorithm: construct and invert the LFSR matrix for each length, then accept the first error-free reconstruction. section 4.2.2
An LFSR recovery workflow uses:
- Use the final observed bits as the recovered register state and clone the LFSR. section 4.2.2
Known-plaintext stream-cipher attack
Known plaintext such as “ATTACK AT ” reveals keystream bits by XORing it with the ciphertext. Candidate LFSR lengths are tested, and a valid clone decrypts the timestamp suffix.
