CIS 361 Project 1: Caesar cipher encrypt/decrypt
Deliverables: The source code to your programs, as well as a make file, turned in on blackboard. You will also be required to demo you program for the instructor.
Grading: 100 points, as described below.
In this assignment, you are to write two programs, one to encrypt a file with a caesar cipher and one to decrypt. Both must be written in C, and must compile and run on the EOS linux systems. Specific requirements include:
- (15 points) Encyrption must provide the expected results for a caesar cipher
- (15 points) Decryption of an ecrypted file must provide an exact replica of the plaintext used for encryption. The linux diff command must show no difference.
- (5 points) For the encrypt program, the program should take two command line arguments: the file to encrypt and an amount to shift by.
- (5 points) The decrypt program should have one mandatory command line argument and one optional. The mandatory argument is the name of the file to decrypt. The amount of the shift that was used for encryption is optional.
- (5 points) Given the amount of shift used for encryption, you should be able to figure out a shift amount for decryption.
- (15 points) If a shift amount is not provided to the decryption program you must figure out the correct value. This may be done by decrpting with all possible values, and determining which appears to give you the most valid english words. A word list is available on the EOS systems in /usr/share/dict/words.
- (5 points) Given the correct input file name, you must generate the output file name, by appending ".enc" when encrypting or ".dec" when decrypting.
- (15 points) Other than the amount of shifting, encryption and decryption of an individual character are the same function. Therefore, this function should only be implemented once, in a separate file from the main function for either program, and used by both.
- (5 points) You must create the appropriate .h file so both your other programs can use the encrypt/decrypt caesar function described above.
- (10 points) You must support at least all capital, and lowercase letters as well as common punctuation (ASCII characters 32 - 126). Newlines may by passed from the original to the encrypted or decrypted as is.
- (5 points) You must provide a makefile. By default the makefile should compile both programs, but individual targets must also be provided for each.