T. Andrew Yang

Tel.: (281) 283-3835
last updated: 8/05

Computer Security

Fall 2005


Assignment 1
Assignment 2
Assignment 3
Projects
  • Assignments
Assignment 1

1.A  (20 pts, 5 pts each) Visit relevant web sites to find a specific example for each of the following types of attacks.  Explain how the specific attack worked, when the attack was launched, and by whom (if known).
    (a) Internet worm   (b) logic bomb  (c) denial of service (DOS)  (d) distributed DOS

1.B (10 pts) Visit the discussion group at http://groups.yahoo.com/group/ComputerSecurityFall05/ and join the group as a member.  Throughout this class, you shall regularly visit the discussion group to find recent announcements, reminders, and discussions.  Print out the confirmation message in response to your membership request, and hand it in as part of this assignment.

1.C Non-repudiation
    i. (5 pts) Explain what non-repudiability means.
    ii. (5 pts) Give one example of non-repudiability in an example computer application.

1.D Java Cryptography
If you have not done so, you may want to download the most recent Java Development Kit (JDK, 1.4.2) from http://java.sun.com/j2se/1.4.2/download.html. Visit the information & resources links at the beginning of the syllabus page, and become familiar with JCE security providers and the unlimited strength Java security policy. Please note that the instructions given in the document Installation of JCE security provider for unlimited strength security
have been rigorously tested and, if followed correctly, should enable your Java environment to run all the sample programs that come with the 'Java Security' book. If you run into problems, double check and make sure you have correctly completed the required steps.

    Note: Sample programs from the book are available on line at http://sce.uhcl.edu/yang/teaching/proJavaSecurityCode.html. A zip file is available at the top of that page for you download all the programs.

After you have properly configured your Java environment, perform the following tasks:

    1. (10 pts) Test the BlowfishExample.java program (from chapter 4 of the Garms and Somerfield book). Add a printline statement at the beginning of the program to print your name as part of the program's output. Run the program using sample data of your choice. Hand in the screen output from the program.
    2. (10 pts) Test the PBE.java program (from chapter 4 of the Garms and Somerfield book). Add a printline statement at the beginning of the program to print your name as part of the program's output. Run the program using sample data of your choice. Hand in the screen output from the program.
    3. (10 pts) Test the FileEncryptor.java program (from chapter 4 of the Garms and Somerfield book). Add a printline statement at the beginning of the program to print your name as part of the program's output. Run the program using sample data of your choice. Hand in the screen output from the program.
    4. (10 pts) Test the FileEncryptorRSA.java program (from chapter 5 of the Garms and Somerfield book). Add a printline statement at the beginning of the program to print your name as part of the program's output. Run the program using sample data of your choice. Hand in the screen output from the program.

Assignment 2
2.A  (15 pts) Using the Extended Euclidean Algorithm, find x and y such that 17 x + 23 y = 1.
2.B  (15 pts) Given an equation  ax + by = 1, in order for the values of x and y to exist and be unique, the gcd of a and b must be 1. That is, if the constraint is not satisfied (gcd(a,b) <> 1), there may exist multiple pairs of different values of x and y. Find one example to illustrate this constraint. That is, find a pair of (a, b) and at least two instances of (x, y) that satisfy the equation ax + by = 1.
2.C  (15 pts) Solve 23x mod 60 = 1.
2.D  (15 pts) Solve 46x mod 80 = 2.
2.E  (10 pts) Exercise 16 (p.242) of the Bishop book.
2.F  (10 pts) Exercise 17 (p.243) of the Bishop book.

Assignment 3

3.A On page 252 of the Bishop book, a variation of man-in-the-middle attack in the context of public key cryptography is discussed, in which the hacker Eve successfully steals a session key trasmitted from Alice to Bob. Examine the attack scenario and answer the following questions:

    1. (5 pts) What is the source of the problem? That is, why would the attack succeed?
    2. (10 pts) Explain how the problem may be mitigated? Justify your answer.

3.B The questions below are based on the 'signature chain' discussion on page 258 of the Bishop book. Suppose that X<<Y>> represents the certificate that X generated for the subject Y (X is the CA that issued the certificate). Further suppose A and X are two CAs that certify each other; that is, X has the certificate A <<X>> and A has the certificate X<<A>>. It is assumed that a subject always has the public key of its CA.

    1. (5 pts) Suppose A has generated a certificate for B, and B has generated a certificate for C. How does C's certificate look like?
    2. (5 pts) If X has generated a certificate for Y, and Y has generated a certificate for Z. How does Z's certificate look like?
    3. (5 pts) When C sends its certificate to X, how would X verify the certificate?
    4. (10 pts) Suppose cross-certification is not used in the system. How can the certificates be verified? Devise a new scheme and explain how A and X would be able to verify certificates generated by each other using the new scheme (that is, without using cross-certification).
