Está en la página 1de 4

EJERCICIOS

1. Construya una matriz 2x2, diferente a la dada en el ejemplo, conveniente para


usar como clave en el Sistema de Cifrado de Hill y con ella cifrar el siguiente
mensaje: El hombre sabio.

Se escoge una matriz C de tamao nxn con entradas en los nmeros enteros tal que
su determinante sea 1. Esta matriz ser la clave del sistema de cifrado. Para el ejemplo
tomaremos una matriz 2x2.

CLAVE C: =\[\begin{bmatrix} 1 & 2 \\ 4 & 3\\ \end{bmatrix}\]

El mensaje que se desea cifrar o encriptar se divide en bloques de n letras, sin contar
espacios entre las palabras. En nuestro caso como n=2, cada bloque estar formado por
dos letras:

EL HOMBRE SABIOEL_HO_MB_RE_SA_BI_OX

A cada letra de los bloques formados se les asignar el valor numrico


correspondiente de acuerdo al Cuadro 1, formando una matriz Pnx1.

EL(P1) =\[\begin{bmatrix} 4\\ 11\\ \end{bmatrix}\] HO(P2)=\[\begin{bmatrix}


7\\ 15\\ \end{bmatrix}\] MB(P3)=\[\begin{bmatrix} 12\\ 1\\ \end{bmatrix}\] RE(P4)=\
[\begin{bmatrix} 18\\ 4\\ \end{bmatrix}\] SA(P5)=\[\begin{bmatrix} 19\\
0\\ \end{bmatrix}\] BI(P6) =\[\begin{bmatrix} 1\\ 8\\ \end{bmatrix}\] OX(P7)=\[\begin{bmatrix}
15\\ 24\\ \end{bmatrix}\]

Se calculan los productos entre la matriz C(Clave) y cada una de las matrices obtenidas en el
numeral anterior Pk. Como slo se cuenta con 27 nmeros, los resultados mayores o iguales a
27 se deben reducir a mdulo 27 es decir, dividir entre 27 y tomar el residuo:
C*P1 = \(\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\) \(\begin{bmatrix} 4 \\ 11 \\
\end{bmatrix}\) = \(\begin{bmatrix} 26 \\ 49 \\ \end{bmatrix}\) = \(\begin{bmatrix} 26 \\ 22 \\
\end{bmatrix}\) = ZV
C*P2 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 7 \\ 15 \\
\end{bmatrix}\] = \[\begin{bmatrix} 37 \\ 73 \\ \end{bmatrix}\] = \[\begin{bmatrix} 10 \\ 19 \\
\end{bmatrix}\] = KS

C*P3 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 12 \\ 1 \\


\end{bmatrix}\] = \[\begin{bmatrix} 14 \\ 53 \\ \end{bmatrix}\] = \[\begin{bmatrix} 14 \\ 26 \\
\end{bmatrix}\] = Z
C*P4 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 18 \\ 4 \\
\end{bmatrix}\] = \[\begin{bmatrix} 26 \\ 84 \\ \end{bmatrix}\] = \[\begin{bmatrix} 26 \\ 3 \\
\end{bmatrix}\] = ZD
C*P5 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 19 \\ 0 \\
\end{bmatrix}\] = \[\begin{bmatrix} 9 \\ 36 \\ \end{bmatrix}\] = \[\begin{bmatrix} 9 \\ 9 \\
\end{bmatrix}\] = JJ
C*P6 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 1 \\ 8 \\
\end{bmatrix}\] = \[\begin{bmatrix} 16 \\ 28 \\ \end{bmatrix}\] = \[\begin{bmatrix} 16 \\ 1 \\
\end{bmatrix}\] = PB
C*P7 = \[\begin{bmatrix} 1 & 2 \\ 4 & 3 \\ \end{bmatrix}\] \[\begin{bmatrix} 15 \\ 24 \\
\end{bmatrix}\] = \[\begin{bmatrix} 63 \\ 132 \\ \end{bmatrix}\] = \[\begin{bmatrix} 9 \\ 24 \\
\end{bmatrix}\] =JX
Con las nuevas matrices obtenidas se forma el texto cifrado, asignando a cada nmero la letra
correspondiente de acuerdo al Cuadro 1. CP1 = \(\begin{bmatrix} 26 \\ 22 \\ \end{bmatrix}\)
= ZV...
Asi, nuestro texto cifrado es: ZVKSZZDJJPBJX

