Hill Cipher - Trigraph Block Frequencies

Number Theory Level pending

A trigraph cipher is a cipher in which each three block of letters of plaintext is replaced by a block of three letters of ciphertext.

Suppose that the most common trigraph in English is T H E THE , A N D AND , and T H A THA . Using a Hill cipher system the three most common trigraphs in the ciphertext message are L M E LME , W R I WRI , and Z Y C ZYC . We guess that L M E LME , W R I WRI , and Z Y C ZYC correspond to the three most common trigraphs in the English text T H E THE , A N D AND , and T H A THA .

Let A 0 , B 1 , , Z 25 A \rightarrow 0, B \rightarrow 1, \ldots , Z \rightarrow 25 .

Each plaintext block P j P_{j} was enciphered using a Hill trigraphic cipher described by A P j C j m o d 26 , A * P_{j} \equiv C_{j} \mod 26, where each C j C_{j} is a ciphertext block and A = [ a i j ] 3 X 3 , A = [a_{ij}]_{3 \: X \: 3}, .

Choose the matrix or matrices below that makes the above work.

( 1 ) : [ 2 13 3 1 23 10 25 3 7 ] m o d 26 (1): \left[ \begin{array}{ccc} 2 & 13 & 3 \\ 1 & 23 & 10 \\ 25 & 3 & 7 \\ \ \end{array} \right] \mod{26}

( 2 ) : [ 16 1 3 5 1 10 23 1 7 ] m o d 26 (2): \left[ \begin{array}{ccc} 16 & 1 & 3 \\ 5 & 1 & 10 \\ 23 & 1 & 7 \\ \ \end{array} \right] \mod{26}

( 3 ) : [ 16 1 3 6 2 23 25 3 7 ] m o d 26 (3): \left[ \begin{array}{ccc} 16 & 1 & 3 \\ 6 & 2 & 23 \\ 25 & 3 & 7 \\ \ \end{array} \right] \mod{26}

( 4 ) : [ 18 3 3 6 2 23 23 1 7 ] m o d 26 (4): \left[ \begin{array}{ccc} 18 & 3 & 3 \\ 6 & 2 & 23 \\ 23 & 1 & 7 \\ \ \end{array} \right] \mod{26}

In the solution, prior to verification, I show how each matrix was constructed.

Only (1) and (2) (4) only (1), (2), (3), and (4) Only (2) and (3) (1) only (2) only Only (1) and (3) (3) only

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 12, 2017

You can verify that all 4 matrices will work.

Prior to verification, I show how each matrix was constructed.

To construct each matrix:

Let A = [ a i j ] 3 X 3 , A = [a_{ij}]_{3 \: X \: 3}, .

Using A P j C j m o d 26 , A * P_{j} \equiv C_{j} \mod 26, , where ( 1 < = j < = 3 ) (1 <= j <= 3) enciphering each plaintext block we obtain the three 3 X 3 3 \: X \: 3 systems of linear congruence's below:

19 a 11 + 7 a 12 + 4 a 13 = 11 m o d 26 19 * a_{11} + 7 * a_{12} + 4 * a_{13} = 11 \mod{26} 13 a 12 + 3 a 13 = 22 m o d 26 13 * a_{12} + 3 * a_{13} = 22 \mod{26} 19 a 11 + 7 a 12 = 25 m o d 26 19 * a_{11} + 7 * a_{12} = 25 \mod{26}

19 a 21 + 7 a 22 + 4 a 23 = 12 m o d 26 19 * a_{21} + 7 * a_{22} + 4 * a_{23} = 12 \mod{26} 13 a 22 + 3 a 23 = 17 m o d 26 13 * a_{22} + 3 * a_{23} = 17 \mod{26} 19 a 21 + 7 a 22 = 24 m o d 26 19 * a_{21} + 7 * a_{22} = 24 \mod{26}

\ 19 a 31 + 7 a 32 + 4 a 33 = 4 m o d 26 19 * a_{31} + 7 * a_{32} + 4 * a_{33} = 4 \mod{26} 13 a 32 + 3 a 33 = 8 m o d 26 13 * a_{32} + 3 * a_{33} = 8 \mod{26} 19 a 31 + 7 a 32 = 2 m o d 26 19 * a_{31} + 7 * a_{32} = 2 \mod{26}

Setting up the augmented matrix B B we obtain:

B = [ 19 7 4 11 12 4 0 13 3 22 17 8 19 7 0 25 24 2 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 19 & 7 & 4 & 11 & 12 & 4\\ 0 & 13 & 3 & 22 & 17 & 8\\ 19 & 7 & 0 & 25 & 24 & 2\\ \ \end{array} \right] \mod{26}

