Assignment 5

In this assignment we are going to create a small application dealing with passwords. It is not unusual to find web sites that want us to create accounts with user IDs and passwords. It can be difficult to remember all the passwords.

This should be a form application, and you can design most of it for yourself. You can use buttons, radio buttons, text boxes, list boxes, labels, etc.


The password manager itself will require the user to supply a master password to start it. The value of the master password should be stored in a setup file. It should be encrypted in some fashion.

The data we are storing consists of strings. We have the name of a web site, the ID value for the account on that site, and the password. These should be kept in a second file. The passwords should be encrypted in some fashion.

When the password manager starts, it should read the setup file. If the master password is provided correctly, the next thing to do is read the second file and put the data in a list. Don't forget to close both files.

We want to provide options for the user:

Whenever we enter a password, we want the characters that are typed to be hidden from view. The user types "Password12", but "**********" appears in the textBox. You can do this using the PasswordChar property of the TextBox control.

When the user looks up the ID and password, you can display the ID in plain text, but the password should still be protected; the user can click on an additional button to reveal it for some short period of time such as 10 seconds. (You may need the Timer class or maybe the StopWatch class.)


Other notes

Pick a foreground color and a background color for your form, and also choose at least one font and font size. (There is no obligation to use the default.)

The simplest way to encrypt the data is to use XOR encryption. This involves the ^ operator. The C# language has other facilities for encryption and decryption as well.

If there have been any "add data" or "modify data" operations, you need to write out the contents of the array (or List) into the file before exiting.

What requirements should we have for passwords? Let's say a password should be at least 8 characters long and should contain uppercase letters, lowercase letters and digits. You may need to use static methods of the Char class called IsUpper, IsLower and IsDigit. When someone tries to add a password, check it to see if it is acceptable. If it is not acceptable, notify the user to try again.

If you display the site names in a ListBox, the user can select one and the ListBox's SelectedItem property will return the selected site name. You may want to read about SelectedItem.

Invent your own data. When you turn it in, there should be data for at least 3 entries in the array (or List).

You should turn this in via Blackboard as usual. The TA will need to know the master password in order to run it.