Hi All,
I wonder if anyone here can help me. I have an algorithm to decrypt a password from a
string and i am struggling to decrypt it. The algorithm itself shows an example and i tried the example but i cant get the results that were shown in the example to match with the result in my sample code.
Here is the algorithm.
1.First get the bytes of the original password, assuming a "Latin-1" encoding. For the password "Baltimore1," these bytes are: 66 97 108 116 105 109 111 114 101 49 44 (i.e. the value of "B" is 66, "a" is 97, etc).
2.Then get the MD5 hash of these bytes. MD5 is a standard, public algorithm. Once again, for the password "Baltimore1," these bytes work out as: 223 238 161 24 62 121 39 143 115 167 51 163 245 231 226 94
3.Finally, create the new password by forming a string whose Latin-1 encoding is the bytes from the previous step. For the "Baltimore1," password, if this is string is written to the screen, it looks like: ���_>y'?s�3����^(i.e. the 62 above is a ">", the 121 is a "y", etc).
To try the above, i tried to get the string shown in step 3 using the "Baltimore1," password. Here is the code that i wrote.
And here is the output of the above program.
As you can see, the output of line 1 is correct. The bytes are exactly as described in the example. I was expecting the output on line 4 to be 223 238 161 24 62 121 39 143 115 167 51 163 245 231 226 94 as shown in the example. Does anyone know what i am doing wrong?