COS 496: Information SecuritySpring 2000 |
General information Schedule Homework: 0 1 2 3 4 5 6 7 |
Your solution should be a zip-file containing three things: your source code (SecureConnection.java, and any other source code files you create), your compiled code (SecureConnection.class and the compiled versions of any other files you create), and a report that describes what you did and why. The report should be an HTML file named index.html. (It may contain links to other files, if you include those files in your submission.)
You must work in a group on this assignment. You may not collaborate with anyone outside your group.
Your goal in this assignment is to improve the integrity and confidentiality of the communication across the phone line. You will decide which algorithms and mechanisms to use.
You will implement your solution by modifying the file SecureConnection.java, which has been provided in the bank's software.
The basic byte stream communication functionality is implemented in the Connection class. You can read the code in Connection.java if you're interested in how it works, or you can treat it as a black box.
We have implemented another class, SecureConnection (and a helper class, AbstractSecureConnection), that provides the hooks you'll need in order to implement a secure connection. However, our implementation of SecureConnection doesn't actually do anything to protect the communication. That's up to you.
Every time an ATM is created, a pair of SecureConnection objects is created --- one SecureConnection for the ATM side, and one for the bank side. The two SecureConnection objects are hooked up with each other so that, working together, they provide a bidirectional stream.
When a pair of SecureConnection objects is created, the system will call into the new objects and tell them to do their initial cryptographic handshake. On the ATM's end, the clientSideHandshake() method is called, and on the bank's end, the serverSideHandshake() method is called. These methods are called in separate threads, so that they execute simultaneously. (At present the handshake methods don't do anything. You'll have to change that.)
In addition to the handshake, SecureConnection objects support two other methods you'll have to implement: send() and receive(). As the names suggest, send() sends a message (an array of bytes) on the SecureConnection, and receive() waits until a message arrives and then returns it. Each of these methods throws a ConnectionClosedException if it is called on a connection that has already been closed. At present, send() and receive() just call the corresponding methods of their superclass; this causes the messages to be sent in cleartext. You'll have to change that.
You have a lot of latitude in choosing which method to use.
You should make the following assumptions:
The class java.security.MessageDigest implements cryptographic hash functions.
The package javax.crypto implements several other cryptographic primitives.