MD5 Hash Question

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

MD5 Hash Question

Post by jsonnabend » Sun Feb 08, 2009 3:13 pm

I'm messing with some code to communicate with EventGhost over a network.

I'm sending 'quintessence' and getting back a four character cookie. I'm not sure I'm calculating the MD5 hash correctly. Can someone confirm that, with no password set, the has should be calculated on COOKIE+ ":" with nothing after the ":"? In other words, if the cookie is "1ab2" then the hash should be calculated on "1ab2:" .

Also, I should be sending MD5HASH + \n, correct?

TIA

- Jeff

jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Re: MD5 Hash Question

Post by jsonnabend » Tue Feb 10, 2009 8:28 pm

BUMP

Nothing, huh? :(

User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: MD5 Hash Question

Post by jinxdone » Wed Feb 11, 2009 1:46 pm

Hello.

I assume you have looked in the network sender and network receiver code? The code looks pretty simple to follow and with a quick look It seems to me like you are correct in your string forming and hashing..

So are you having a problem with it or..? There was some prior discussion about this plugin in this thread, maybe you are also having trouble with wrong newline/carriage return characters that end of the string you are sending?

-jinxdone

jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Re: MD5 Hash Question

Post by jsonnabend » Wed Feb 11, 2009 2:10 pm

I did recall that thread, and was able to catch the CR/LF issue. I am sending the quintessence part no problem and then receiving a four character "cookie" from EG. I then add the colon, run the hash and send it back to EG with a LF appended. I then get nothing but silence from EG.

- Jeff

jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Re: MD5 Hash Question

Post by jsonnabend » Wed Feb 11, 2009 2:19 pm

Ah! Found the error. I was stripping the LF off of the cookie, storing it in a new variable, and then using the old, non-stripped cookie to generate the hash! Duh. Thanks for the info. I will play some more this weekend.

- Jeff

User avatar
Melloware
Plugin Developer
Posts: 86
Joined: Mon May 12, 2008 6:18 pm

Re: MD5 Hash Question

Post by Melloware » Thu Feb 19, 2009 6:27 pm

jsonnabend wrote:Ah! Found the error. I was stripping the LF off of the cookie, storing it in a new variable, and then using the old, non-stripped cookie to generate the hash! Duh. Thanks for the info. I will play some more this weekend.

- Jeff
Yep that bit me too when i was working on the EventPhone iPhone stuff. I modeled it after the Network Receiver code but could not quite figure it out when sending from the iPhone. Turned out to be CR LF issues also.
-----------------------------------
Melloware Inc.
EventPhone iPhone Application
Intelliremote - HTPC Remote Application
-----------------------------------

Post Reply