| Project #1 | CMSC 131 |
| Tuesday, September 9/25 before 11:00PM | Object-Oriented Programming I |
| Type of project: OPEN | Fall 2012 |
Cryptography Quiz
Objective
This project will allow you to practice variables, strings, input/output facilities, conditional statements, logical operators, and the Eclipse IDE.
Overview
You will write a very simple application that asks the user to identify how many BITs are on used in certain cryptographic systems or asks the user to identify which kind of cryptographic system uses a certain number of bits for their keys. For this project, we will assume the following information: Skipjack uses 80 BITs, Rijndael uses 128 BITs, TripleDES uses 168 BITs, and RSA uses 768 BITs. It's not necessarily the most exciting project, but it's a good place to start doing some more involved coding. Also, if you are curious about cryptography, key-lengths and different algorithms are a place to start exploring (just don't use what you might learn to argue the above assumptions about key lengths).
This project is considered "open". Please visit the course web page for information regarding the open/closed policy for projects of this course.
Specifications
The program begins by prompting the user with:
Enter 1 to guess a cryptographic system, 2 to guess how many BITs:
The user then enters either "1" or "2".
Processing a choise of "1"
The program prompts the user with:
Choose number of BITs:
The user must enter either "80", "128", "168", or "768". If any other number is entered, the program will print out "Invalid choice." and will terminate with no further input or output.
Assuming that the user has entered one of the four valid numbers, the program prompts the user with:
Which cryptographic system uses n BITs?
[In the prompt above, the n must actually be either "80", "128", "168", or "768" depending on what the user has selected, and appears as regular text rather than bold and italicized.]
The user will enter a String. If the String entered represents the correct cryptographic system for the number of BITs selected, the program will output "Correct!" and then terminate normally. However, if the user has entered the incorrect String, then the program will output "Incorrect!" and then terminate normally.
Processing an Entry of "2"
The program prompts the user with:
Choose a cryptographic system:
The user must enter either "Skipjack", "Rijndael", "TripleDES" or "RSA". If any other String is entered, the program will print out "Invalid choice." and will terminate with no further input or output.
Assuming that the user has entered one of the four valid cryptographic systems, the program prompts the user with:
How many bits used in a CRYPT system?
[In the prompt above, CRYPT must actually be either "Skipjack", "Rijndael", "TripleDES" or "RSA". depending on what the user has selected, and appears as regular text rather than bold and italicized.]
The user will enter a number. If the value entered represents the correct number of BITs for the cryptographic system selected, the program will output "Correct!" and then terminate normally. Howewver, if the user has entered the incorrect value, then the program will output "Incorrect!" and then terminate normally.
Getting Started
In order to help you get started, we have defined a CryptoQuiz class with a main( ) method in a file named CryptoQuiz.java. This file can be retrieved by checking out the project from the CVS repository. Remember that you must have set up your repository in order to check out and submit projects. Start by going to your CVS repository and checking out project Fall2012Proj1. After checking out the project, when you switch back to the Java perspective, you will see the above files in the "Package Explorer" window, and you will be able to start modifying them.
If you write the project from scratch, without checking out the "Fall2012Proj1" files from your CVS repository, you will NOT be able to submit your work and you will NOT get credit for it.
Requirements
The following examples show how your program should behave. Note that items in italics represent the things that are entered by the user. Keep in mind these are just examples and NOT the only scenarios that your program is expected to handle. You should test many different input scenarios.
Example 1
Enter 1 to guess a cryptographic system, 2 to guess how many BITs: 1
Choose number of BITs: 3
Invalid choice.
Example 2
Enter 1 to guess a cryptographic system, 2 to guess how many BITs: 1
Choose number of BITs: 80
Which cryptographic system uses 80 BITs? Rijndael
Incorrect!
Example 3
Enter 1 to guess a cryptographic system, 2 to guess how many BITs: 1
Choose number of BITs: 128
Which cryptographic system uses 128 BITs? Rijndael
Correct!
Submission
Submit your project from Eclipse by right-clicking the project folder and selecting "submit". You may submit as many times as you want -- we we only grade your most recent submission. After you have submitted your project, you should visit the submit server. There you can obtain limited feedback about how well your project is performing. (Choose "release test" to see detailed information.) The number of times you can run our tests on your project (before the due date) is limited. The earlier you begin working on the project, the more opportunities you will have to see how your project performs on our tests before the due date!
Grading
There are four public and three release tests which will be run on your project. Please note that some of the release tests will test multiple scenarios. Together, these tests will determine 90% of the grade on the project. The remaining 10% will be based on your use of correct programming style.