{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# project05 - CSE 231 Fall 2007 Programming Project 05...

This preview shows pages 1–2. Sign up to view the full content.

CSE 231, Fall 2007 Programming Project 05 Assignment Overview This assignment is worth 40 points (4.0% of the course grade) and must be completed and turned in before 11:59pm on Monday, October 7, 2007 . The purpose of this project is to familiarize you with the use of lists and looping. For this assignment, you will create a decryption program. Background The Caesar cipher is named after Julius Caesar who used this type of encryption to keep his military communications secret. A Caesar cipher replaces each plain-text letter with one that is a fixed number of places down the alphabet. The plain-text is your original message; the cipher-text is the encrypted message. The example shown below is a shift of three so that “B” in the plain-text becomes “E” in the cipher-text, a “C” becomes “F”, and so on. The mapping wraps around so that “X” maps to “A” and so on. Here is the complete mapping for a shift of three: Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC To encrypt a message simply substitute the plain-text letters with the corresponding cipher-text letter. For example, here is an encryption of “the quick brown fox jumps over the lazy dog” using our shift-three cipher (case is ignored): Plaintext: the quick brown fox jumps over the lazy dog Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ To decrypt the message simply reverse the process. The encryption can also be represented using modular arithmetic after first transforming the letters into numbers according to the scheme: A = 0, B = 1, etc. (which is the index of the alphabet if it is in a string or a list). A shift-three cipher will take the number of each letter ( plainTextChar ), add 3 (the shift), and then find the remainder after dividing by 26 to get the cipherText:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern