?

Log in

No account? Create an account
Challenge/Response Protocol - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Challenge/Response Protocol [Apr. 19th, 2004|01:03 am]
LiveJournal Client Discussions

lj_clients

[krolain]
Greetings everyone,

I've been trying to use the new Challenge/Response protocol to log in, but everytime I use it, it returns invalid password.

From what I gather from the document, it seems simple enough, but I cannot get it to work. Has anyone else gotten that to work successfully?

The pseudo-code I'm doing is basically this:

  1. MD5 HEX the password, then convert to string
  2. Append the converted password string at the end of the challenge string from server
  3. MD5 HEX the resulting string and send that to the server.


I've also tried not converting the MD5 HEX password to string, but keep it in byte format, and just append that to the end of the challenge string (converted to bytes), then MD5 digest the resulting byte array, but that also fails.

Granted, debugging does make many of the challenge expire, but I know it's not an expired problem. I actually get 'invalid password' from the server.

I've even tried to force the password string and challenge string to be in "UTF-8" byte format, but it doesn't work either. So, I am now wondering if this Challenge/Response protocol is working properly on the server, or am I missing something?

I am using the flat protocol, though I don't think that is the issue? I can get the MD5 plain password to work.

Help please?
linkReply

Comments:
[User Picture]From: marksmith
2004-04-19 08:17 am (UTC)
http://www.livejournal.com/doc/server/ljp.csp.auth.challresp.html

That has some Perl code to use the challenge response mode. Check it out and see if that works for you.
(Reply) (Thread)
[User Picture]From: krolain
2004-04-19 09:10 am (UTC)
I already looked at that link and that's where I got the basis for my own code and all. Unfortunately, it didn't answer my problem. Even with that link I spent a good few hours trying to figure it out. Now, I think I figured out the problem.

I managed to change a few things in my code, and I think what the main issue was is that the MD5 digested password string had to be in lower case. My MD5 digested password was generated in upper case, and when I merged that with the challenge and digested that, it generated the wrong response I guess. I got the hint from avva.

So, it now works, and all because of wrong case.
(Reply) (Parent) (Thread)