P/Invoking MD5 retruns same results for different input...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a class that I wrote the p/Invokes the WinCE Cryptography functions so
that I can encrypt passwords using MD5. This code seemed to be working
properly until a bug was discovered today, and I need help trying to work
around this...maybe someone has experienced this before.

If I has the value "asdfg" and "asdfh", I get the EXACT same values
returned. However, if "asdfg" and "qsdfg" return totally different values.
It seems the problem only lies in the LAST character...another example "11"
and "12" has to the same thing, but "21" hashes to something totally
different...here is the data I am passing in to be hashed...it is a byte
array.

here is the byte array I pass in to be hashed for the srtring "asdfg"

- m_Bytes {Length=256} byte[]
[0] 97 byte
[1] 0 byte
[2] 115 byte
[3] 0 byte
[4] 100 byte
[5] 0 byte
[6] 102 byte
[7] 0 byte
[8] 103 byte
[9] 0 byte

here is the byte array I pass in to be hashed for the srtring "asdfh"

- m_Bytes {Length=256} byte[]
[0] 97 byte
[1] 0 byte
[2] 115 byte
[3] 0 byte
[4] 100 byte
[5] 0 byte
[6] 102 byte
[7] 0 byte
[8] 104 byte
[9] 0 byte

Clearly the byte arrays are different, so how come I am getting back the
same hashed byte array in return...both hash to this value.

- Hashedup {Length=16} byte[]
[0] 238 byte
[1] 115 byte
[2] 131 byte
[3] 168 byte
[4] 175 byte
[5] 197 byte
[6] 251 byte
[7] 84 byte
[8] 74 byte
[9] 28 byte
[10] 231 byte
[11] 129 byte
[12] 130 byte
[13] 118 byte
[14] 236 byte
[15] 228 byte

A prompt response is super appreciated as my deadline is looming! Thanks
alot!
 
Back
Top