-2

We have $$e(x) \equiv ax + b \pmod{26}$$ where $a,b \in \{0,1,\dots,25\}$ and $\gcd(a,26) = 1.$

The question is how to find all possible values of $a$ and $b$ for which $$e(e(e(x))) \equiv x \pmod{26}$$ holds for all $x \in \{0,1,\dots,25\}.$

Ilmari Karonen
  • 46,120
  • 5
  • 105
  • 181
amn89
  • 1

1 Answers1

1

Since this appears to be a homework exercise, I'll just give you a hint: write out the full expression for $e(e(e(x)))$.

Note that the resulting expression will itself be an affine cipher, i.e. it can be written in the form $$e(e(e(x))) \equiv a'x + b' \pmod{26}$$ with some coefficients $a'$ and $b'$ that depend on the original values of $a$ and $b$.

Now, what do the values of $a'$ and $b'$ have to be, for $$a'x + b' \equiv x \pmod{26}$$ to hold for all $x$? (It's not a trick question, although you may want to take a moment to prove to yourself that the obvious answer really is the only possible one.)

Based on that, you should be able to find all the possible values of the original coefficients $a$ and $b$ that can produce those $a'$ and $b'$ values. (Hint: find the possible values of $a$ first.)

(Or, if you're lazy, just write a program to test all possible values of $a$ and $b$ modulo 26 and see if they work.)

Ilmari Karonen
  • 46,120
  • 5
  • 105
  • 181
  • It is not like that, I know the possible values of a and b in e(x) = a x + b mod 26, a = 1, 3, 4, 7, 9, 11, 15, 17, 19, 21, 23, 25 and b can be any element in Z26 – amn89 Oct 27 '17 at 00:24