This assignment is to write take the implementation of DES you wrote for Assignment Three and use it in two different cipher modes.The two modes are 1) Counter Mode (CTR) and 2) Output Feedback Mode (OFB). Both modes are described in Stallings. The algorithm should do both encryption and decryption.
Your program should have four inputs.
Using this information, your program should implement the DES cipher to do the requested encryption/decryption.
For OFB, use s = 8. That is, the stream part of the cipher does a byte at a time.
The keyfile will be a binary file containing the 64 bit key.
The file for both a plaintext or cipher text file will be a binary file containing 64n bits, where n is some positive integer. That is to say, that the input will evenly fit into some number of DES 64 bit blocks.
The counter/IV will be a binary file containing a 64 bit value. For CTR mode, this value is the initial one for the counter. For OFB mode, it is the initial value loaded into the shift register.
I will put sample keys, and plaintext/ciphertext pair files on the Acunix computers. Files that are common to the two modes will be in the directory
~berg/cs445t/pa4/
Files specific to the parts of the assignment will be in the subdirectories:
~berg/cs445t/pa4/ctr
~berg/cs445t/pa4/ofb
The following needs to be submitted
The programs must be adequately documented so that it is clear what is occurring at each point in the program, as well as necessary documentation for overall algorithms, assumptions, etc.
Programs should be tested so that they can be compiled (if necessary) and run on the academic computing center Unix cluster.
To submit the programs, you can either send them as attachments to berg@cs.albany.edu, or they can be encoded and mailed directly:
shar file1 file2 ... | Mail -s "crypto program 4" berg@cs.albany.edu
Q: What if my DES program from Assignment Three didn't work?
A: If you're using C, you can use the crypt lib. It has the functions setkey() and encrypt() (see man setkey and man encrypt for details). When compiling, you'll have to give the argument -lcrypt for the compile to work. I haven't done this myself, but others have told me it works fine. YMMV.
Version 03310301 (03/31/03)
Copyright 2003 by George Berg