#!/usr/bin/perl

# This is a script for getting the time of RSA for generation key pair for different values of certainity.
# 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 and write the desired output in output file
for ($i = 0; $i<=50; $i+=2)
{
	$certainity = $i;
	#write the certainity value
	$command = "echo Size: $certainity >> $outfile";
	system($command);
	#write various time values
	$command = "java RSA $keysize y $certainity 2>> $outfile";
	system($command);
}


