Assignment 25685

Cryptography refers to the use of encryption (or encoder) to convert plain text
information into unintelligible gibberish (cipher text) for security purposes. A
corresponding decryption algorithm (or decoder) will convert the cipher text back to
the plain text with the correct decryption key.

In cryptography, a Caesar cipher, also known as Caesar’s cipher, the shift cipher,
Caesar’s code or Caesar shift, is one of the simplest and most widely known
encryption techniques. It is a type of substitution cipher in which each letter in the
plaintext is replaced by a letter some fixed number of positions down the alphabet.
For example, with a left shift of 3, D would be replaced by A, E would become B, and
so on. The method is named after Julius Caesar, who used it in his private
correspondence. The decoder in this case will be shifting each letter 3 position to the
left, that is, replacing a, b, c, …, x,y,z in the cipher text by x, y, z, a, …, v, w,
In this project, you will implement the basic cryptography procedures for shift cipher.
You need to write a single program to perform these two basic cryptography
(1) encodes/encrypts “input” file with key and write cipher text to “output” file.
(2) decodes/decrypt “input” file with key and write plain text to “output” file.
Both plain text and cipher text will consist of characters from the following 72-letter

0-25: lower case letters a-z
26-51: upper case letters A-Z
52-61: digits 0-9
62-71: 10
punctuations ; : , . “ ” ( ) n (new line) and (single space)
The input file will be the plain text when user want to encrypt, and will be the cipher
text when user to decrypt. The output file will be the corresponding cipher text in the
encrypt case and plain text in the decrypt case.

Must Consider while coding:
ï‚· How to use the shift factor

ï‚· How to wrap from last character to first character. We assume that the 72-
letter alphabet is circular, in the sense that character with index 0 will follow the
character with the largest index 71

ï‚· How to keep the same case