R o w 2 R o w 3 Row_{2} \leftrightarrow Row_{3} \implies

B = [ 19 7 4 11 12 4 19 7 0 25 24 2 0 13 3 22 17 8 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 19 & 7 & 4 & 11 & 12 & 4\\ 19 & 7 & 0 & 25 & 24 & 2\\ 0 & 13 & 3 & 22 & 17 & 8 \ \end{array} \right] \mod{26}

11 R o w 1 11 * Row_{1} \implies

B = [ 1 25 18 17 2 18 19 7 0 25 24 2 0 13 3 22 17 8 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 25 & 18 & 17 & 2 & 18\\ 19 & 7 & 0 & 25 & 24 & 2\\ 0 & 13 & 3 & 22 & 17 & 8 \ \end{array} \right] \mod{26}

7 R o w 1 + R o w 2 7 * Row_{1} + Row_{2} \implies

B = [ 1 25 18 17 2 18 0 0 22 14 12 24 0 13 3 22 17 8 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 25 & 18 & 17 & 2 & 18\\ 0 & 0 & 22 & 14 & 12 & 24\\ 0 & 13 & 3 & 22 & 17 & 8 \ \end{array} \right] \mod{26}

9 R o w 3 9 * Row_{3} \implies

B = [ 1 25 18 17 2 18 0 0 22 14 12 24 0 13 1 16 23 20 ] m o d 26 B = \left[ \begin{array}{ccc|ccc} 1 & 25 & 18 & 17 & 2 & 18\\ 0 & 0 & 22 & 14 & 12 & 24\\ 0 & 13 & 1 & 16 & 23 & 20 \ \end{array} \right] \mod{26}

8 R o w 3 + R o w 1 8 * Row_{3} + Row_{1} \implies

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

4 R o w 3 + R o w 2 4 * Row_{3} + Row_{2} \implies

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

From the above matrix we obtain:

a 11 + 25 a 12 15 m o d 26 a_{11} + 25 * a_{12} \equiv 15 \mod{26}

a 21 + 25 a 22 4 m o d 26 a_{21} + 25 * a_{22} \equiv 4 \mod{26}

a 31 + 25 a 32 22 m o d 26 a_{31} + 25 * a_{32} \equiv 22 \mod{26}

Since a j 2 a_{j2} is an arbitrary variable let:

a 12 13 m o d 26 a_{12} \equiv 13 \mod{26}

a 22 23 m o d 26 a_{22} \equiv 23 \mod{26}

a 32 3 m o d 26 a_{32} \equiv 3 \mod{26}

\implies

a 11 15 25 13 m o d 26 310 m o d 26 24 m o d 26 2 m o d 26 a_{11} \equiv 15 - 25 * 13 \mod{26} \equiv -310 \mod{26} \equiv -24 \mod{26} \equiv 2 \mod{26}

a 21 1 m o d 26 a_{21} \equiv 1 \mod{26}

a 31 25 m o d 26 a_{31} \equiv 25 \mod{26}

and since a 12 , a 22 , a n d a 32 a_{12}, a_{22}, and a_{32} are odd \implies

13 + a 13 16 m o d 26 13 + a_{13} \equiv 16 \mod 26

13 + a 23 23 m o d 26 13 + a_{23} \equiv 23 \mod{26}

13 + a 33 20 m o d 26 13 + a_{33} \equiv 20 \mod{26}

\implies

a 13 3 m o d 26 a_{13} \equiv 3 \mod{26}

a 23 10 m o d 26 a_{23} \equiv 10 \mod{26}

a 33 7 m o d 26 a_{33} \equiv 7 \mod{26}

\therefore for the first matrix we obtain:

A = [ 2 13 3 1 23 10 25 3 7 ] m o d 26 A = \left[ \begin{array}{ccc} 2 & 13 & 3\\ 1 & 23 & 10\\ 25 & 3 & 7\\ \ \end{array} \right] \mod{26}

For the second matrix let:

a 12 1 m o d 26 a_{12} \equiv 1 \mod{26}

a 22 1 m o d 26 a_{22} \equiv 1 \mod{26}

a 32 1 m o d 26 a_{32} \equiv 1 \mod{26}

\implies

a 11 20 m o d 26 16 m o d 23 a_{11} \equiv -20 \mod{26} \equiv 16 \mod{23}

a 21 5 m o d 26 a_{21} \equiv 5 \mod{26}

a 31 23 m o d 26 a_{31} \equiv 23 \mod{26}

and,

a 13 3 m o d 26 a_{13} \equiv 3 \mod{26}

