#!/bin/bash
# This script tests RSA java code with 128,256,512,768,1024 bits key lengths
# Also with different test file lengths
#


base="./java RSA "
declare -a key_lengths
i=1
key_lengths=(128 256 512 768 1024)

echo -e "\nKey Generation Time :" >> "time_generate"
echo -e "\nEncryption Time :" >> "time_encrypt"
echo -e "\nDecryption Time :" >> "time_decrypt"

for((i=0;i<5;i++))
	do
	echo -e "Key Length ${key_lengths[$i]}" >> "time_generate"
	echo -e "Key Length ${key_lengths[$i]}" >> "time_encrypt"
	echo -e "Key Length ${key_lengths[$i]}" >> "time_decrypt"
	
	$base ${key_lengths[$i]} < $1
done
echo "******** data size ** bytes ******** " >>"Results.dat"
cat "time_generate">>"Results.dat"
cat "time_encrypt">>"Results.dat"
cat "time_decrypt">>"Results.dat"
