Score:0

Question about obtaining a keystream from a linear-feedback shift register

ua flag

For a homework question we are obtaining a keystream from a LFSR and I am slightly confused on which digits are used as the key.

For example I have this table here,

b5 → b4 + b1
t   B5  B4  B3  B2  B1
1   1   0   1   0   1
2   1   1   0   1   0
3   1   1   1   0   1
4   0   1   1   1   0
5   1   0   1   1   1
6   1   1   0   1   1
7   0   1   1   0   1
8   0   0   1   1   0
9   0   0   0   1   1
10  1   0   0   0   1
11  1   1   0   0   0
12  1   1   1   0   0
13  1   1   1   1   0
14  1   1   1   1   1
15  0   1   1   1   1
16  0   0   1   1   1
17  1   0   0   1   1
18  1   1   0   0   1
19  0   1   1   0   0
20  1   0   1   1   0
21  0   1   0   1   1
22  0   0   1   0   1
23  1   0   0   1   0
24  1   1   0   0   1
25  0   1   1   0   0

As you can see rows 19 through 24 will repeat. If I were to use B1 for the keystream, would I only include digits from rows 19-24 in the key since they are repeating or would I include all digits from t=1 to t=32?

kelalaka avatar
in flag
Welcome to our site. B1 since it is the output, see the [images](https://crypto.stackexchange.com/q/89828/18298). Repeats, yes, in your steps, not yet! Can you show me two stages that the internal values of the LFSR are the same?
Matt avatar
ua flag
@kelalaka I'm not sure I understand. Once you get past entry 18, the table will repeat in 6 row intervals since it will keep looping back to 01100
kelalaka avatar
in flag
You should have some errors in your calculations. LFSR are periodic, they don't have tails to enter the loop. With 5 stages, you can have a period of $2^5-1$ if the polynomial is primitive ( m-sequence).
kelalaka avatar
in flag
Try this [sagemath cell](https://sagecell.sagemath.org/?z=eJxVjTEKwzAMRXedwqMFHtKsoat7iBBCMQqYqlIapUNuX8e4hSKQvt5HX9Fd3S36HiGCFh19h4Pjqi4IDzqKHDVw0FI8DW7JfNrjSbgxKaDvwKhMXmybjV5vkkS-BITzIgjCumXZvREC2F9CLW1df-S7N3dqAfVBUhFKe1aZV-VD9Jnv7A3xA9JXP1A=&lang=sage&interacts=eJyLjgUAARUAuQ==), however, no online Berlekamp-Massey. [SageMath LFSR page](https://doc.sagemath.org/html/en/reference/cryptography/sage/crypto/lfsr.html)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.