2.
Describir el siguiente mensaje LFBUCYPNTXYUIGSWVNRESOSVBEF teniendo e cuenta que
para el cifrado se empleo la clave:\begin{bmatrix}{1}&{-3}&{4}\\{-2}&{7}&{-10}\\{5}&{19}&{29}\end{bmatrix}

Para descifrar el mensaje se realiza el procedimiento de cifrado pero se debe usar la


matriz inversa de la clave.

\( (A|I)=\begin{bmatrix}{1}&{-3}&{4}\\{-2}&{7}&{-10}\\{5}&{-19}&{29}\end{bmatrix}\begin{bmatrix}
{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{bmatrix} \)
\( R_2 \rightarrow R_2+2R_1 =\begin{bmatrix}{1}&{-3}&{4}\\{0}&{1}&{-2}\\{5}&{19}&{29}\end{bmatrix}\begin{bmatrix}{1}&{0}&{0}\\{2}&{1}&{0}\\{0}&{0}&{1}\end{bmatrix} \)
\( R_3 \rightarrow R_3-5R_1 =\begin{bmatrix}{1}&{-3}&{4}\\{0}&{1}&{-2}\\{0}&{4}&{9}\end{bmatrix}\begin{bmatrix}{1}&{0}&{0}\\{2}&{1}&{0}\\{-5}&{0}&{1}\end{bmatrix} \)
\( R_3 \rightarrow R_3+4R_2 =\begin{bmatrix}{1}&{-3}&{4}\\{0}&{1}&{-2}\\
{0}&{0}&{1}\end{bmatrix}\begin{bmatrix}{1}&{0}&{0}\\{2}&{1}&{0}\\{3}&{4}&{1}\end{bmatrix} \)

\( R_2 \rightarrow R_2+2R_3 =\begin{bmatrix}{1}&{-3}&{4}\\{0}&{1}&{0}\\


{0}&{0}&{1}\end{bmatrix}\begin{bmatrix}{1}&{0}&{0}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix} \)
\( R_1 \rightarrow R_1+4R_3 =\begin{bmatrix}{1}&{-3}&{0}\\{0}&{1}&{0}\\
{0}&{0}&{1}\end{bmatrix}\begin{bmatrix}{-11}&{-16}&{-4}\\{8}&{9}&{2}\\
{3}&{4}&{1}\end{bmatrix} \)
\( R_1 \rightarrow R_1+3R_2 =\begin{bmatrix}{1}&{0}&{0}\\{0}&{1}&{0}\\
{0}&{0}&{1}\end{bmatrix}\begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix} \)
\( (C^-1) =\begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix} \)

El mensaje que se desea descifrar se divide en bloques de n letras, sin contar


espacios entre las palabras. En nuestro caso como n=3, cada bloque estar formado por
tres letras:

LFB_UCY_PNT_XYU_IGS_WVN_RES_OSV_BEF

A cada letra de los bloques formados se les asignar el valor numrico


correspondiente de acuerdo al Cuadro 1, formando una matriz Pnx1

