Programming Projects for CS549: Cryptography and Network Security

 

Team Programming Projects

 

Term Project ideas (you are encouraged to propose your own team projects, and discuss with me the feasibility of your projects.):

1)       Modeling/Simulation/Verification/Synthesis/Implementation of some network security systems

2)       Something related to your own research. You implement the protocols you designed and then evaluate the performances of your protocols in real systems or testbeds.

3)       Real network security systems, such as security protocols for CPS

Term Project grading: In particular, the following four aspects of a term project were considered in project grading:

1)       Project has a clear goal

2)       Goal has a clear value if achieved

3)       There are novel ideas involved in achieving the goal

4)       These ideas and your implementation work

In summary, the project grade is based on answers to these questions: Clear goal? Has value? New ideas? Ideas work?

If you would like to get detailed written feedback on your project report please let me know and I will give you a marked hard copy. If you disagree with my assessment of any of the above regarding your project, please see me. I would be happy to discuss the final project grade with you and fix it if appropriate.

List of potential team projects (if you cannot choose your own project)

For this semester, students can propose their own projects (then you need to discuss with the instructor about the feasibility of your proposed project). A rule of thumb here is that we expect that you successfully implement your project and this project can lead to a publication of academic research papers in some academic conferences.

Or you can choose to do TWO of the following programming assignments.

Programming assignment 1:

In this exercise you will build a simple cryptography program in a programming language of your choice. Then you will generate a few ciphertexts. Finally you will try to cryptanalyze another groups ciphertexts.

For simplicity, we assume that the input alphabet is {a-z, A-Z, 0-9} plus a special empty space character. Your program shall perform the following functions:

1

From a plaintext produce an alphabetic substitution cipher. In other words, your key is a substitution rule for each possible input character.

2

From a plaintext produce a transposition cipher. For uniform encryption by all students, we assume that the cipher will work on a block of 8 characters. In other words, you always permute within a block of 8 characters.

3

From a plaintext produce a product cipher based on the previous functions. For simplicity, assume that the substitution cipher is used first and then the transposition cipher is used to encrypt the result to get the final ciphertext.

Generate one cipher-method with each of the three functions (three cithers in total). For each cipher method (with a fixed key) you encrypt some arbitrary plain-text that contains the words "computer" and "security" inside the plaintext. Each text should contain at least 1000 characters and be of normal type (i.e. not medical).

After you produced the ciphertexts using each of the 3 encryption methods (with different keys), you now start to design methods to find the original plaintext using the given ciphertext. Begin with the simplest (1) and continue with (2) and (3).

1

Build your own tools or use ready-made tools or scripts to cryptanalyze the ciphers.

2

Try to get the plaintext from the ciphertexts.

3

Try to get the key or alphabet used.

What you have to submit

  1. your code for producing ciphertexts using the above three methods, where the input of your code is a text-file (served as plaintext) and another text-file (that will specify the key for encryption). The output is a file storing the ciphertext.
  2. your code for producing plaintexts using the above three methods, where the input of your code is a text-file (served as ciphertext) and another text-file (that will specify the key for decryption). The output is a file storing the plaintext you decrypted.
  3. your code for breaking the ciphers for each encryption method. The input of your code will have one file that is the ciphertext, and possibly another file that contains the list of words that will appear in the plaintext. The output of your code will be the plaintext and the key (stored in two separate text files).

Programming assignment 2:

In this exercise, you will have to implement RSA encryption. You cannot use existing RSA implementations found from web or in JAVA. What you can use are

  1. Java has a built-in BIGINT class to store big integers you needed for RSA (such as finding large prime numbers)

2.       For C++ you can use a library such as NTL (Library for doing Number Theory) or GMP (the GNU Multiple Precision Arithmetic Library).

In other words, you can use these big-integer implementation to manage your data and do module operation, but not use the existing implemented methods (gcd, power, finding prime numbers, and so on). You have to implement these functions yourself. You can use existing secure function to produce large random numbers (some functions provided for random numbers cannot be used due to its weak security). Noticethat JAVA provide tools to get random numbers in

java.util.random  or  java.security.SecureRandom


Similarly, C++ have rand() and srand() to generate random numbers. You can use the random number function provided by Java if implementing random numbers is really difficult for you. However, these methods there are not secure since Linear congruent method is the default method set for Java's two built in random number generators. So to enhance security, you are strongly recommended to implement your own good random number generator.

In your own RSA implementation, assume that the large prime numbers are at least 500 bits (but could be much larger than this).  You should write several functions yourself

  1. a function to find large prime numbers, when given number of bits as an input
  2. a function to compute gcd when given two large integers
  3. a function to produce a random encryption key when given the two large prime numbers used for RSA
  4. a function to compute the decryption key when given the encryption key e and the two large prime numbers p and q
  5. a function for encryption when given the message and encryption key e and the modulo n
  6. a  function for decryption when given the ciphertext and encryption key e and the modulo n

What you have to submit

  1. a code that can encrypt a file using RSA, where the input of your code are two files: one file is the plaintext file and another file stores the key for encryption.
  2. a code that can decrypt a file using RSA, where the input of your code are two files: one file is the ciphertext file and another file stores the key for decryption.

Programming assignment 3:

In this exercise, you will have to implement ElGamal digital signature method. You cannot use existing implementations found from web or in JAVA. What you can use are

  1. Java has a built-in BIGINT class to store big integers you needed for RSA (such as finding large prime numbers)

4.       For C++ you can use a library such as NTL (Library for doing Number Theory) or GMP (the GNU Multiple Precision Arithmetic Library).

In other words, you can use these big-integer implementation to manage your data and do module operation, but not use the existing implemented methods (gcd, power, finding prime numbers, and so on). You have to implement these functions yourself. You can use existing secure function to produce large random numbers (some functions provided for random numbers cannot be used due to its weak security). Noticethat JAVA provide tools to get random numbers in

java.util.random  or  java.security.SecureRandom


Similarly, C++ have rand() and srand() to generate random numbers. You can use the random number function provided by Java if implementing random numbers is really difficult for you. However, these methods there are not secure since Linear congruent method is the default method set for Java's two built in random number generators. So to enhance security, you are strongly recommended to implement your own good random number generator.

In your own ElGamal implementation, assume that the large prime numbers are at least 500 bits (but could be much larger than this).  You should write several functions yourself

  1. a function to find large prime numbers, when given number of bits as an input
  2. a function to compute gcd when given two large integers
  3. a function to produce a random digital signature key and verification key when given the large prime numbers used
  4. a function to compute the decryption key when given the encryption key e and the two large prime numbers p and q
  5. a function for digital signature of a message when given the message and signature key
  6. a  function for signature verification when given the message, and the signature

What you have to submit

  1. a code that can sign a file using elGamal, where the input of your code are two files: one file is the plaintext file and another file stores the key for digital signature.
  2. a code that can verify the digital signature of a file using ElGamal, where the input of your code are three files: one file is the signature file, one file is the original message, and another file stores the key for verification.