This page contains all the necessary information to implement the course assignment. There is quite a lot of text, but please read through the page before starting the assignment to avoid common pitfalls. If you get stuck with the assignment, we welcome questions to the course e-mail address, but please read this page and the Assignment FAQ before sending e-mail.
The cryptosystems course assignment consists of two almost independent parts: (1) a simplified crypto library, and (2) a simplified TLS 1.0 (SSL 3.1) client which uses the crypto library for cryptographic operations
The assignment structure mimics the way real world cryptographic software is written: one typically uses an existing crypto library which provides basic crypto computation primitives. Cryptographic primitives need to be fast, secure, and small, which makes their implementation difficult and worth making into a shared library
The simplified crypto library used in the assignment is structured as follows. The crypto.CryptoUtil class provides static methods for creating instances of various cryptographic primitives. The Java interface definitions for these primitives is given in crypto.interfaces.*. When creating an instance of a cryptographic primitive, the CryptoUtil class attempts to use your implementation first if it exists (in crypto.implementations.*); if not, it uses the reference implementation (in crypto.reference.*) instead. By removing the class files of your implementations (which are initially non-working) you can make the crypto library fall back to the working reference implementations. For (almost) every primitive there is a corresponding test class (in crypto.tests) which tests the current implementation and provides some feedback of the module test that fails in case the primitive seems faulty.
As the course progresses, you're asked to implement various primitives as weekly assignments. If you fail to implement some primitives, you can use the reference implementations for those primitives you failed to implement and move on (simply remove the .class file of your implementation and ensure that the corresponding .class file of the reference implementation is intact; CryptoUtil will then use the reference automatically). The test classes (test vectors) should help you implement and test each primitive at a time. However, after implementing a primitive, you should also run the HTTPS client (see below) to ensure that your newly implemented primitive also works in the full application and not just the test classes.
Note that debugging faulty cryptographic primitives can be a very time consuming effort. If a primitive does not work, it is often difficult to figure out why: the result is simply incorrect but it's difficult to see where something went wrong inside your code.
The second part of the assignment is a simplified HTTPS (HTTP-over-TLS) client, i.e. a client program which retrieves a web page from a web server and uses TLS 1.0 (SSL 3.1) to encrypt traffic. The client uses our simplified cryptographic library for all cryptographic computation and interoperates with an actual HTTPS server. The main "driver" class of the client is tlsclient.HttpsClient, which uses the CryptoUtil class for crypto computations. TLS related functionality is implemented in other classes in the tlsclient package.
However, the HTTPS client is missing some TLS-specific cryptographic parts. First, it's missing some TLS specific cryptographic primitives, that will be implemented as part of our crypto library. Second, it's missing some protocol specific cryptographic logic, in particular, handling of signature verification, certificate trust, and some handshake verification values. The HTTPS client works even without these bits but is susceptible to man-in-the-middle attacks because no actual trust is achieved for the server end. In the last assignments you are asked to complete some of this functionality to provide some trust in the server.
To help with the assignment, you should get acquainted with the TLS protocol (specified in RFC 2246); the specification will be covered in the lectures, but be prepared to peek into the specification for details. Although the framework contains large portions of the TLS protocol data manipulation code, it doesn't hurt to read through the specification (and the code), at least once.
The client implementation is very minimal. The intent is to have a client that will interoperate with a TLS 1.0 compliant server, without implementing all required features of RFC 2246. The client is incomplete in at least the following ways:
Even with these limitations, the client is a useful example of a real world cryptosystem implementation.
Each weekly exercise is returned by emailing a complete copy of the project files in a single zip file named deliverable-x-your_student_id.zip (i.e. first return would be deliverable-1-12345A.zip, second deliverable-2-12345A.zip etc) to the t-110.5210@tml.hut.fi with the subject "T-110.5210 exercise deliverable". You can leave the message body empty. You should get an acknowledgment from course staff; if you do not get one in a couple of days, get in touch.
Deliverables are processed semi-automatically, so please make sure that you follow the correct naming scheme and send the entire content of the crypto2008 directory with your deliverable. You should also make sure that your deliverable does not contain any extra files from for example from Java IDE you may use as we have limited space in our email inboxes.
Here is an example on how to create your deliverable .zip file:
$ unzip -t deliverable-1-12345A.zip Archive: deliverable-1-12345A.zip testing: crypto2008/ OK testing: crypto2008/tlsclient/ OK testing: crypto2008/tlsclient/HttpsClient.java OK testing: crypto2008/tlsclient/TlsConnectionState.java OK [...] No errors detected in compressed data of deliverable-1-12345A.zip.
Weekly exercises are individual. You can discuss the problems together with your friends (and we encourage this), but everyone must write their code on their own. If you have difficulties, you can ask the course staff for help after the lectures, or send e-mail to t-110.5210@tml.hut.fi.
Each deliverable is graded pass/fail. The grade of the whole assignment is then determined by the number of passed deliverables according to following table:
You can get help on the course assignment through the course e-mail. Before sending e-mail, please check the following: