Question
Find all pairs of integers keys $\left(a,b \right)$ for affine ciphers for which the encryption function $$c\equiv\left( ap + b \right) \pmod{26} $$ is the same as the corresponding decryption function.
My Approach
$$c\equiv\left( ap + b \right)\pmod {26}$$
Decryption function $$p\equiv\left( c- b \right) \times a^{-1}\pmod{26}$$
equalizing both equation, we have
$$\left( ap + b \right)\pmod{26}\equiv\left( c- b \right) \times a^{-1}\pmod{26}$$
No idea what to do next. Please help me out ! thanks
Note that I am writing congruences as identities, for simplicity of notation.
Hint 1
You want to find $a, b$ such that modulo $26$ the identity $$p = a (a p + b) + b = a^{2} p + a b + b,$$ that is $$(a^{2} - 1) p + (a + 1) b = 0,$$ holds for all $p$.
Hint 2
Hint 3
Hint 4
Hint 5