In a cryptosystem we use the ordinary alphabet numbered 0 to 25. We number digraphs using enumeration to base 26. We encode digraphs using the affine transformation

f(x) = 213x + 111(mod 676)

What is the decoding transformation?

Let y = 213x + 111(mod 676)

Then y = 213x = y - 111(mod 676)

We need to find the inverse of 213 modulo 676

Using Euclid's algorithm we have 9 x (-3) = 1 mod 676

Hence we multiply both sides of 213x = y - 111(mod 676) by (-3) to obtain:

x = -3(y - 111)(mod 676)

Hence x = -3y + 333 mod 676

Since -3 equiv 73(mod 676)

We have decoding transformation g(x) = 73x + 333 mod 676

Can anyone please explain explain where I have gone wrong here, as i know the answer should be g(x) = 73x + 9 mod 676.

Thanks in advance!