Go to USC home page USC Logo Computer Science & Engineering
UNIVERSITY OF SOUTH CAROLINA
CSE Home Page | CSE Research | CSE Site Map | CSE Faculty
CSCE 557
Introduction to Cryptography
Programming Assignments
CSCE 557 web page

Caveat


This page will be changing throughout the semester as programming assignments are added.

Programming Assignment 1

Due date: Thursday 15 September 2005

Your first assignment is problem 2.10, page 61, in the text.

Hint: To make life easy, I have provided the source file and the inverse matrix for you in the sample programs directory.

Rules: There aren't really any rules. You may do this as a simple programming exercise or by hand. If you do it by hand, your description of the process should be enough to allow me to assign a grade, and you may even, if you wish, turn in an assignment on paper. If you use a computer, please include documentation of the code and the "other" work you did to get to the answer. (There are no rules for how to attack this problem: provided you don't violate the rules about academic honesty, any method you use is legitimate. It is even possible to write the naive hack that tests all possible four-tuples of letters as cribs, but doing it that way will get you a lower grade than if you did it "properly.")

If you use a computer, you may use pretty much any programming language you like (perl, C, Fortran, C++, Java, ...).


Programming Assignment 2

Due date: Tuesday 20 September 2005

The assignment is problem 2.11 in the text.

Rules: Once again, there are basically no rules. In this case, since this is a text book exercise, it turns out you can solve this problem without doing any real mathematics at all. That is, you should first observe that since the sequence of bits in the LFSR are dot-product-ed with the coefficients of the recurrence, it is not possible that the recurrence is of any smaller length than the largest observed sequence of zeros. (For example, if you have the sequence 0 0 0 0 1, then the recurrence cannot be of degree any smaller than five. A degree four recurrence would have to satisfy

c3*0 + c2*0 + c1*0 + c0*0 = 1
and that's impossible. Working from there, and using the computer for nothing more than an text editor, it is possible in this case to "guess" the recurrence without doing any real math at all. The "professional" way might be to set up an exact n by n system of equations and then to solve those. In this case, you can set up many extra rows of a matrix equation and just choose the equations you like to simplify the problem. An equation with only one nonzero entry gives you all the information you need for that column of the matrix equation.

I have provided the source file L101 in the sample programs directory.

If you use a computer, you may use pretty much any programming language you like (perl, C, Fortran, C++, Java, ...).


Programming Assignment 3

Due date: 9:30am, 20 Oct 2005 (NOTE NEW DEADLINE)

This assignment is a modification of computer problem 4.10.1, page 149 of the text.

Part a) asks you to write code to do one round of the simplified DES. You should write code that does N rounds, with N initially set to 1. You should have the data length (12 bits for the simplied DES) and the key length (9 bits) also set as constants that could be changed with at most a recompile.

(You could, for example, do all of these with defined constants in C that are hard-coded with 1, 12, 9, as values, so that your code works off mutable values but only a recompile would be needed to change those values.)

You should turn in code that I can compile, or in the case of Maple, just run. I do not recommend Matlab for this purpose. C, or C++, or perhaps Java, or Maple, or even Fortran, are ok. If you want to use a different language, please contact me first. I will want to provide my own bit string and key to test the code, so you will need to provide me with sufficient information to allow me with no effort to produce a new executable. (This was a significant failing of many students in the previous exercises, and I overlooked this for those but won't for this one or subsequent programs.)

Be sure to verify that you can decrypt as requested in part b.

Be sure to test as in part c.

Be sure to provide a different set of code for part d, or else one program that can be compiled in different ways.

You will need to turn in documented code and perhaps also a README.


Programming Assignment 4

Due date: Midnight, 4 November 2005

You are to factor the following numbers.

3628932949347475183

2288868185735578339393025945483056674047

18523529213127477903597429377970761532002443342759 Here are the rules.

  • You may beg, borrow, or steal (well, not really steal) code from anywhere you can get it.
  • You may work individually or in groups, but any group work will result in the same grade for every member of the group.
  • The only restrictions on how you solve this problem are Restriction One and Restriction Two.
  • Restriction One: What you turn in must include a complete description of how you managed to get these numbers factored. I don't care so much how you do it, but I do care that you say how you did it.
  • Restriction Two: Any computations more complicated than a browser displaying a web page, say, must be performed on a computer located either within a 20-mile radius of the Swearingen Engineering Center or in your home or business. (There are websites to which you can submit numbers for factoring, and these sites are off limits for the purpose of this assignment.)

For reference, I have placed the code that generated these numbers on the web in the sample programs directory.


Programming Assignment 5

Due date: midnight, 21 November 2005

The assignment is Section 9.7, problem 2, page 255 of the text.

Some rules.

You MUST put your name on your work.

You MUST actually WRITE SOMETHING describing what you have done. For most of these programming assignments I have expected three, perhaps five pages of description of what you have done. Instead, I have received perhaps one paragraph. One of the major emotional hassles that a teacher goes through is to look at a "correct" answer that is vastly insufficient as to demonstrate that you in fact learned something. My head tells me that most of you should have been receiving very little credit for the work you have been doing this semester, but I just have not had the stomach to go through the hassle of assigning you the poor grades you have deserved.

When you turn in an assignment, it is YOUR RESPONSIBILITY to explain EVERYTHING to me as if I knew relatively little about the subject. If you fail to do this, then you will not do well.


Programming Assignment 6

Due date: xx xx 2005


Programming Assignment 7

Due date: xx xx 2005


Programming Assignment 8

Due date: xx xx 2005