CMSC414 Project 2 Information


  • Overview
  • In this project, you are asked to perform various attacks on variations of the Needham-Schroeder handshake protocol. Instead of running the handshake over the network, we simulate it using java classes. This is to simplify the assignment.

    There are three java classes Client, Server, and KDC simulating the functions of three different machines on the network. These classes communicate using the methods provided by the Router class. Normally, this class simply forwards all messages to the requested parties.

    However, you have taken control of this router and plan to exploit the weaknesses of the handshake protocols to find out a secret which is available only to the client or the server. This secret message is stored as a private variable in that class.
  • Source Code
    You are given source code for four implementations of Needham-Schroeder handshake protocol which are named from handshake1 to handshake4. They differ in terms of messages sending back and forth, and the number of messages. For each handshake, there are 5 java classes:
    The source code will be provided:

    Note: You do have to read the source code in order to solve the problems, but not for all the different handshakes. Use the diff command and only look at the differences. For example, handshake3 and handshake4 are completely identical except for their package names.
  • Simulation Platform
  • All simulations are performed on the GRACE linux servers (e.g. linux.grace.umd.edu). The following command should be used for all the tasks:
    /:/class/fall2007/cmsc/414/0101/public/p2tester <command>
    Run the script to get a list of valid commands along with their meanings. Here is a more detailed description of each command and their syntax:

    command :

  • What You Need to Do
  • Your job is to modify the given Router class and try to figure out the secret held by one party. Since all messages go through Router, you can obtain all of them. Of course, they are encrypted. You need to exploit the weakness of the protocol to obtain the secret.

    This project is "self-graded". Consider task 1, for example. When you execute "p2tester run 1 path-to-your-Router.java" for task 1 without making any changes to the Router class, the following happens: a Router instance is created; the Router instance creates Client, Server, and KDC instances, and starts the Client instance running; the Client instance does a handshake with the KDC and then a handshake with the Server.

    Solving task 1 involves the following kinds of steps:

  • Can I read the secret message from the bytecode?
  • No, your Router class is only allowed to interact with the other classes using their public methods and variables. In reality, these are on different machines on the network and you only have remote access to them.
  • What's a "task", what's a "handshake"?
  • They both refer to the same thing in this project. Task 1 is performed on the source code available as handshake1, task 2 on handshake2, and so on.
  • How does the PKCS#5 padding work?
  • Depending on the length of the original message, between one to eight bytes are added to the end of the message to make the length a multiple of 8. The contents of the padding bytes will be the same as the number of bytes being added. For example, to pad a 16 byte message, 8 bytes containing the number 8 will be used.
  • How can I print the contents of an array?
  • Do not use the array's toString method. That method only outputs the object's memory address. To print the array contents, the java.util.Arrays.toString method can be used.
  • What command is used to execute my Router class?
  •           tap java150

    java handshakeX.Router
    
    You can run this on your own machine to check whether your Router can successfully steal the secret. Here are examples of party name, password and secret message you can use to replace the "$PASS_x" and "$MSG_x".
  • Submission
  • The project is "self-graded" (see What You Need to Do). The clock on linux.grace.umd.edu is the one used to determine your submission time. You receive full credit for the tasks of the project completed before the deadline.