Problem Set #4
Handed out: Lecture 7
Pseudocode: 11:59pm, Lecture 8. No late days can be used for this part of the assignment.
Due: 11:59pm, Lecture 10.
Pseudocode Solutions
Check your pseudocode against ours before you finish your implementation!
Introduction
Encryption is the process of obscuring information to make it unreadable without special
knowledge. For centuries, people have devised schemes to encrypt messages — some better than
others — but the advent of the computer and the Internet revolutionized the field. These days,
it’s hard not to encounter some sort of encryption, whether you are buying something online or
logging into Athena.
A cipher is an algorithm for performing encryption (and the reverse, decryption). The original
information is called plaintext. After it is encrypted, it is called ciphertext. The ciphertext
message contains all the information of the plaintext message, but it’s not in a format readable by
a human or computer without the proper mechanism to decrypt it; it should resemble random
gibberish to those not intended to read it.
A cipher usually depends on a piece of auxiliary information, called a key. The key is
incorporated into the encryption process; the same plaintext encrypted with two different keys
should have two different ciphertexts. Without the key, it should be difficult to decrypt the
resulting ciphertext into readable plaintext.
This assignment will deal with a well-known (though not very secure) encryption method called
the Caesar cipher. In this problem set you will need to devise your own algorithms and will
practice using recursion to solve a non-trivial problem.
Caesar Cipher
In this problem set, we will examine the Caesar cipher. The basic idea in this cipher is that you
pick an integer for a key, and shift every letter of your message by the key. For example, if your
message was “hello” and your key was 2, “h” becomes “j”, “e” becomes “g”, and so on. If you’re
interested in learning more about the Caesar cipher, check out the
Wikipedia article
.
In this problem set, we will use a variant of the standard Caesar cipher where the space character
is included in the shifts: space is treated as the letter after “z”, so with a key of 2, “y” would
become ” “, “z” would become “a”, and ” ” would become “b”.