Question: Specifications: In this project, you are required to write the java program RSA . java to implement RSA. Specifically, your program reads the parameters, plaintext

Specifications:
In this project, you are required to write the java program RSA.java to implement RSA.
Specifically, your program reads the parameters, plaintext and ciphertext from a file named
input.txt(under the same directory of the program). Then your program computes the private
key, encrypts the plaintext, and decrypts the ciphertext. Finally, your program creates a file
named output.txt(under the same directory of the program) and writes the results to
output.txt. Please check the attached sample files input.txt and output.txt.
In input.txt:
1. First line is a prime number p, represented by hexadecimal digits.
2. Second line is another prime number q, represented by hexadecimal digits.
3. Third line is a randomly selected integer e, represented by hexadecimal digits, satisfying
GCD(e,
(n))=1 where n = p * q.
4. Fourth line is the plaintext, represented by hexadecimal digits.
5. Fifth line is the ciphertext, represented by hexadecimal digits.
In output.txt:
1. First line is d, represented by hexadecimal digits, satisfying d = e1 mod
(n).
2. Second line is the ciphertext, presented by hexadecimal digits, which is the encryption
result of the plaintext in input.txt.
3. Third line is the plaintext, presented by hexadecimal digits, which is the decryption result of the ciphertext in input.txt
It will be tested using command line.
First, the files input.txt and RSA.java will be placed under the same directory (A new
input.txt file which is different than the sample data will be used to test your program)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!