COP 4610L (Spring 2004)
Operating Systems Lab (Distributed Applications in the Enterprise)
Dr. R. Lent

Programming Assignment 5

DUE: Friday, April 16, 8:00 PM

Your goal is to develop an RMI system (client and server) to implement an encryption and decryption service of documents via symmetric cryptography. In turn, client and server will use SSL to communicate (asymmetric cryptography).

The system is expected to work in the following way:

A user will execute the client program and will pass a document through its standard input. This document may contain either plaintext or ciphertext. The program will accept two arguments that will select the operation mode: "enc" or "dec" (encryption or decryption) and the password. For example:

  • type document.plain | java client enc mykey > document.secret
  • type document.secret | java client dec mykey > document.plain

    The client program will then invoke a remote method which will reside in the server. The method will receive the document, the operation mode, and the key, and it will compute and return either plain text of cipher text depending on the requested operation.

    Finally, the resulting text will be sent through the standard output of the client

    Steps to complete:

    0. Study the programs LectureSet6/jce-symmetric/Encipher.java, LectureSet6/jce-symmetric/Decipher.java, and those under directory example5-ssl/ (file: LectureSet7/rmi-examples.tar). Once you understand them, you will need to merge them to solve this assignment.

    Client side:

    1. (20pt) Create the client program and define the two arguments that it will accept. Read the standard input and then invoke the remote method in the server with all these three parameters. Then print the resulting text.

    Server side:

    2. (15pt) Create remote interface EncDecInterface and define method getEncDec(byte[] document, String mode, String password).

    3. (20pt) Create class EncDecImpl with an implementation of the remote interface. Use the encryption and decryption algorithms as in the example under the "jce-symmetric" directory (set 6). Return the resulting bytes to the client.

    Both sides:

    4. (15pt) Define security policies for server, and client

    5. (20pt) Create the keys and use SSL to encrypt the communication between client and server (see the example)

    6. (10pt) Put all the commands needed to run you program in batch files (3 files: one for the client, one for the server, and one to activate rmiregistry)

    Software

    JDK 1.4.x, an IDE

    Instructions and comments

    1. Insert appropriate comments to facilitate the grading of your work. You may attach an extra text file explaining your program.

    2. Pack (zip, rar, tar) your source files and submit your assignment before the due time/date via WebCT. Separate client and server files in different directories (include the batch files that are needed both to run the server and client in the appropriate directory).