3.C El Gamal digital signature is similar to Diffie-Hellman, in the sense that both rely on the difficulty of solving the discrete logarithm problem. You may refer to pp. 269-270 for discussions of the El Gamal protocol.
Below is a summary of the El Gamal algorithm:
  1. (To generate a signature) First choose a prime p and two random numbers g and d, both less than p. Note: The chosen d is the private key.
  2. Then compute y = gd mod p.
  3. Choose a number k that is relatively-prime to p-1. Compute the value of a as a = gk mod p. Note: Correction of an error on page 269.
  4. Suppose m is the message (e.g., a signed contract) that the user wants to send. Solve the equation m = (da + kb) mod (p-1) to determine the value of b.
  1. Rearrange the equation m = (da + kb) mod (p-1) to kb mod (p-1) = m - da mod (p-1) <equation b>.
  2. Before solving equation b, first try to use the Extended Euclidean Algorithm discussed in Chapter 31 to solve kx mod (p-1) = 1     <equation x>.
  3. Let n be m - da mod (p-1). Then equation b becomes kb mod (p-1) = n     <equation b'>.
  4. By multiplying both sides of equation y by the value of n, we get  (kx mod (p-1))* n) = n     <equation x'>.
  5. From equation b' and equation x', we get  kb mod (p-1) =  (kx mod (p-1))* n. That is,  b = (nx) mod (p-1).
  1. The public key is the triplet (y, g, p). The private key is d. The signature is the pair (a, b).
  2. The sender then sends the message (m), and the signature (a, b) to the receiver.
  3. (To verify the signature) Given the public key (y, g, p), the message (m), and the signature (a, b), the receiver verifies the signature by checking the following equation: yaab mod p = gm mod p.

