MD5 hash generator (1 Viewer)

irade92

Registered User.
Local time
Today, 14:33
Joined
Dec 26, 2010
Messages
229
Hi
how to use MD5 Hash generator in VBA. I need it to get some info in XML format from a server.
Thanks
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,172
In general, you don't need to do this because the IP software that generates your connection protocol includes this based on entry of a password or other credentials. So if you really DO need to do this, you are obviously "rolling your own protocol" in some way that isn't a normal connection or that has some special requirements.

You need to work with the "Crypto API" and here is a link:

https://msdn.microsoft.com/en-us/library/ms867086.aspx

Here is some sample code you can look at in VBA.

https://www.mvps.org/emorcillo/en/code/vb6/hash.shtml

Since I always allowed my protocol stack to do the API calls, I have not used this. But at least I am familiar enough with it to offer some references that might help.
 

irade92

Registered User.
Local time
Today, 14:33
Joined
Dec 26, 2010
Messages
229
Thanks The_Doc-man

Actually I need this:

xml = "<?xml version='1.0' encoding='UTF-8' ?>" & vbNewLine _
& "<request>" & vbNewLine _
& "<public_key>" & broj & "</public_key>" & vbNewLine _
& "<auth_token>" & "MD5(username.pasword)" & "</auth_token>" & vbNewLine _
& "<invoice_number>208155</invoice_number>" & vbNewLine _
& "<invoice_date>2014-04-01</invoice_date>" & vbNewLine _
& "</request>" & vbNewLine

see the line "MD5(username.password)" ..
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:33
Joined
May 7, 2009
Messages
19,237
Md5 is Mon reversible code.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,172
OK, you are using a method that compares hashed passwords rather than literal passwords. It makes sense, but be aware that if someone is tapping your transmission and you are not using HTTPS or TLS or SFTP or some other secured / encrypted method, your password hash is no more secure than sending the literal password. OK, I know it is a requirement for your situation, just commenting.

The Crypto API can generate an MD5 hash. The second reference I listed shows you some VBA code on how to do that.
 

irade92

Registered User.
Local time
Today, 14:33
Joined
Dec 26, 2010
Messages
229
OK, you are using a method that compares hashed passwords rather than literal passwords. It makes sense, but be aware that if someone is tapping your transmission and you are not using HTTPS or TLS or SFTP or some other secured / encrypted method, your password hash is no more secure than sending the literal password. OK, I know it is a requirement for your situation, just commenting.

The Crypto API can generate an MD5 hash. The second reference I listed shows you some VBA code on how to do that.

Thank you Certified Grand Pa..Enjoy...
 

Users who are viewing this thread

Top Bottom