next up previous
Next: 4. Using Frequencies for Up: 3. Foundation for Cracking: Previous: 3.6 Example of Bigrams

   
3.7 Enciphering and Deciphering

What happens to the frequencies when plaintext is scrambled after applying an encryption key? Figure 17 shows the ciphertext generated by encrypting the plaintext from Figure 10 using the encryption key shown in Figure 16.


  
Figure 16: Example Encryption Key
\begin{figure}
\begin{center}\fbox{\begin{tabular}{l}
\texttt{a b c d} \\
\texttt{c b d a}
\end{tabular}}\end{center}\end{figure}


  
Figure 17: Encoded Text for Figure 10
\begin{figure}
\begin{center}\fbox{\begin{tabular}{ll}
\texttt{-a-aaa-abba-abc-a...
...dcb-db-dad-acb-aca-acac-ad-} & ciphertext
\end{tabular}}\end{center}\end{figure}

What happened to the frequencies? Inspect the unigram and bigram tables of frequency tallies in Figures 18 and 19. As expected, the tables do change. The numbers appear to change, but do they really? For instance, yes, $\mbox{\emph{freq}}_{\mbox{\scriptsize\texttt{$'$ a$'$ }}}$ changes from 20 to 12 in unigram table. However, notice that number 20 still appears, but now is $\mbox{\emph{freq}}_{\mbox{\scriptsize\texttt{$'$ c$'$ }}}$. In retrospect, this is not surprising: the encryption key maps each 'a' to 'c'. So, the old frequency of 'a' is the new frequency of 'c'. Similarly, in the bigram table, $\mbox{\emph{freq}}_{\mbox{\scriptsize\texttt{$'$ d$'$ }},\mbox{\scriptsize\texttt{$'$ a$'$ }}}$ in the plaintext table moves to $\mbox{\emph{freq}}_{\mbox{\scriptsize\texttt{$'$ a$'$ }},\mbox{\scriptsize\texttt{$'$ c$'$ }}}$ in the ciphertext table because the encryption key simultaneously maps 'd' to 'a' and 'a' to 'c'. That is, enciphering ``scrambles'' frequencies by rearranging them.

  
Figure 18: Unigram Tallies
\begin{figure}
\begin{center}
\begin{tabular}{\vert ccccc\vert}
\multicolumn{5}{...
...tt{d} \\ \hline
17& 12& 8& 20& 7 \\ \hline
\end{tabular}\end{center}\end{figure}


  
Figure 19: Bigram Tallies
\begin{figure}
\begin{center}
\begin{tabular}{\vert c\vert ccccc\vert}
\multicol...
...
\texttt{d} & 4 & 1 & 1 & 1 & 0 \\ \hline
\end{tabular}\end{center}\end{figure}

Decryption maps the ciphertext back to plaintext, restoring the frequencies back to their positions in the original table. Thus, decryption not only ``unscrambles text'', but also ``unscrambles frequencies''.


next up previous
Next: 4. Using Frequencies for Up: 3. Foundation for Cracking: Previous: 3.6 Example of Bigrams
Thomas Yan
2000-05-01