#!/usr/bin/bash

echo "Analization of Message Digest of SHA-1 and MD5 algorithms" > result
sha="SHA-1"
echo "  Messagesize  Algorithm Timeformessagedigestion" >> result
java MessageGen 1k $sha >> result
java MessageGen 2k $sha >> result
java MessageGen 3k $sha >> result
java MessageGen 4k $sha >> result
java MessageGen 1k MD5 >> result
java MessageGen 2k MD5 >> result
java MessageGen 3k MD5 >> result
java MessageGen 4k MD5 >> result

echo >> result
echo "Analization of Digital Signature algorithms" >> result
echo >> result
echo "  Messagesize   Keysize  Algorithm Timeforsigning TimeforVerification StatusofVerification" >> result
size=1
while [ $size -le 4 ]
do
	key=512
	while [ $key -le 1024 ]
	do
		java RSADSAGen "$size""k" $key "MD5withRSA" >> result
		java RSADSAGen "$size""k" $key "SHA1withRSA" >> result
		java RSADSAGen "$size""k" $key "SHA1withDSA" >> result
		key=$((key+256))
	done
	size=$((size+1))
done