\( LFB\rightarrow{} P_1 =\begin{bmatrix}{11}\\{5}\\{1}\end{bmatrix} \) \( UCY\rightarrow{} P_2


=\begin{bmatrix}{21}\\{2}\\{25}\end{bmatrix} \) \( PNT\rightarrow{} P_3 =\begin{bmatrix}{16}\\
{13}\\{20}\end{bmatrix} \) \( XYU\rightarrow{} P_4 =\begin{bmatrix}{24}\\{25}\\
{21}\end{bmatrix} \) \( IGS\rightarrow{} P_5 =\begin{bmatrix}{8}\\{6}\\{19}\end{bmatrix} \) \
( WVN\rightarrow{} P_6 =\begin{bmatrix}{23}\\{22}\\{13}\end{bmatrix} \) \( RES\rightarrow{} P_7
=\begin{bmatrix}{18}\\{4}\\{19}\end{bmatrix} \)\( OSV\rightarrow{} P_8 =\begin{bmatrix}{15}\\
{19}\\{22}\end{bmatrix} \) \( BEF\rightarrow{} P_9 =\begin{bmatrix}{1}\\{4}\\{5}\end{bmatrix} \)

Se calculan los productos entre la matriz C(Clave) y cada una de las matrices
obtenidas en el numeral anterior Pk. Como slo se cuenta con 27 nmeros, los resultados
mayores o iguales a 27 se deben reducir a mdulo 27 es decir, dividir entre 27 y tomar el
residuo:

\( C^-1*P_1 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{11}\\{5}\\{1}\end{bmatrix} = \begin{bmatrix}{200}\\{135}\\{54}\end{bmatrix} =
\begin{bmatrix}{11}\\{0}\\{0}\end{bmatrix} = LAA \)
\( C^-1*P_2 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{21}\\{2}\\{25}\end{bmatrix} = \begin{bmatrix}{345}\\{236}\\{96}\end{bmatrix}
= \begin{bmatrix}{21}\\{20}\\{15}\end{bmatrix} = UTO \)

\( C^-1*P_3 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{16}\\{13}\\{20}\end{bmatrix} = \begin{bmatrix}{391}\\{285}\\{120}\end{bmatrix}
= \begin{bmatrix}{13}\\{15}\\{12}\end{bmatrix} = NOM \)
\( C^-1*P_4 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{24}\\{25}\\{21}\end{bmatrix} = \begin{bmatrix}{629}\\{459}\\{193}\end{bmatrix}
= \begin{bmatrix}{8}\\{0}\\{4}\end{bmatrix} = IAE \)
\( C^-1*P_5 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{8}\\{6}\\{19}\end{bmatrix} = \begin{bmatrix}{208}\\{156}\\{67}\end{bmatrix} =
\begin{bmatrix}{19}\\{21}\\{13}\end{bmatrix} = SUN \)
\( C^-1*P_6 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{23}\\{22}\\{13}\end{bmatrix} = \begin{bmatrix}{567}\\{408}\\{170}\end{bmatrix}
= \begin{bmatrix}{27}\\{3}\\{8}\end{bmatrix} = ADI \)
\( C^-1*P_7 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{18}\\{4}\\{19}\end{bmatrix} = \begin{bmatrix}{316}\\{218}\\{89}\end{bmatrix}
= \begin{bmatrix}{19}\\{2}\\{8}\end{bmatrix} = SCI \)
\( C^-1*P_8 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{15}\\{19}\\{22}\end{bmatrix} = \begin{bmatrix}{448}\\{335}\\{143}\end{bmatrix}
= \begin{bmatrix}{16}\\{11}\\{8}\end{bmatrix} = PLI \)
\( C^-1*P_9 = \begin{bmatrix}{13}&{11}&{2}\\{8}&{9}&{2}\\{3}&{4}&{1}\end{bmatrix}
*\begin{bmatrix}{1}\\{4}\\{5}\end{bmatrix} = \begin{bmatrix}{448}\\{335}\\{143}\end{bmatrix} =
\begin{bmatrix}{13}\\{0}\\{24}\end{bmatrix} = NAX \)

Con las nuevas matrices obtenidas se forma el texto cifrado, asignando a cada nmero la letra
correspondiente deacuerdo al Cuadro:
\( C^-1*P_1 = \begin{bmatrix}{11}\\{0}\\{0}\end{bmatrix} = LAA \)..
Asi, nuestro texto descifrado es:

LAA_UTO_NOM_IAE_SUN_ADI_SCI_PLI_NAX
LA AUTONOMA ES UNA DISCIPLINA.

También podría gustarte