JMU
Secure Programming in Java


1 Purpose

The purpose of this assignment is to allow you to demonstrate that you have begun to acquire the knowledge and skills necessary to design and construct secure programs in Java.

2 Overview

For this assignment you must modify some of the classes you have already written and create several new classes for the simple command-line gradebook system named Gradebusters (that involves many references to the movie Ghostbusters ).

The general-purpose classes you must create include the following.

  • GateKeeper - a custom java.lang.SecurityManager that only allows access to files during particular hours. (Specification)
  • KeyMaster - a utility class that contains methods for reading and writing javax.crypto.SecretKey objects to a file (using serialization). (Specification)
  • SealedGrades - a specialization of javax.crypto.SealedObject that can be used to encrypt/decrypt an ArrayList of Grade objects. (Specification)
  • The application (i.e., the class with a main() method) you must modify is the following.

  • GradeWriter - an application that accepts a a String representation of an ArrayList of Grade as a command-line argument and writes it to a file (named eid.grades). (Specification)
  • The applications (i.e., the classes with a main() method) you must create include the following.

  • KeyWriter - an application that creates a SecretKey object (e.g., using DES) and writes it to a file (named secret.key). (Specification)
  • GradeEncrypter - an application that reads a String representation of an ArrayList of Grade objects from a file, creates a SealedGrades object, and writes it to a file (named eid.sealed). (Specification)
  • GradeDecrypter - an application that reads a SealedGrades object from a file (named eid.sealed) and prints the individual Grade objects. (Specification)
  • 3 Existing Classes

    You may use the classes that you wrote for the previous assignment or you may use the solutions that were provided to you.

    You may modify any of these classes if necessary.

    4 Recommended Process

    Though you may, of course, use any process you want, I suggest that you implement and test the classes in the following order.
    1. GateKeeper.
    2. GradeWriter (that uses a GateKeeper and will require you to create an appropriate policy file).
    3. KeyMaster.
    4. KeyWriter (which will use KeyMaster).
    5. SealedGrade.
    6. GradeEncrypter (which will use KeyMaster and a file created with KeyWriter).
    7. GradeDecrypter (which will use KeyMaster and a file created with KeyWriter).

    5 A Complete Use of the System

    A user of the system will perform the following steps, once all of the components have been completed.
    1. Run KeyWriter to create an encryption key.
    2. Transport the encryption key (using a secure channel) to other users that need it.
    3. Run GradeWriter (during the appropriate hours) to save a student's grades.
    4. Run GradeReader to view a student's grades.
    5. Run GradeEncrypter to "seal" a student's grades so that they can be transported.
    6. Transport the "sealed" grades to another user.
    7. Run GradeDecrypter to see "sealed" grades.

    6 Submission

    You must submit all of your .java files and your policy file using Canvas in a single file named gradebusters.zip.

    7 Visibility

    Your deliverables may be made public (i.e., available to both other students in the course and the general population).

    Copyright 2016