Deciphering using Affine Ciphers and Hill ciphers.

Number Theory Level pending

If a plain text message was first enciphered using the affine transformation 25 P + 16 C m o d 26 25 * P + 16 \equiv C \bmod 26 , then was enciphered again using the hill cipher A X j B j m o d 26 A * X{j} \equiv B_{j} \mod 26 , where matrix A = [ 16 1 3 5 1 10 23 1 7 ] m o d 26 A = \begin{bmatrix}{16} && {1} && {3} \\ {5} && {1} && {10} \\ {23} && {1} && {7}\end{bmatrix} \bmod{26} , the enciphered message is: X K Y A L G XKYALG .

Decipher the enciphered message above and express the result as a string of integers.


The answer is 19744133.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Rocco Dalto
Jan 16, 2017

Outline to decipher:

Convert X K Y A L G XKYALG to two 3 X 1 3 \: X \: 1 blocks:

B 1 = [ 23 10 24 ] m o d 26 B_{1} = \left[ \begin{array}{ccc} 23 \\ 10 \\ 24 \\ \ \end{array} \right] \mod{26} and B 2 = [ 0 11 6 ] m o d 26. B_{2} = \left[ \begin{array}{ccc} 0 \\ 11 \\ 6 \\ \ \end{array} \right] \mod{26}.

Using A X j B j m o d 26 A * X{j} \equiv B_{j} \mod 26 we solve obtaining X j A 1 B j , X_{j} \equiv A^{-1} * B_{j}, where ( 1 < = j < = 2 ) (1 <= j <= 2) and X 1 = [ x 11 x 12 x 13 ] m o d 26 X_{1} = \left[ \begin{array}{ccc} x_{11} \\ x_{12} \\ x_{13} \\ \ \end{array} \right] \mod{26} and X 2 = [ x 21 x 22 x 23 ] m o d 26 X_{2} = \left[ \begin{array}{ccc} x_{21} \\ x_{22} \\ x_{23} \\ \ \end{array} \right] \mod{26} , and list the numbers :

x 11 x 12 x 13 x 21 x 22 x 23 x_{11} \: x_{12} \: x_{13} \: x_{21} \: x_{22} \: x_{23} .

Now using the above numbers we decipher the list above using P j k a ˉ ( x j k b ) m o d 26 , P_{jk} \equiv \bar{a} * (x_{jk} - b) \mod{26}, where ( 1 < = j < = 2 ) (1 <= j <= 2) and ( 1 < = k < = 3 ) , (1 <= k <= 3), and a ˉ \bar{a} is the inverse of a a modulo 26. 26. Last convert each number P j k P_{jk} to it's corresponding letter L j k L_{jk} .

Begin: Find A 1 A^{-1} .

B = A I = [ 16 1 3 1 0 0 5 1 10 0 1 0 23 1 7 0 0 1 ] m o d 26 B = A|I = \left[ \begin{array}{ccc|ccc} 16 & 1 & 3 & 1 & 0 & 0 \\ 5 & 1 & 10 & 0 & 1 & 0 \\ 23 & 1 & 7 & 0 & 0 & 1 \\ \ \end{array} \right] \mod{26}
R o w 1 R o w 2 Row_{1} \leftrightarrow Row_{2} \implies

B = [ 5 1 10 0 1 0 16 1 3 1 0 0 23 1 7 0 0 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 5 & 1 & 10 & 0 & 1 & 0 \\ 16 & 1 & 3 & 1 & 0 & 0 \\ 23 & 1 & 7 & 0 & 0 & 1 \\ \ \end{array} \right] \mod{26}
21 R o w 1 21 * Row_{1} \implies

B = [ 1 21 2 0 21 0 16 1 3 1 0 0 23 1 7 0 0 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 21 & 2 & 0 & 21 & 0 \\ 16 & 1 & 3 & 1 & 0 & 0 \\ 23 & 1 & 7 & 0 & 0 & 1 \\ \ \end{array} \right] \mod{26}
10 R o w 1 + R o w 2 10 * Row_{1} + Row_{2} \implies

B = [ 1 21 2 0 21 0 0 3 23 1 2 0 23 1 7 0 0 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 21 & 2 & 0 & 21 & 0 \\ 0 & 3 & 23 & 1 & 2 & 0 \\ 23 & 1 & 7 & 0 & 0 & 1 \\ \ \end{array} \right] \mod{26}
9 R o w 2 9 * Row_{2} \implies

B = [ 1 21 2 0 21 0 0 1 25 9 18 0 23 1 7 0 0 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 21 & 2 & 0 & 21 & 0 \\ 0 & 1 & 25 & 9 & 18 & 0 \\ 23 & 1 & 7 & 0 & 0 & 1 \\ \ \end{array} \right] \mod{26}
3 R o w 1 + R o w 3 3 * Row_{1} + Row_{3} \implies

B = [ 1 21 2 0 21 0 0 1 25 9 18 0 0 12 13 0 11 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 21 & 2 & 0 & 21 & 0 \\ 0 & 1 & 25 & 9 & 18 & 0 \\ 0 & 12 & 13 & 0 & 11 & 1 \\ \ \end{array} \right] \mod{26}
14 R o w 2 + R o w 3 14 * Row_{2} + Row_{3} \implies

