Linear Feedback Shift Register (LFSR)
- •
What it is
- •
a hardware-friendly building block for stream ciphers: a register of bit-cells where, each clock cycle, the register shifts left, the leftmost bit falls off, and a new bit — the XOR of a fixed subset of "tap" positions — is fed in on the right
- •
- •
Symbols and assumptions
- •
is the n-bit state before clock t. Bits are in : addition is XOR and multiplication is AND. Tap indexes start at zero.
- •
- •
Math — step by step
- •
- Compute the feedback bit as the XOR of the specified old-state cells. Shift left, discard cell 0, and append the feedback. Keep output-before-clock versus output-after-clock explicit.
- •
- For taps , . Every later cell is therefore a linear expression in the initial n bits.
- •
- Raw linear output is predictable once its recurrence and enough state are known. A nonlinear output filter changes the attack: its visible sequence need not have linear complexity n. Analyze the filter as well as the register.
- •
- •
Worked example
- •
Why it's used
- •
extremely cheap to implement in hardware (just shifts and XOR gates, very few transistors)
- •
- •
Used in
- •
DVD encryption (Content Scrambling System (CSS), 2 LFSRs), GSM's A5/1 and A5/2 (3 LFSRs), Bluetooth's E0 (4 LFSRs)
- •
- •
Security
- •
An unfiltered linear recurrence is predictable from sufficient observations. Security depends on the complete construction, including filters, combination, clocking and exposed data; using LFSRs alone does not establish that every design is broken.
- •
- •
Linked references 9
- Algebraic Attack via Boolean Polynomial Ring (Gröbner Basis Key Recovery)
- Annihilator Attack on Filtered LFSRs (Quadratic Linearization)
- Berlekamp-Massey Algorithm
- Content Scrambling System (CSS)
- cryptography-1-boneh
- cryptohack
- Geffe Generator (Nonlinear LFSR Combination via Multiplexer)
- LFSR State via Companion Matrix (Time-Reversal)
- RC4