Question: Problem4 Code: In this problem you will write two functions to work with MD5 hashes. The first function takes a number and computes a MD5

 Problem4 Code: In this problem you will write two functions to

Problem4 Code: In this problem you will write two functions to work with MD5 hashes. The first function takes a number and computes a MD5 hash. The second function takes a MD5 hash and returns the number that when hashed, produces the hash in input a) Write a Java class namely Hash.java that implements number hashing logic. The class should have a method with the following prototype: String hash(int to hash), produces the MD5 hash string for the integer number provided in input. Internally, the integer should be converted to a string that represents the number in decimal format, and then hashed using the MD5 cryptographic hash For instance, the return value of hash(12345) should be "827ccb0eea8a706c4c34a16891f84e7b". You are allowed to use Java libraries for the computation of MD5 hashes Apart from implementing the hash(...) method, the class should also include a public static void main(String [ args) function. The main(...) function should accept 1 parameter from the calling environment. The parameter is a string that contains the representation in decimal format of a number to hash. It is responsibility of the main(...) function to internally invoke the implemented hash(...) functioin only once and print its result b) Write a Java class namely UnHash.java that implements number de-hashing (a.k.a. hash cracking) logic. The class should have a method with the following prototype: int unhash(String to unhash) produces an integer from a hash string in input. The integer produced in output should be such that its MD5 hash corresponds to the hash string to unhash For instance, the return value of unhash(01 cfcd4f6b8770febfb40cb9067 15822, , ) should be 54321. You are allowed to use Java libraries for the computation of MD5 hashes Apart frorn mplementing the unhash(..) method, the class should also include a public static void main(String [] args) function. The main(...) function should accept 1 parameter from the calling environment. The parameter is a string that contains an hash string to crack. It is responsibility of the main(...) function to internally invoke the implemented unhash(...) function only once and print its result in decimal format

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 Databases Questions!