back to projects page

Project 1

Password Suggester

Concepts Covered: Review of 145 stuff, Using Command Line arguments, String Analysis and Manipulation, Password Security

Due: Thursday, January 24 at Midnight

Turn In: PWSuggest.java, README

Requirements: Your program should suggest "good" passwords based on the Strings given as command line arguments, if the password is not already "good." What makes a good password? You may think that it would be simple just to use your middle name, or your mothers maiden name, or your social security number - but all of this information is more easily accessible than you might think. The best passwords of all contain multiple words. For example, if you are a Beatles fan, you can make your password something like "letitbe" or if you are a Star Wars fan you might make it "darthvader". These are a bit better than the usual simple information listed above, but they could still be better. Lets add some numbers to them. We could simply add the date of our birthday at the end, but that's not as good as substituting numbers for some of the letters. For example, we know that '3' sort of looks like a backwards upper case 'e', so we could change "letitbe" to "l3titb3". Also, we could substitute '1' for 'i' and we get "l3t1tb3". Then - if we want to make it even more secure - we could substitute the 'T' for 't' yielding "l3T1Tb3". Now the password makes sense to us, but it would be very difficult for someone to guess it - even if they knew that you were a Beatles fan. Another substitution that is useful is to substitute single characters for multiple characters. For example, we could replace the "ade" in "darthvader" with an '8' and still have a similar password. Using other substitutions, we could end up with something like "daRThv83r" which would be a good password.

The requirements for your program are as follows :

You should use the "replace" method in the String class to replace certain letters with numbers as described by the notes. Methods that are helpful in determining if the password is already good include the String.charAt() method, and the static Character.isLetter(), Character.isDigit(), Character.isLowerCase(), and Character.isUpperCase() methods. You can read more about these methods in the Java API.

As an example, your program may look something like this when the command line arguments are "letitbe", "darthvader", and "n1rVaNa":

letitbe: A better password would be l3T1Tb3
darthvader: A better password would be daRThv8r
n1rVaNa: This is a good password

Note that depending on how you solve this problem, your suggested password may be different than mine. In addition, if you use some form of randomness, your password may be different every time.

In addition to submitting the source code, you are required to submit a README file, which is just a text file. Note that this does NOT mean that it should be a Word document, a .pdf file, or anything like that. It should be plain text. The README file should be a written report about your experience working on the project. The file should contain the following information and answers to the following questions.

Your grade will be based on the following :