Question: Create a Java application for digital signature verification. (40 marks) 1. Please place your source code in a single file named VerSig.java. The main() function

Create a Java application for digital signature verification. (40 marks)

1. Please place your source code in a single file named VerSig.java. The main() function should be located in the class VerSig.

2. The application accepts three inputs, namely, a public key, a signature and data. It displays True if and only if verification succeed. It displays False otherwise. The command to execute your application is: java VerSig pk.txt sig.txt data

3. Format of the input:

a. pk.txt it is a text file of two lines. The first line is n, and the second line is e. Both numbers are in decimal form.

b. sig.txt it is a text file of one line. It is a number in decimal form which is the digital signature of the message digest of data.

c. data: it is an arbitrary file.

We adopt RSA with MD5 as the hash function. A Java implementation of MD5 can be found at https://rosettacode.org/wiki/MD5/Implementation#Java .

Use this MD5 code in your program.

Signature verification consists of the following steps.

1. Read (n, e) from pk.txt

2. Read sig from sig.txt

3. Compute digest = MD5(data)

4. Test if digest = sige mod n. If yes, display True, otherwise, display False.

Example:

Sample: java VerSig pk.txt sig.txt data

Sample Output: True

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!