B = [ 1 21 2 0 21 0 0 1 25 9 18 0 0 0 25 22 3 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 21 & 2 & 0 & 21 & 0 \\ 0 & 1 & 25 & 9 & 18 & 0 \\ 0 & 0 & 25 & 22 & 3 & 1 \\ \ \end{array} \right] \mod{26}
5 R o w 2 + R o w 1 5 * Row_{2} + Row_{1} \implies

B = [ 1 0 23 19 7 0 0 1 25 9 18 0 0 0 25 22 3 1 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 0 & 23 & 19 & 7 & 0 \\ 0 & 1 & 25 & 9 & 18 & 0 \\ 0 & 0 & 25 & 22 & 3 & 1 \\ \ \end{array} \right] \mod{26}
25 R o w 3 25 * Row_{3} \implies

B = [ 1 0 23 19 7 0 0 1 25 9 18 0 0 0 1 4 23 25 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 0 & 23 & 19 & 7 & 0 \\ 0 & 1 & 25 & 9 & 18 & 0 \\ 0 & 0 & 1 & 4 & 23 & 25 \\ \ \end{array} \right] \mod{26}
R o w 3 + R o w 2 Row_{3} + Row_{2} \implies

B = [ 1 0 23 19 7 0 0 1 0 13 15 25 0 0 1 4 23 25 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 0 & 23 & 19 & 7 & 0 \\ 0 & 1 & 0 & 13 & 15 & 25 \\ 0 & 0 & 1 & 4 & 23 & 25 \\ \ \end{array} \right] \mod{26}
3 R o w 3 + R o w 1 3 * Row_{3} + Row_{1} \implies

B = [ 1 0 0 5 24 23 0 1 0 13 15 25 0 0 1 4 23 25 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 0 & 0 & 5 & 24 & 23 \\ 0 & 1 & 0 & 13 & 15 & 25 \\ 0 & 0 & 1 & 4 & 23 & 25 \\ \ \end{array} \right] \mod{26}
\implies

A 1 = [ 5 24 23 13 15 25 4 23 25 ] m o d 26 A^{-1} = \left[ \begin{array}{ccc} 5 & 24 & 23 \\ 13 & 15 & 25 \\ 4 & 23 & 25 \\ \ \end{array} \right] \mod{26}

Using B 1 = [ 23 10 24 ] m o d 26 B_{1} = \left[ \begin{array}{ccc} 23 \\ 10 \\ 24 \\ \ \end{array} \right] \mod{26} and B 2 = [ 0 11 6 ] m o d 26 B_{2} = \left[ \begin{array}{ccc} 0 \\ 11 \\ 6 \\ \ \end{array} \right] \mod{26} \implies

X [ 5 24 23 13 15 25 4 23 25 ] [ 23 0 10 11 24 6 ] [ 23 12 9 3 12 13 ] m o d 26 X \equiv \left[ \begin{array}{ccc} 5 & 24 & 23 \\ 13 & 15 & 25 \\ 4 & 23 & 25 \\ \ \end{array} \right] * \left[ \begin{array}{ccc} 23 & 0 \\ 10 & 11 \\ 24 & 6 \\ \ \end{array} \right] \equiv \left[ \begin{array}{ccc} 23 & 12 \\ 9 & 3 \\ 12 & 13 \\ \ \end{array} \right] \mod{26}

Our list of numbers to decipher are:

23 9 12 12 3 13 23 \: 9 \: 12 \: 12 \: 3 \: 13

25 P + 16 C m o d 26 P 25 ( C 16 ) m o d 26 25 * P + 16 \equiv C \mod 26 \implies P \equiv 25 * (C - 16) \mod{26}

C 1 = 23 P 1 175 m o d 26 19 m o d 26 C_{1} = 23 \implies P_{1} \equiv 175 \mod{26} \equiv \boxed{19 \mod{26}}

C 2 = 9 P 2 175 m o d 26 19 m o d 26 7 m o d 26 C_{2} = 9 \implies P_{2} \equiv -175 \mod{26} \equiv -19 \mod{26} \equiv \boxed{7 \mod{26}}

C 3 = 12 P 3 100 m o d 26 22 m o d 26 4 m o d 26 C_{3} = 12 \implies P_{3} \equiv -100 \mod{26} \equiv -22 \mod{26} \equiv \boxed{4 \mod{26}}

C 4 = 12 P 4 4 m o d 26 C_{4} = 12 \implies P_{4} \equiv \boxed{4 \mod{26}}

C 5 = 3 P 5 325 m o d 26 13 m o d 26 13 m o d 26 C_{5} = 3 \implies P_{5} \equiv -325 \mod{26} \equiv -13 \mod{26} \equiv \boxed{13 \mod{26}}

C 6 P 6 75 m o d 26 23 m o d 26 3 m o d 26 C_{6} \implies P_{6} \equiv -75 \mod{26} \equiv -23 \mod{26} \equiv \boxed{3 \mod{26}}

\therefore The message reads: T H E E N D THE\: END .

This is an appropriate message since this is my last problem on ciphers.

As a string of integers we have: 19744133 \boxed{19744133} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...