User-defined formula (VBA) that can convert a text value into MD5

B

Beefminator

Thank you for replying.

Am I using the correct user-defined VBA formula?
=GetMD5Hash(A1)

If so, then I am getting a weird output. I was expecting more of a text
output.
 
J

JLatham

Do your results have 32 characters and do those characters consist of the 10
digits 0-9 and letters of the alphabet from a through f? If so, then it is
probably doing it right. The 32 character count is not an absolute, but
results usually contain that number of characters.
Wikipedia has a pretty good writeup about MD5.
http://en.wikipedia.org/wiki/MD5
 
B

Beefminator

No, the formula does not produce 32 characters; it is weird looking.
Here is my excel file; take a look at it.
http://www.walkhere.com/Vba_MD5.xls

I put the text word "test" as my text input, and I should get
"098f6bcd4621d373cade4e832627b4f6"

Thanks again for looking into this,
Jason
 
J

JLatham

Well, that is rather interesting, isn't it?
I'm going to go back to ground zero and put together a workbook using the
same source that you did and see what I end up with. That will give us an
idea of whether that source code is messed up or whether you've just managed
to really hand it something it is totally unprepared to deal with.
 
J

JLatham

Some further research shows that what you are getting is probably correct
given the method being used. See this page:
http://www.excelsig.org/VBA/wwHash.htm
So what (apparently, as I understand it) is happening is that a MD5 code is
being generated AND being encrypted. What you're seeing (and I saw on my
system also) is the encrypted results?

I'm going to nose around a bit more and see if there isn't an MD5 generator
available that doesn't encrypt the result.

Although maybe it is just enough to know that the algorigthm is working and
providing consistent results? If you just use the results internally then
you don't need to be concerned with their appearance to the user - only that
a given input will result in a consistent output?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top