Answer the following questions based on the above algorithm:

    1. (10 pts) Check the example given on pp.269-270. Show the values of x and n. In this example, what are the values of the public key, the private key, the message, and the signature?
    2. (5 pts) Suppose the user chooses p = 17, g = 9, and d = 11. Show the values of the public key, and the private key.
    3. (5 pts, continued from #2) Let k = 7. Compute the value of a.
    4. (5 pts, continued from above) Suppose m is the message that the user wants to send, and its value is 10. What is the value of x? What is the value of n?
    5. (5 pts, continued from above) What is the value of b?
    6. (5 pts, continued from above) What would be sent to the receiver?
    7. (5 pts, continued from above) How would the receiver verify the received message and signature? Show the value of  yaab mod p and that of gm mod p.

Go to the Index



Projects
  • Project 1
    • Project description
The purpose of this project is to build a client/server application which uses asymmetric encryption (i.e., public key cryptography) to exchange a symmetric key. The application will be used as a base for the later projects. The communication between the client and the server is to be implemented as sockets.
    • Requirements
      • The client side:
      1. The client reads the server's public key (Server-public) from the socket.
      2. The client application also generates a 256-bit AES (i.e., Rijndael) key (k).
      3. It then takes a plaintext message (m) from the user, encrypt the message using the AES key, resulting in a ciphertext (c). The plaintext message should be printed as part of the screen output of the client side.
      4. The client then encrypts the AES key using the server's public key (Server-public), resulting in an encrypted symmetric key (ek).
      5. It then sends the ciphertext (c) and the encrypted AES key (ek) over the socket to the server.
      • The server side:
      1. The server generates an RSA key pair (Server-public, Server-private). Note: This can be done using keytool or by a program (as done in FileEncryptorRSA.java, chapter 5 of the Java Security book).
      2. The server then sends its public key (Server-public) to the client.
      3. The server reads the ciphertext (c) and the encrypted AES key (ek) from the socket.
      4. It then decrypts ek using its own private key to get the AES key (k).
      5. Using k, it then decrypts the ciphertext. The decrypted message (dm) should be printed as part of the screen output.
  • Preliminary Report ( to be handed in as hardcopies)
  1. Use UML to define class diagrams for CLIENT, SERVER, and any other necessary classes. Clearly identify the attributes and methods defined in each of the classes, and the associations among the classes.
  2. For each of the methods, briefly explain its functionality and clearly indicate its parameters (if any) and returned data type.
  • Final Report ( to be submitted electronically to yang@uhcl.edu, cc'ing the TA, as a single zip file)
NOTE: You are required to give the TA a demo of your final project during his/her office hours.   The demo shall be completed before 12 noon Friday of the week when the project is due. The demo constitute 20% of the project's total grade.
To hand in:
  • A copy of the class diagram (possibly refined from the preliminary report). If no revisions were done, simply attach the original UML diagram.
  • The source programs implementing your design
  • A readme file explaining how to compile and run your source programs
  • Test the application by using three different plaintext messages. For each of the test cases, attach a screen output showing the following:

(Revised 10-15-2005)

  1. the original message (m),
  2. the ciphertext sent by the CLIENT (ci), 
  3. the decrypted message by the SERVER (dm), 
  4. the ciphertext sent by the SERVER (cs), 
  5. the decrypted message by the CLIENT (dmc),
  6. the result of the CLIENT's comparing m and dmc.

Go to the Index
  • Project 2 

The goal of this project (part A) is to extend the FileEncryptorRSA program (pages 98-110 of the Garms book) into a two-user application, incorporating certificates and digital signatures. You may use the client/server socket application that you built in project 1 as a base for this part of the project.

Certificate Chaining

  • Use keytool to create the certificates of five certifying authorities, including rootCA, CA1, CA2, CA1a, and CA2a. Use proper names and relevant information for them. Also create certificates for the server and the client applications. Use RSA when generating the key pairs for the server, the client, and the CAs.
  • The server (S) is certified by CA1a, which is certified by CA1.
  • The client (C) is certified by CA2a, which is certified by CA2. 
  • CA1 and CA2 are certified by rootCA.

Note:

Refer to Chapter 6 of the Garms and Somerfield book for examples of using keytool to create self-signed certificates, as well as a sample program, SignCertificate.java (see http://sce.uhcl.edu/yang/teaching/proJavaSecurityCode/Chapter6/SignCertificate.java), which can be used to allow one entity to sign the certificate of another entity.

A document explaining how to create multi-level certificate paths is available as Creating Certificate Chain.doc.

To learn how to process multi-level certificate paths in your Java programs, please check out this sample application.

The Server (i.e., the encryptor/sender)

  • The server should get its certificate from CA1a, and sends the certificate to the client.
  • The server should get the client's public key from the client's certificate.
  • The server needs to verify the client's certificate.
  • If the verification succeeds, the server retrieves the client's public key from the certificate. Otherwise, an appropriate error message should be displayed.
  • The server should generate a 256-bit BlowFish session key (sk), which is to be used to encrypt a data file.
  • For the purpose of data and origin integrity, the server will generate a digital signature (ds) based on the content of the data file.
  • The session key (sk) should be encrypted first by the server's private key (for data integrity), and then further by the client's public key (for confidentiality), resulting in an encrypted session key (es).
  • The encrypted session key (esk), the digital signature (ds), and the encrypted file are then sent to the client.

The Client (i.e., the decryptor/receiver)

  • The client should get its own certificate from CA2a, and sends the certificate to the server.
  • The client should get the server's certificate and verify it.
  • If the verification succeeds, the client retrieves the server's public key from the certificate. Otherwise, it displays an appropriate error message.
  • Once receiving the data sent from the server, the client should first extract the encrypted session key (esk), the digital signature (ds), and the encrypted data file.
  • The client then uses the server's public key and its own private key to decrypt the encrypted session key (esk).
  • It then uses the session key (sk) to decrypt the encrypted data file.
  • The client then verifies the digital signature (ds) using the server's public key and the content of the data file.
  • If the verification succeeds, the client will display the content of the file on the screen. Otherwise, it prints an appropriate error message.
Testing Cases: Arrange three test cases as outlined below.
    1. Generate proper keyPair respectively for the server and the client. Run the programs so the content of the file sent by the server is displayed on the client's screen. You may use any data file of size about 200 bytes.
    2. Produce an error in the generation of the client's certificate such that the verification performed by the server would fail. An example of such errors is that the client's certificate is not signed by a proper CA.
    3. Produce an error in the generation of the server's certificate such that the verification performed by the client would fail.
Part A: execution snapshots & preliminary Report (to be handed in as hardcopies)
  • Run the FileEncryptorRSA program (pages 98-110 of the Garms book). Attach meaningful screen snapshots to show that you actually ran the programs. :-) For example, you may print your name as part of the output generated by the programs.
  • Use UML to define class diagrams for SENDER, RECEIVER, and any other necessary classes.
  • Clearly identify the attributes and methods defined in each of the classes, and the associations among the classes.
  • For each of the methods, briefly explain its functionality and clearly indicate its parameters (if any) and returned data type.

Part B: final Report

Pack items a through d into a single zip file, and then send the zip file electronically to yang@uhcl.edu, cc'ing the TA.
    1. The source programs.
    2. The data file.
    3. Screen snapshots of using keytool to create the certificates.
    4. Screen snapshots of signing certificates.
    5. Arrange time to give a demo for showing the testing cases to the TA.  Note: You will loose 30% of the project's grade if a demo is not given by the end of the last teaching day.

Go to the Index

dd   Main Page

dd   Biography

dd   Teaching

dd    Research

dd    Services

dd     Other Links




Last updated: 8/02