#!/usr/bin/perl

# This is a script for getting the time of RSA for generation key pair and encrypt/decrypt for different message sizes.
# Key size is fixed.
# Author: Shweta Agrawal
# Date: Aug 15, 2003

# Accept the arguments
if($#ARGV != 1)
	{
	print "Usage: $0 <output file name> <keysize>";
    exit;
	}
else
	{
	$outfile = $ARGV[0];	
	$keysize = $ARGV[1];
	}

#write into the output file
$command = "echo -n > $outfile"; 
system($command);

#Run the RSA program for different message sizes and write the desired output in output file
#for ($count = 1; $count <= 5; $count++)
#{
	for ($m=50; $m<=4000; $m+=100)
	{
		$msize = $m;
		#write the key size
		$command = "echo Size: $m >> $outfile";
		system($command);
		#write various time values
		$command = "java RSA $keysize $msize 2>> $outfile";
		system($command);
	}
#}


