#! /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/cs472/randomfile . RANDFILE=randomfile export RANDFILE # echo .... unziping all submitted files echo "unzip $1A3Files.zip" unzip $1A3Files.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 cs472PrivateKey.pem -in symPasswd.cipher -out symPasswd.txt" openssl rsautl -decrypt -inkey cs472PrivateKey.pem -in symPasswd.cipher -out symPasswd.txt echo '>>>' "$user" passwd is ..... : `cat symPasswd.txt` # echo .... decrypt A3.zip echo "openssl enc -des3 -d -salt -a -out A3.zip -in A3Zip.base64" openssl enc -des3 -d -salt -a -out A3.zip -in A3Zip.base64 # echo ... verify the signature of the MD of A3.zip echo "openssl enc -base64 -d -in A3ZipMdSignature.base64 -out A3ZipMdSignature.cipher" openssl enc -base64 -d -in A3ZipMdSignature.base64 -out A3ZipMdSignature.cipher echo "openssl dgst -sha1 -verify $1PublicKey.pem -signature A3ZipMdSignature.cipher A3.zip" openssl dgst -sha1 -verify $1PublicKey.pem -signature A3ZipMdSignature.cipher A3.zip # echo ... unziping A3 files echo unzip A3.zip unzip A3.zip echo ....done