I need to calculate a response for an SMTP server in a challege/response authentication mechanism. There's little documentation and the RFC was confusing me so I found a tutorial online but I'm stuck it putting this tiny part here into PHP.
The client generates a digest using the following MD5 hashing algorithm (where password is null-padded to a length of 64 bytes, ipad is 0x36 repeated 64 times and opad is 0x5C repeated 64 times):
"password" is a variable that I know, and "challege" is also a variable I've decoded.... I'm just not sure how that C code translates to PHP. Namely, the outer MD5() has 3 paramaters in it
Weirdan wrote:That depends on implementation of your MD5 function in C. Could you post it?
Doh! No I don't have that since I didn't write it... It's just what was written in this little tutorial.
I think I've just found a little library of SASL mechanisms on pear.php.net actually and CRAM-MD5 is in there (that's this thing) so I'll look how they do it