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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started