Hi I have a stream cipher which uses a keystream of:

F(r) || F(r+1) || F(r+2) || ...

Suppose F(r) is the RSA encryption algorithm:

F(r) = r^e mod p where e and p are known , e = 3

My question is: If we know F(r), F(r+1) and F(r+2), how can we calculate the subsequent key sequence?

Is there some obvious relation between F(r+3) and F(r),F(r+1),F(r+2) I don't see?

  • $\begingroup$ Forget RSA. For any unknown x, can you calculate $(x+c)^3$ for any integer $c$? $\endgroup$
    – pg1989
    Dec 1, 2013 at 9:39
  • $\begingroup$ x^3 + c^3 + 3*x^2*c + 3*x*c^2 ? is that what you're asking? $\endgroup$
    – Ajit
    Dec 1, 2013 at 9:48
  • 1
    $\begingroup$ Hint: you can. Can you add or subtract terms of the subsequent expressions to get terms of the key sequence? $\endgroup$
    – pg1989
    Dec 1, 2013 at 9:51

1 Answer 1


I'll expand my comments into a full answer.

Start by examining that you know the value of $r^3$ - this is just $F(r)$.

You know you can express $F(r+1)$ and $F(r+2)$ symbolically. You can do this for any term in the key sequence, but it will be useful to write down $F(r+3)$. Forget any constant terms in the computations because they can be added in at the end.

Do you notice anything about the coefficients of $r^2$ and $r$ in the expressions for $F(r+1)$ and $F(r+2)$? Do they look like the coefficients of any subsequent terms in the key sequence?

  • $\begingroup$ Got it! I was thinking along the wrong lines. Thanks a lot ! $\endgroup$
    – Ajit
    Dec 1, 2013 at 10:09
  • $\begingroup$ No problem. Good luck with your assignment. $\endgroup$
    – pg1989
    Dec 1, 2013 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.