Hi fellows, I'm writing a simple cracker for MD5. The hash value has to be passed at command line as argument.
e.g.
java Cracker 0cc175b9c0f1b6a831c399e269772661
In order to decode the hash value I'm using a brute force approach: therefore I compare a series of strings with the hash value by using the method of the class MessageDigest isEqual(byte[] a, byte[] b). So I encode each string and compare the byte array I get with the byte array of the hash value.
Here it comes the trouble I'm in:
when I try to get a bytes array of the MD5 hash value passed as argument of the program , I do get something, but it's not something that the isEqual method of MessageDigest can use to compare. As a result any attempt during the execution of brute force fails, even though the key is one of the string being checked.
Perhaps am I facing a format problem? Any idea?
Sorry for my english, it's not my first language
Thanks to whoever will help