Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago