Project 1: A Java binary encrypter (plus)

This is the first phase of the project for this course. This page gives a (very) brief overview of the entire project, describes in detail what you are to produce for this phase, and gives some instructions on how to manage this phase.

1. The overall project this semester

You will be writing a program that a person can use to track his or her investment portfolio. It will record not only the present state of the portfolio, but also provide research tools, automatically update the price of the stocks, keep track of profits and loss, keep track of capital gains and losses (and other tax information), draw graphs, and be extended for other purposes. Information on the users' portfolio will be stored in a secure, encrypted format.

In phase 1, you will make a first cut at the modeling of the portfolio itself, doing the encryption, and designing the user interface.

2. The portfolio model

Write a class or set of classes to model the portfolio. The obvious design would involve a class which contains a list of portfolio entries, each entry having a name of the company, a symbol, the date acquired, a basis (that is, the amount paid for the stock originally), the number of shares, and the current price per share. (Other information can be calculated from these things).

In one sense, designing and writing this class is relatively straightforward. Make sure, however, that you write it with good programming practices, with an eye towards making changes later. Make sure you use good encapsulation, and design the interface after you have read the rest of this description.

3. The encryption system

Write a module that will save the portfolio model to a file and load it from a file. Binary file I/O with objects is very easy in Java, because all one needs to do is have the object implement the Serializable interface, and then classes like ObjectOutputStream can be used.

However, this information is sensitive. Therefore, we need to encrypt it when it is stored in the file system. What you need to do is (a) serialize the object (that is, convert it to a series of bits that can be written to disk); (b) encrypt the binary form; and (c) write the encrypted binary form to disk. The reverse process would be necessary to retrieve the information.

The encryption should be based on a password. Do research on password encryption to figure out a good encryption scheme which will make the user's information secure, but also make it accessible to the user by means of the password.

4. The user interface

Provide a user interface with the following features. Where relevant, all of these should be implemented with a graphical user interface, using Java's AWT and Swing framework.

5. Mechanics

You will be working in pairs. Find a partner right away so that I can set up a group for you so that there can be filespace accessible only to your group.

Use Subversion for version control. Each partner will have a local copy checked out in their account, and the version control system will be used to collaborate and track changes.

Use JUnit for testing. I recommend that you write tests first as much as possible, as you have seen in class. Unit testing with JUnit is required. It will be part of what you turn in or demonstrate.

Some of your programming should be pair programming (two programmers, one computer, only one logged in, taking turns at the keyboard). You may with to do the entire project using pair programming, but that is not required (and it would be pretty hard to enforce if it were).

Follow Java's coding conventions as much as is reasonable, and document your code thoroughly using Javadoc compliant comments. Use Javadoc to generate documentation. Not only will this make communication between you and your partner (and future partners in future phases) easier, it is also required. It will be part of what you turn in or demonstrate.

Use Java packages to organize your classes. Don't have everything in one big directory.

DUE: Oct 5.


Thomas VanDrunen
Last modified: Mon Sep 17 11:05:42 CDT 2007