In this lab, you will write a program that asks the user to enter a phrase and displays an encrypted version of the phrase.
ROT13 is a very simple type of encryption. Only alphabetic characters are modified. All other characters are left unchanged. Alphabetic characters are modified by replacing the letter with the letter 13 places forward or backward along the alphabet. For example, a is replaced with n.
An encrypted version of the previous paragraph is given below:
| EBG13 vf n irel fvzcyr glcr bs rapelcgvba. Bayl nycunorgvp punenpgref ner zbqvsvrq. Nyy bgure punenpgref ner yrsg hapunatrq. Nycunorgvp punenpgref ner zbqvsvrq ol ercynpvat gur yrggre jvgu gur yrggre 13 cynprf sbejneq be onpxjneq nybat gur nycunorg. Sbe rknzcyr, n vf ercynprq jvgu a. |
For this assignment, you should write a program that asks the user to enter a phrase. The phrase can be entered on multiple lines. The user signifies that they are done entering the phrase by entering a blank line. The program should display the ROT13 encrypted version of the phrase entered by the user.
If you are looking for some additional fun, you could add ROT5 encryption which replaces each digit with the digit 5 places to the left or right. For example, 5 becomes 0 and 2 becomes 7. Other options would be to add a graphical user interface to the program or allow the user to specify a file name and encrypt the specified file.
Here is a template file to use as a starting point for this report.
The lab report does not need to be self-contained. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.
Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor.
This laboratory assignment was developed by Dr. Chris Taylor.
| © 2001-2007 Dr. Christopher C. Taylor | Office: CC-36C | Phone: 277-7339 |