#! /bin/sh #: if test $# -eq 0 then echo "error, usage: grading_script.sh " exit 0; fi # set the random file environmnet. echo '>>>' grading .... $1 cp /home/cs772/randomfile . RANDFILE=randomfile export RANDFILE # echo .... unziping all submitted files echo "unzip $1A2Files.zip" unzip $1A2Files.zip # echo .... converting symPasswd.base64 to symPasswd.cipher echo "openssl enc -base64 -d -in symPasswd.base64 -out symPasswd.cipher " openssl enc -base64 -d -in symPasswd.base64 -out symPasswd.cipher # echo .... get the SYMMYTRIC passwd echo "openssl rsautl -decrypt -inkey cs772PrivateKey.pem -in symPasswd.cipher -out symPasswd.txt" openssl rsautl -decrypt -inkey cs772PrivateKey.pem -in symPasswd.cipher -out symPasswd.txt echo '>>>' "$user" passwd is ..... : `cat symPasswd.txt` # echo .... decrypt A2.zip echo "openssl enc -des3 -d -salt -a -out A2.zip -in A2Zip.base64" openssl enc -des3 -d -salt -a -out A2.zip -in A2Zip.base64 # echo ... verify the signature of the MD of A2.zip echo "openssl enc -base64 -d -in A2ZipMdSignature.base64 -out A2ZipMdSignature.cipher" openssl enc -base64 -d -in A2ZipMdSignature.base64 -out A2ZipMdSignature.cipher echo "openssl dgst -sha1 -verify /home/cs772/public_html/fall08/public_keys/$1PublicKey.pem -signature A2ZipMdSignature.cipher A2.zip" openssl dgst -sha1 -verify /home/cs772/public_html/fall08/public_keys/$1PublicKey.pem -signature A2ZipMdSignature.cipher A2.zip # echo ... unziping A2 files echo unzip A2.zip unzip A2.zip echo ....done