Interactive demo: how GSM turns a 64-bit key and a frame number into keystream, step by step.
1. Inputs
Both the phone and the network know the session key Kc. The frame number Fn is public and changes for every frame.
Key bits in loading order k1 … k64 (inside each byte, the least significant bit goes first):
Frame bits in loading order f1 … f22 (least significant bit first):
2. Inside the cipher
One frame takes 414 steps: 64 key steps + 22 frame steps + 100 warm-up steps + 228 keystream steps. Click a phase to jump to its start.
Speed
Blue: feedback cells (XOR goes back into cell 0)Orange: clocking cells (majority vote)Red ring: new bit that entered in the last stepFaded: no input bit has reached this cell yet
Keyboard: → step, ← back, Space play or pause. Click any cell to see which key bits (k) and frame bits (f) it is made of.
3. Keystream for this frame
228 bits: the first 114 encrypt one direction (A→B), the next 114 the other direction (B→A). Bits appear as the steps above produce them.
A→B (steps 187–300)
B→A (steps 301–414)
4. Encrypt and decrypt a message
Ciphertext = plaintext ⊕ keystream. One burst carries 114 bits, so a longer message is split into bursts. Every burst uses the next frame number (Fn, Fn+1, …), and the cipher starts again from zero for each one.
Decryption is the same operation as encryption: plaintext = ciphertext ⊕ keystream. With a wrong key or a wrong frame number the keystream is different, so the result is garbage.