T-110.5211 Cryptosystems (4 cr)

Assignment schedule


Deliverable Date Description Deadline
1 25.9.08

Implementation of Vigenere

  • Implementation is done in crypto2008/crypto/implementations/Vigerene.java
  • Testing can be done by running java crypto/tests/Vigenere under crypto2008 directory

Implementation of generalized CBC

  • Implementation is done in crypto2008/crypto/implementations/GenericCbc.java
  • Testing can be done by running java crypto/tests/TripleDesCbc under crypto2008 directory. If TripleDesCbc test passes the GenericCbc must work as it uses the GenericCbc.

8.10.08

2 2.10.08

3DES (EDE) in CBC mode, given DES ECB primitive

  • Implementation is done in crypto2008/crypto/implementations/TripleDesEcb.java
  • Testing can be done by running java crypto/tests/TripleDesCbc under crypto2008 directory
HMAC (using MD5 and SHA1).
  • Implementation is done in crypto2008/crypto/implementations/Hmac.java
  • Testing can be done by running java crypto/tests/Hmac under crypto2008 directory

15.10.08

3

9.10.08

Modular exponentiation

  • Implementation is done in crypto2008/crypto/implementations/ModExp.java
  • Testing can be done by running java crypto/tests/ModExp under crypto2008 directory

Diffie-Hellman computations using big integers

  • Implementation is done in crypto2008/crypto/implementations/DiffieHellman.java
  • Testing can be done by running the TLS client java tlsclient/HttpsClient www.tml.hut.fi 443 /index.html testpage.out under crypto2008 directory

RSA decrypt and padding check

  • Implementation is done in crypto2008/crypto/implementations/TlsRsa.java
  • Testing can be done by running java crypto/tests/TlsRsa under crypto2008 directory

22.10.08

4 16.10.08

TLS P_hash, TLS PRF_hash

  • Implementation is done in:
    • crypto2008/crypto/implementations/TlsP.java
    • crypto2008/crypto/implementations/TlsPrf.java
  • Testing can be done by running:
    • java crypto/tests/TlsP under crypto2008 directory
    • java crypto/tests/TlsPrf under crypto2008 directory

12.11.08

5 23.10.08 Certificate handling and verification

This deliverable consists of two parts:

  • CertificateManager
  • changes to tlsclient.HttpsClient to use the CertificateManager in establishing TLS connections.
The second part (modifications to HttpsClient) doesn't have a tester module; we'll review each implementation to see that it fulfills requirements below.

See "FIXME" strings in tlsclient/HttpsClient.java for places in the code where changes are required.

The requirements for HttpsClient modifications are:

  • 1. The implementation must process the server certificate chain and determine which certificate contains the relevant server certificate, i.e., the certificate used for server's signature value.
  • 2. The implementation must verify that the user trusts the certificate in question. The user must be prompted if the user hasn't previously accepted the certificate in question. If the user decides to trust the certificate, the certificate must be added to the set of trusted certificates (using CertificateManager). If the certificate hasn't been previously accepted and user doesn't want to trust it (in the prompt), an Exception must be raised, terminating the TLS connection.
  • 3. When prompting the user, the implementation must show enough relevant information to the user, at least:
    • Certificate MD5 (or SHA1) hash (MD5 (or SHA1) hash of X.509 DER data)
    • Certificate subject
    • Certificate issuer
    • Certificate validity period
  • 4. The validity of the certificate must be checked. Here you only need to check that the certificate is valid with respect to its validity period (the notBefore and notAfter fields of the X.509 certificate). Real certificates may have X.509 extensions prohibiting their use in the TLS context; you can ignore these.
  • 5. The RSA signature from the server must be checked and connection terminated (by throwing an Exception) if signature fails. The TlsRsa primitive should be used for this. You need to compute the "expected" value for the TlsRsa primitive before invoking the primitive.
  • Implementation is done in:
    • crypto2008/crypto/implementations/CertificateManager.java
    • crypto2008/tlsclient/HttpsClient.java
  • Testing can be done by:
    • running java crypto/tests/CertificateManager under crypto2008 directory
    • running the TLS client java tlsclient/HttpsClient www.tml.hut.fi 443 /index.html testpage.out under crypto2008 directory

26.11.08

Extra 1  

Implement MD5

  • Implementation is done in crypto2008/crypto/implementations/Md5.java
  • You must not use existing Java MD5 code (such as MessageDigest class); the implementation must be "from scratch"
  • Testing can be done by running java crypto/tests/Md5 under crypto2008 directory.

3.12.08

Extra 2  

Implement SHA1

  • Implementation is done in crypto2008/crypto/implementations/Sha1.java
  • You must not use existing Java SHA1 code (such as MessageDigest class); the implementation must be "from scratch"
  • Testing can be done by running java crypto/tests/Sha1 under crypto2008 directory.

3.12.08

Extra 3  

Implement DES

  • Implementation is done in crypto2008/crypto/implementations/SingleDesEcb.java
  • Testing can be done by running java crypto/tests/SingleDesEcb under crypto2008 directory.

Document that contains test vectors for DES rounds (in PDF page 134).

 

3.12.08