CIS 459.21 LAB2
*** Due Date: Wednesday 4/27/2005 11:59pm ***
Objectives:
- To practice functions and program structures
- To understand and practice how to design, implement and test
a set of Application Programming Interfaces (API).
- To practice one of the programming autotools: Makefile
Points: 100
Description:
In this lab, you are hired as a security developer and your employer
asks you to design, implement and test a set of API that can encrypt
an input sentence (assume less than 20 characters) with three different
security levels:
- simple encryption: replace each letter with its next lexicographical
letter, e.g., "Good" will be "Hppe".
- medium encryption: add to each letter with its index in the actual
sentence, e.g., "Good" will be "Gpqg".
- ultra encryption: add to each letter with the square of its index
in the actual sentence, e.g., "Good" will be "Gpsm".
Note: if a resulting letter is more than 'Z' or "z", just wrap around.
That is to day, given a sentence "end zone",
in the first case, your encryption is "doe apof";
in the second case, your encryption is "eof dttl", and so on.
You are also given an incomplete driver program,
lab2.c, that contains
the main function. You need to do the following:
- Define a header file as encrypt.h, basically including the
prototype function definitions for the three cases;
- You need to provide an implementation, encrypt.c, for the functions
defined in the above API header file.
- You need to complete the main program by filling in the main
program with correct functions calls to your API.
Requirements:
With your interests in 459.21, I am assuming you are interested in system
programming. So you are required to meet the following requirements:
- Document your programs well.
- Following a good coding style (see course
page for links to different coding styles).
In the worst case, use the indent program
to process your source file before your submission.
- Provide a Makefile that compile your API header and source files
first, and compile your program lab2.c in a separate step.
Your Makefile must have at least two targets: lab2 and clean.
A sample Makefile is provided here. A link to GNU Makefile manual is available
here.
Submission:
When you finish with the lab, you need to turn it in for grading. The submit command submits your lab electronically. You MUST use the submit command to turn in your labs. The format of submit command is as follows:
submit classname labname files-to-submit
where, to submit your first lab for this class, use the following command
from the directory which contains your files (lab2.c and Makefile):
submit c459.21aa lab2 lab2.c Makefile encrypt.c encrypt.h
Last updated:
Sun Apr 10 00:00:45 EDT 2005