#!/bin/bash

# Script to compile and run a java program RSA.java 
# Key size must be provided as argument to this script
./javac RSA.java
i=1
while [ "$i" -le 4 ]
do
if [ -n "$1" ]
then
echo "Key size in bits is : $1" >>outfile
echo "Message size in bytes is :" >>outfile 
wc -c infile$i >>outfile
echo -e "\n" >>outfile
./java RSA $1 <infile$i >>outfile
echo -e "\n" >>outfile
i=$(( $i + 1 ))
fi
done
