DUE DATE: Friday, November 15, 2002, 5:00 pm
(no late submissions accepted)



Summary


This project introduces students to mixed-language programming, specifically integrating C and assembly code, data encryption, and dynamic libraries.

Your task is to write a program that would encrypt and decrypt data files. The choice of which cipher to use is left up to you. At the least, you should do a simple XOR cipher. (XOR data with a key to encrypt, then XOR it again with the same key to decrypt.) Alternatively, you may want to implement a more secure algorithm, such as DES, Blowfish, or even RSA.

Your program should take four arguments: a switch specifying whether to encrypt or to decrypt the file (-e or -d, respectively), the cipher to use (see below), the source file name and the destination file name. It should then prompt user for a key, e.g. a secret password. After reading the data from the source file and encrypting it with a key, your program should write the encrypted data to the destination file.

For example:

        $ ./crypt -e xor secrets.txt secrets.enc
        Enter the key: 
        $ ./crypt -d xor secrets.enc secrets.txt 
        Enter the key:



Notes





Extra Credit





What to turn in


Please submit your source code, Makefile, object file, and executable to your submit directory for this class. (located under /home/submit/cs210.) In addition please submit a printout of your source code to the instructor.



Alex Fedosov 2002-11-06