Progress pill
Symmetric Cryptography

An example: The shift cipher

Modern Cryptography Fundamentals

An example: The shift cipher

In Chapter 2, we encountered the shift cipher, which is an example of a very simple symmetric encryption scheme. Let’s look at it again here.
Suppose a dictionary D that equates all the letters of the English alphabet, in order, with the set of numbers . Assume a set of possible messages M. The shift cipher is, then, an encryption scheme defined as follows:
  • Select randomly a key out of the set of possible keys K, where K =
  • Encrypt a message M, as follows:
    • Separate into its individual letters
    • Convert each to a number according to D
    • For each ,
    • Convert each to a letter according to D
    • Then combine to yield the ciphertext
  • Decrypt a ciphertext as follows:
    • Convert each to a number according to D
    • For each ,
    • Convert each to a letter according to D
    • Then combine to yield the original message
What makes the shift cipher a symmetric encryption scheme is that the same key is used for both the encryption and the decryption process. For instance, suppose that you want to encrypt the message “DOG” using the shift cipher, and that you randomly selected "24" as a key. Encrypting the message with this key would yield “BME”. The only way to retrieve the original message is by using the same key, "24", for the decryption process.
This Shift cipher is an example of a monoalphabetic substitution cipher: an encryption scheme where the ciphertext alphabet is fixed (i.e, only one alphabet is used). Assuming that the decryption algorithm is deterministic, each symobl in the substitution ciphertext can at most pertain to one symbol in the plaintext.
Until the 1700s, many applications of encryption relied heavily on monoalphabetic substitution ciphers, though often these were much more complex than the Shift cipher. You could, for instance, randomly select a letter from the alphabet for each original text letter under the constraint that each letter occurs only once in the ciphertext alphabet. That means you would have factorial 26 possible private keys, which was huge in the precomputer age.
Note that you will come across the term cipher a lot in cryptography. Be aware that this term has various meanings. In fact, I know of at least five distinct meanings of the term within cryptography.
In some cases it refers to an encryption scheme, as it does in Shift cipher and monoalphabetic substitution cipher. However, the term can also refer specifically to the encryption algorithm, the private key, or just the ciphertext of any such encryption scheme.
Lastly, the term cipher can also refer to a core algorithm from which you can construct cryptographic schemes. These can include various encryption algorithms, but also other types of cryptographic schemes. This sense of the term becomes relevant in the context of block ciphers (see the section “Block Ciphers” below).
You may also come across the terms to encipher or to decipher. These terms are merely synonyms for encryption and decryption.
Quiz
Quiz1/5
Why is shift encryption considered symmetric encryption?