Cryptology - I: Project #3

Instructors: R.E. Newman-Wolfe and M.S. Schmalz


Undergrads and Grads:

Implement an RSA cryptosystem with (a) key generation, (b) encryption, and (c) decryption. The cryptosystem must be able to handle 512-bit numbers, which means that your chief task will be to implement and test a large-number arithmetic library.

Note: Several students have inquired about partitioning the input (plaintext). My best suggestion is to initially partition the input into 8-bit bytes and concatenate them. Some students were concerned about the plaintext binary representation having a decimal value that exceeds the modulus. If you think that's a problem, use only 63 bytes and pad the most significant eight bits with zeroes. This will guarantee that the plaintext does not exceed the modulus. Don't forget to remove the high-order eight bits after decryption, or you will have an unwanted 0256 in the output.

After you have tested and verified the correctness of your algorithm, you should recode the input using only a five-bit encoding of {A,B,...,Z}. Thus, the input to your RSA algorithm will consist of 102 concatenated 5-bit character representations (510 bits), rather than 64 eight-bit representations. As before, you can use two zero-valued bits as padding. The advantage of using the five-bit encoding is that three bits of padding are eliminated per character representation. Such padding, which tends to occur in the same (or nearly the same) bit positions across the 26 English characters in the ASCII alphabet, can provide important information to an adversary who might examine your ciphertext.

Scoring: 6 base points for undergrads, 4 base points for grads.

Undergrads:

Choose options worth four points total from the list below, to bring your point total to 10.

Grads:

Choose options worth six points total from the list below, to bring your point total to 10.


General:

You shall submit electronically (to Dr. Newman-Wolfe only):
  1. Documentation in form of one man page for each program, with format similar to Unix man pages (see /usr/man/man1/*). Include a section for theory of operation. Be sure to specify input and output.
  2. Makefile (see make(1)) - this should be cumulative for the entire term (i.e., every makefile you submit should include commands to make everything you have submitted).
  3. Complete source code, including header files. Code should have sufficient comments internally to aid understanding, and be free of manifest constants (use the #define preprocessor command as needed). Programs should handle erroneous input and provide help to the user.

Read the Programming Hints at the end of this document to help make your life a little easier.


List of Options

Now that you have thought about the basic RSA cryptosystem, you will want to use some of the following options (a psudo-random number generator or PRNG and a primality testing algorithm are required for RSA) to implement your cryptosystem.


References

References should be taken from the list provided at the end of the Project-4 description .


This concludes the description for Project #3.