This exercise requires you to write C++ code that will encrypt and decrypt text files and read arguments from the command line
In this exercise you will be provided some starter files
You will write a program (filesec) which will perform the following functions
It will run from the command line as shown below:
> ./filesec -e [filename.txt] //This will encrypt a file. Any filename is allowed. Output will be filename_enc.txt
> ./filesec -d [filename.txt] //This will decrypt a file. Any filename is allowed. Output will be filename_dec.txt
When encrypting, each character will be changed by adding 100 to the ASCII value of the character.
When decrypting, you will reverse the process
If an incorrect command is entered when running the program, print the usage as shown below:
Usage:
filesec -e|-d [filename]
make
make test
. This will run your filesec executable from the command line.
NOTE: If you see an error "permission denied", when running make test
, then run the command 'chmod 755 tester'
This should fix any permissions errors