a 23 10 m o d 26 a_{23} \equiv 10 \mod{26}

a 33 7 m o d 26 a_{33} \equiv 7 \mod{26}

\therefore for the second matrix we obtain:

A = [ 16 1 3 5 1 10 23 1 7 ] m o d 26 A = \left[ \begin{array}{ccc} 16 & 1 & 3\\ 5 & 1 & 10\\ 23 & 1 & 7\\ \ \end{array} \right] \mod{26}

For the third matrix let:

a 12 1 m o d 26 a_{12} \equiv 1 \mod{26}

a 22 2 m o d 26 a_{22} \equiv 2 \mod{26}

a 32 3 m o d 26 a_{32} \equiv 3 \mod{26}

\implies

a 11 16 m o d 23 a_{11} \equiv 16 \mod{23}

a 21 6 m o d 26 a_{21} \equiv 6 \mod{26}

a 31 25 m o d 26 a_{31} \equiv 25 \mod{26}

and,

a 13 3 m o d 26 a_{13} \equiv 3 \mod{26}

a 23 23 m o d 26 a_{23} \equiv 23 \mod{26}

a 33 7 m o d 26 a_{33} \equiv 7 \mod{26}

\therefore for the third matrix we obtain:

A = [ 16 1 3 6 2 23 23 3 7 ] m o d 26 A = \left[ \begin{array}{ccc} 16 & 1 & 3\\ 6 & 2 & 23\\ 23 & 3 & 7\\ \ \end{array} \right] \mod{26}

For the fourth matrix let:

a 12 3 m o d 26 a_{12} \equiv 3 \mod{26}

a 22 2 m o d 26 a_{22} \equiv 2 \mod{26}

a 32 1 m o d 26 a_{32} \equiv 1 \mod{26}

\implies

a 11 18 m o d 23 a_{11} \equiv 18 \mod{23}

a 21 6 m o d 26 a_{21} \equiv 6 \mod{26}

a 31 23 m o d 26 a_{31} \equiv 23 \mod{26}

and,

a 13 3 m o d 26 a_{13} \equiv 3 \mod{26}

a 23 23 m o d 26 a_{23} \equiv 23 \mod{26}

a 33 7 m o d 26 a_{33} \equiv 7 \mod{26}

\therefore for the fourth matrix we obtain:

A = [ 18 3 3 6 2 23 23 1 7 ] m o d 26 A = \left[ \begin{array}{ccc} 18 & 3 & 3\\ 6 & 2 & 23\\ 23 & 1 & 7\\ \ \end{array} \right] \mod{26}

Note for all four cases ( det ( A ) , 26 ) = 1 (\det(A), 26) = 1 .

For the first matrix we obtain:

[ 2 13 3 1 23 10 25 3 7 ] [ 19 0 19 7 13 7 4 3 0 ] [ 11 22 25 12 17 24 4 8 2 ] m o d 26 \left[ \begin{array}{ccc} 2 & 13 & 3 \\ 1 & 23 & 10 \\ 25 & 3 & 7 \\ \ \end{array} \right] * \left[ \begin{array}{ccc} 19 & 0 & 19 \\ 7 & 13 & 7 \\ 4 & 3 & 0 \\ \ \end{array} \right] \equiv \left[ \begin{array}{ccc} 11 & 22 & 25 \\ 12 & 17 & 24 \\ 4 & 8 & 2 \\ \ \end{array} \right] \mod{26}

Using the blocks [ 11 12 4 ] , [ 22 17 8 ] \left [\begin{array}{ccc|c} 11 \\ 12 \\ 4 \\ \ \end{array} \right], \left [\begin{array}{ccc|c} 22 \\ 17 \\ 8 \\ \ \end{array} \right] , and, [ 25 24 2 ] \left [\begin{array}{ccc|c} 25 \\ 24 \\ 2 \\ \ \end{array} \right] we obtain the ciphertext:

L M E LME , W R I WRI , and Z Y C ZYC .

The user can verify the enciphered text using the other three matrices.

Answer: \textbf{Answer:} ( 1 ) , ( 2 ) , ( 3 ) , (1), (2), (3), and ( 4 ) (4) .

@Rocco Dalto Nice problem and thanks for sharing the matrix A A construction. Since there is some freedom to pick column 2 of the matrix, this would seem to give a large number ( 2 6 3 > 17 , 000 26^3 > 17,000 ) of possibilities for it, limited only by things like det A 0 \det A \ne 0 and gcd ( det A , 26 ) = 1 \gcd( \det A, 26) = 1 . I suppose those possibilities are narrowed down by frequency analysis of other 3-letter blocks, correct?

Wesley Zumino - 3 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...