[Java]
I am to complete this RSA class to make it work. Complete To Dosalso take input from Input.txt file such as
Input.txt
e= 103687
p= 1413297339818079839
q= 7795673610480062959
message= gravitatio
————————–
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class RSA_assignment
{
static Scanner console = new Scanner (System.in);
public static void main(String [] args) throwsFileNotFoundException
{
System.out.println(“Q. How to say hello on Java? : A. HelloJava!!!”);
System.out.println(“Q. How to say hello on C++? : A. HelloC++!!!”);
Scanner inFile = new Scanner (newFileReader(“Kamilla2.txt”));
long p,q;
long e;
String ggg;
ggg= inFile.next(); //e-
e=inFile.nextInt();
ggg= inFile.next(); //p=
p=inFile.nextLong();
ggg= inFile.next(); //q=
q=inFile.nextLong();
if ((p-1)%e==0||(q-1)%e==0) {System.out.println(“I must chooseanother e from teacher’s website”);}
else{ System.out.println(“gcd(e,(p-1)(q-1))=1”);
BigInteger nBI= BobCalculateN(p, q);
BigInteger eBI= new BigInteger(“”+e);
System.out.println(“p=”+p+” q=”+q);
BigInteger dBI=BobCalculateD(p, q, e );
System.out.println(“dBI=”+dBI);
String mStr; //message
long m; //coded value as
PayPal Gateway not configured
PayPal Gateway not configured