next up previous
Next: 2.6 Decryption Key Up: 2. Background: Encryption and Previous: 2.4 Substitution Ciphers

2.5 Encryption Key

Sometimes we might say encipher or encode instead of encrypt. A cipher uses an encryption key to encode text. So, applying the encryption key to text encrypts, or ``hides'', that text. Represent an encryption key by writing two lines:

1.
On the top line, write the character set.
2.
On the bottom line, write the conversion for each character.

Figure 1 shows the encryption key for the famous substitution cipher called the Caesar cipher, which Julius Caesar supposedly used. The Caesar cipher simultaneously renames each letter with the letter 3 positions ``down'' in the alphabet and ``wraps around'' back to 'a' after the letter 'z'.


  
Figure 1: Encryption Key for Caesar Cipher
\begin{figure}
\begin{center}\fbox{\texttt{\begin{tabular}{*{26}{@{$\,$ }c}l}
a&...
...encoding of each letter of the alphabet}
\end{tabular}}}\end{center}\end{figure}

An encryption key renames each character on the first row to the character just below on the second row. Using mapping notation, you may express the encryption key in Figure 1 as 'a' $\rightarrow$'d', 'b' $\rightarrow$'e', ..., 'w' $\rightarrow$'z', 'x' $\rightarrow$'a', 'y' $\rightarrow$'b', and 'z' $\rightarrow$'c', where each character is used exactly once on the top and exactly once on the bottom.

How do you encipher a message using an encryption key? Call the unencrypted message plaintext and the encrypted message ciphertext. Figure 2 places the plaintext on the top line above the ciphertext on the bottom line. Observe that each plaintext letter is replaced by the appropriate character from the encryption key for the Caesar cipher. For example, 'w' $\rightarrow$'z', 'e' $\rightarrow$'h', the space maps to a space, 'a' $\rightarrow$'d', 'p' $\rightarrow$'s', and so forth. In both Figures 1 and 2, the bottom line is the encoded version of the top line. (But, see also Figures 6-8.)

  
Figure 2: Encryption Example Using the Caesar Cipher
\begin{figure}
\begin{center}\fbox{\texttt{
\begin{tabular}{*{34}{@{$\,$ }c}l}
w...
...&
{\rm bottom line: encoded ciphertext}
\end{tabular}}}\end{center}\end{figure}

Note that the encryption key does not require the top line to be sorted. See Figure 3 for an equivalent representation of the Caesar cipher. Once more, each line uses each character from the character set exactly once.


  
Figure 3: Equivalent Encryption Key for the Caesar Cipher
\begin{figure}
\begin{center}\fbox{\texttt{
\begin{tabular}{*{26}{@{$\,$ }c}l}
a...
...bottom line: encoding of each character}
\end{tabular}}}\end{center}\end{figure}


next up previous
Next: 2.6 Decryption Key Up: 2. Background: Encryption and Previous: 2.4 Substitution Ciphers
Thomas Yan
2000-05-01