-1

Well, I kinda have a task where I have to take a file and generate MD5 hash of that file. Problem is that I can't really use any classes that would automate this processes so everything has to be programmed manually. And that prob would mean that I can't use java.security.MessageDigest >> getInstance("MD5") to get an MD5 message. So yeah I am not really sure how to write needed algorithm because it seems that everyone uses MessageDiggest Class. Any ideas?

Jame Moore
  • 11
  • 2
  • 2
    I don't really understand why you can't use `MessageDigest`. But if you want you can read the specification (https://www.ietf.org/rfc/rfc1321.txt) and write a program to implement it. Make sure you test it extensively. – Henry Feb 27 '19 at 12:44
  • 1
    I agree with Henry. When testing, be sure to validate your implementation by comparing the MD5 hashes generated with it with MD5 hashes generated by another implementation that is known to be correct. – Stephen C Feb 27 '19 at 12:48

2 Answers2

0

Well I see 2 options:

Benoit
  • 5,118
  • 2
  • 24
  • 43
0

I found this implementation of MD5: https://rosettacode.org/wiki/MD5/Implementation#Java

I haven't tested if this is 100% correct though