A widely used method for speeding up RSA encryption and RSA

A widely used method for speeding up RSA encryption and RSA signatures is the use of so called short exponents. These are numbers, which are only a few bits in length, i.e. e = 3, 17 and 2^16 + 1. Most short exponents are of the form c = 2\" +1. Would it be advantageous to use exponents of the form 2\" - 1? Justify your answer! Compute the exponentiation m^e mod 29 of m = 5 with both variants of e for n = 4. Use the square-and-multiply algorithm and show each step of your computation. Justify your answer from part (a). Why can\'t we use short exponents d for the decryption/signature generation? Suggest a minimum bit length for the exponent d and explain your answer.

Solution

class StringSet
{
//An instance variable of type String[]
String[] set;
//An int instance variable that indicates the number of String objects that the StringSet currently contains.
int numOfStrings;
//A no argument constructor.
public StringSet()
{
numOfStrings = 0;
set = new String[10];
}
//A mutator that adds a String newStr to the StringSet object.
void add(String newStr)
{
set[numOfStrings++] = newStr;
}
//An accessor that returns the number of String objects that have been added to this StringSet object.
int size()
{
return numOfStrings;
}
//An accessor that returns the total number of characters in all of the Strings that have been added to this StringSet object.
int numChars()
{
int sum = 0;
for(int i = 0; i < numOfStrings; i++)
sum += set[i].length();
return sum;
}
//An accessor that returns the number of Strings in the StringSet object that have exactly len characters.
int countStrings(int len)
{
int count = 0;
for(int i = 0; i < numOfStrings; i++)
if(set[i].length() == len)
count++;
return count;
}
}

And the code for StringSetTester.java is:

import java.util.*;
class StringSetTester
{
public static void main(String[] args)
{
Scanner kybd = new Scanner(System.in);
System.out.print(\"How many strings will you enter? \");
int numStr = kybd.nextInt();
kybd.nextLine();
StringSet ss = new StringSet();
for(int i = 0; i < numStr; i++)
{
System.out.print(\"Enter string \" + (i+1) + \": \");
String temp = kybd.nextLine();
ss.add(temp);
}
System.out.println(\"The size of the StringSet is: \" + ss.size());
System.out.println(\"The number of characters in StringSet is: \" + ss.numChars());
System.out.println(\"The number of strings of length 5 are: \" + ss.countStrings(5));
System.out.println(\"The number of strings of length 7 are: \" + ss.countStrings(7));
}
}

 A widely used method for speeding up RSA encryption and RSA signatures is the use of so called short exponents. These are numbers, which are only a few bits in
 A widely used method for speeding up RSA encryption and RSA signatures is the use of so called short exponents. These are numbers, which are only a few bits in

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site