A5/1 Stream Cipher

Work in progress. This note is still being written and incomplete.

A5/1 is an LFSR based stream cipher used to encrypt on-air mobile communication traffic in the GSM standard.

It combines 3 LFSRs R1R_1, R2R_2, R3R_3 of lengths 19, 22 and 23 bits. The keystream bit at each step is the XOR of the output bits of the 3 registers.

Kerckhoffs’s Principle Violation

The A5/1 design was kept secret from its creation in 1987 until 1999, violating Kerckhoffs’s principle.

  • 1999
    Marc Briceno reverse engineered the design.
  • 2006
    With the design public, Elad Barkan, Eli Biham and Nathan Keller showed how to break the cipher in real time.

Registers

Each register is defined by a feedback polynomial.

R1:x19+x18+x17+x14+1R2:x22+x21+1R3:x23+x22+x21+x8+1\begin{aligned} R_1 &: x^{19} + x^{18} + x^{17} + x^{14} + 1 \\ R_2 &: x^{22} + x^{21} + 1 \\ R_3 &: x^{23} + x^{22} + x^{21} + x^{8} + 1 \end{aligned}

Irregular Clocking

Each register has a clocking bit. At every step, the majority of the 3 clocking bits c1,c2,c3c_1, c_2, c_3 is computed.

maj=(c1⋅c2)⊕(c2⋅c3)⊕(c3⋅c1)\text{maj} = (c_1 \cdot c_2) \oplus (c_2 \cdot c_3) \oplus (c_3 \cdot c_1)

A register is clocked iff its clocking bit equals maj\text{maj}. At least 2 registers are clocked at every step.

c1c_1c2c_2c3c_3maj\text{maj}R1R_1R2R_2R3R_3
0000YYY
0010YYN
0100YNY
0111NYY
1000NYY
1011YNY
1101YYN
1111YYY

Here Y means clocked and N means not clocked.

Whether a register advances depends on the other registers, so the keystream is not a linear function of the key.

Written by September 29, 2026 2 min read
Was this helpful?