Grading Guideline for HW4 ========================= Total points: 100 +---------------------+ | General Guidelines: | +---------------------+ 1) The points below are maximum points. Partial credits may be given. 2) Do the "plus points" first, then do the "minus points". 3) Please read the student's README first to see if you need to do something different to get their code to work and what the known problems are. 4) The scripts below are for csh/tcsh. If you use bash, please modify them where necessary. Or, you can do "tcsh" and then run the scripts. 5) The grading is meant to be harsh! So, if running the "diff" command suppose to produce no output, but the student's code produces some output, take points off accordingly. Similarly, if running the "diff" command suppose to produce some output, but the student's code produces no output, take points off accordingly. 6) The posted grading guidelines is not perfect. We will try our best to stick to the grading guidelines. Sometimes, after we started grading some of the submissions, we realize that we missed something (most often in "minus points"). The bottomline is that we reserve the right to add or change things in the grading guidelines as we see fit. +--------------+ | Plus points: | +--------------+ Documentation : +4 points (comments in code plus README) Missing README file : -2 points (even if lots of comments in code) (Document+this cannot go negative) (A) Arc4 : +20 points set srcdir=~csci530/public/hw4 set skip=(113 497 13 1216 343 245 80 15 54 1239) set len=(231 310 165 51 1537 27 1148 599 120 251) set skip=(1239 54 15 80 256 8 1216 10 497 113) set len=(1537 27 1148 599 120 251 231 310 165 51) # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.states f?.len foreach f (0 2 4 6 8) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 arc4 -states $srcdir/f$f > f$f.states diff $srcdir/f$f.states f$f.states end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.states f?.len foreach f (1 3 5 7 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 arc4 -states -s $skip[$i] $srcdir/f$f > f$f.states diff $srcdir/f$f.states f$f.states end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.states f?.len foreach f (0 2 4 6 8) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 arc4 -l $len[$i] > f$f.len diff $srcdir/f$f.len f$f.len end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.states f?.len foreach f (1 3 5 7 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 arc4 -l $len[$i] -s $skip[$i] $srcdir/f$f > f$f.len diff $srcdir/f$f.len f$f.len end /bin/rm -f f?.states f?.len (B) SA : +20 points set srcdir=~csci530/public/hw4 set skip=(113 497 13 1216 343 245 80 15 54 1239) set len=(231 310 165 51 1537 27 1148 599 120 251) set skip=(1239 54 15 80 256 8 1216 10 497 113) set len=(1537 27 1148 599 120 251 231 310 165 51) # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sa.1 f?.sa.2 foreach f (0 1 2 3 4 6 7 8) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sa $srcdir/f$f > f$f.sa.1 diff $srcdir/f$f.sa.1 f$f.sa.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sa.1 f?.sa.2 foreach f (5 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sa > f$f.sa.1 diff $srcdir/f$f.sa.1 f$f.sa.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sa.1 f?.sa.2 foreach f (1 2 3 5 6 7 8 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sa -s $skip[$i] $srcdir/f$f > f$f.sa.2 diff $srcdir/f$f.sa.2 f$f.sa.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sa.1 f?.sa.2 foreach f (0 4) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sa -s $skip[$i] > f$f.sa.2 diff $srcdir/f$f.sa.2 f$f.sa.2 end /bin/rm -f f?.sa.1 f?.sa.2 (C) XSA : +20 points set srcdir=~csci530/public/hw4 set skip=(113 497 13 1216 343 245 80 15 54 1239) set len=(231 310 165 51 1537 27 1148 599 120 251) set skip=(1239 54 15 80 256 8 1216 10 497 113) set len=(1537 27 1148 599 120 251 231 310 165 51) # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.xsa.1 f?.xsa.2 foreach f (1 2 3 5 6 7 8 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 xsa $srcdir/f$f > f$f.xsa.1 diff $srcdir/f$f.xsa.1 f$f.xsa.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.xsa.1 f?.xsa.2 foreach f (0 4) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 xsa > f$f.xsa.1 diff $srcdir/f$f.xsa.1 f$f.xsa.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.xsa.1 f?.xsa.2 foreach f (0 1 2 3 4 6 7 8) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 xsa -s $skip[$i] $srcdir/f$f > f$f.xsa.2 diff $srcdir/f$f.xsa.2 f$f.xsa.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.xsa.1 f?.xsa.2 foreach f (5 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 xsa -s $skip[$i] > f$f.xsa.2 diff $srcdir/f$f.xsa.2 f$f.xsa.2 end /bin/rm -f f?.xsa.1 f?.xsa.2 (D) MD5 : +20 points set srcdir=~csci530/public/hw4 set skip=(113 497 13 1216 343 245 80 15 54 1239) set len=(231 310 165 51 1537 27 1148 599 120 251) set skip=(1239 54 15 80 256 8 1216 10 497 113) set len=(1537 27 1148 599 120 251 231 310 165 51) # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (0 1) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 $srcdir/f$f > f$f.md5.1 diff $srcdir/f$f.md5.1 f$f.md5.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (2 3) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 md5 > f$f.md5.1 diff $srcdir/f$f.md5.1 f$f.md5.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (4 5) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 -s $skip[$i] $srcdir/f$f > f$f.md5.1 diff $srcdir/f$f.md5.1 f$f.md5.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (6 7) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 md5 -s $skip[$i] > f$f.md5.1 diff $srcdir/f$f.md5.1 f$f.md5.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (8 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 -sa $srcdir/f$f > f$f.md5.1 diff $srcdir/f$f.md5.1 f$f.md5.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (0 1) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 md5 -sa > f$f.md5.2 diff $srcdir/f$f.md5.2 f$f.md5.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (2 3) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 -s $skip[$i] -sa $srcdir/f$f > f$f.md5.2 diff $srcdir/f$f.md5.2 f$f.md5.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (4 5) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 md5 -sa -s $skip[$i] > f$f.md5.2 diff $srcdir/f$f.md5.2 f$f.md5.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (6 7) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 -xsa $srcdir/f$f > f$f.md5.2 diff $srcdir/f$f.md5.2 f$f.md5.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.md5.1 f?.md5.2 foreach f (8 9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 md5 -s $skip[$i] -xsa $srcdir/f$f > f$f.md5.2 diff $srcdir/f$f.md5.2 f$f.md5.2 end /bin/rm -f f?.md5.1 f?.md5.2 (E) SHA1 : +16 points set srcdir=~csci530/public/hw4 set skip=(113 497 13 1216 343 245 80 15 54 1239) set len=(231 310 165 51 1537 27 1148 599 120 251) set skip=(1239 54 15 80 256 8 1216 10 497 113) set len=(1537 27 1148 599 120 251 231 310 165 51) # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (0 1) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 $srcdir/f$f > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (2) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sha1 > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (3 4) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 -s $skip[$i] $srcdir/f$f > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (5) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sha1 -s $skip[$i] > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (6 7) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 -sa $srcdir/f$f > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (8) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sha1 -sa > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (9) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 -s $skip[$i] -sa $srcdir/f$f > f$f.sha1.1 diff $srcdir/f$f.sha1.1 f$f.sha1.1 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (0 1) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` cat $srcdir/f$f | ./hw4 sha1 -sa -s $skip[$i] > f$f.sha1.2 diff $srcdir/f$f.sha1.2 f$f.sha1.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (2 3) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 -xsa $srcdir/f$f > f$f.sha1.2 diff $srcdir/f$f.sha1.2 f$f.sha1.2 end # # for the following commands, each correct answer gets 1 point # /bin/rm -f f?.sha1.1 f?.sha1.2 foreach f (4 5) echo "===> $srcdir/f$f" set i=`echo 1+$f | bc` ./hw4 sha1 -s $skip[$i] -xsa $srcdir/f$f > f$f.sha1.2 diff $srcdir/f$f.sha1.2 f$f.sha1.2 end /bin/rm -f f?.sha1.1 f?.sha1.2 +---------------+ | Minus points: | +---------------+ Cannot compile : -5 to -10, depending on effort to make it work if using gcc/g++, make sure -Wall flag is used please take a point or 2 off for having compiler warnings (1 point for 1-5 warnings and 2 points for more) make clean : -2 points Segmentation faults : -10 points if you see a seg fault (or bus error) any time during your testing of the code, if it's fairly repeatable, deduct 10 points, if it's intermittent, deduct less, depending on how often you see the seg fault Fork to execute openssl : -30 points visually inspect the code and look for system(), popen(), "exec", to make sure that an external program (such as openssl) is not called to do the work Buffer size violation : -10 points visually inspect the code and look for malloc() or "new" and see if a buffer whose size is greater than 4096 is used Separate compilation : -10 points if the executable is compiled with a single line, deduct all 10 points if the executable is a single module, but generates hw4.o and then link to create the executable in line one, deduct 5 points if most of the code are in .h files, deduct all 10 points Use external files : -10 points visually inspect the code and look for open() and fopen() to make sure the input data is not *written* into a (temporary) file; open a file for reading is not a problem if the above is true and a hard-coded filename is used, please deduct 20 points Bad commandline : -1 point each for each not handling properly ./hw4 (malformed command) ./hw4 xyz (malformed command) ./hw4 abc def ghi (malformed command) ./hw4 -y hexdump (malformed command) ./hw4 arc4 -u /bin/ls (invalid commandline option) ./hw4 sa -v /bin/ls (invalid commandline option) ./hw4 xsa -w /bin/ls (invalid commandline option) ./hw4 md5 -x /bin/ls (invalid commandline option) ./hw4 sha1 -y /bin/ls (invalid commandline option) ./hw4 arc4 /bin/ls (malformed command) ./hw4 arc4 -states /usr/bin/xyzz (input file /usr/bin/xyzz does not exist) ./hw4 arc4 -l /usr/bin/xyzz (/usr/bin/xyzz is not a valid numeric argument) ./hw4 sa /usr/bin/xyzz (input file /usr/bin/xyzz does not exist) ./hw4 xsa /usr/bin/xyzz (input file /usr/bin/xyzz does not exist) ./hw4 sa -s abc /bin/ls (abc is not a valid numeric argument) ./hw4 xsa -s abc /bin/ls (abc is not a valid numeric argument) ./hw4 md5 /usr/bin/xyzz (input file /usr/bin/xyzz does not exist) ./hw4 md5 -s abc /bin/ls (abc is not a valid numeric argument) ./hw4 sha1 /usr/bin/xyzz (input file /usr/bin/xyzz does not exist) ./hw4 sha1 -s abc /bin/ls (abc is not a valid numeric argument) Bad behavior for random input : -1 point each for each not handling properly # # for these commands, just pound on the keyboard and hit # at random times and see if the program behaves # properly by not crashing, you don't have to look at the # output data # # if the program seg faults, please apply the seg fault rule # above # ./hw4 arc4 -states ./hw4 sa ./hw4 xsa ./hw4 md5 ./hw4 sha1