I would like to get some feedback on the process by which I attempted to solve the problem below, I think my answer is wrong (even though I checked by re encrypting it) as its supposed to be a meaningful word.
encrypted using an affine map on digraphs in the 37-letter alphabet {0,1,...,9,a,b,...,z, }.The letters A-Z have numerical equivalents 10−35, and blank space = 36.A digraph whose two characters have numerical equivalents x and y corresponds to $37⋅x+y$ Most frequent digraphs are GW and R3 in that order and the most common digraphs in English are TH and HE in that order. Find deciphering key and read the message
Here is what I did:
I have tried to use frequency analysis to get my equations, one of which was $a=(393−1922mod1369)$
which I solved using the extended euclidean algorithm.
I then did the final decryption to get 92uqd98uowud as my solution.
The encoded digraphs live in $\mathbb Z_{37^2}$. To permute elements in this space, we have a line which maps ciphertext to plaintext: $$ P = aC + b \pmod {37^2} $$
Frequency analysis provides us two points on this line: $$ (c_1, p_1) = (624, 1090) \\ (c_2, p_2) = (1002, 643) $$
Two points uniquely determine a line, so we can solve for the unknowns $a$ and $b$ in the usual way: $$ a = \frac{p_2 - p_1}{c_2 - c_1} \pmod{37^2} \\ b = p_1 - ac_1 \pmod{37^2} $$
Using the below PowerShell script, we find that $a = 1031$ and $b = 1176$, with a plaintext of: