I'm trying to implement CRAM-MD5 authentication using pure-PHP, but the hash simply doesn't come out the way it's supposed to.
I'm using the example in RFC2195 (IMAP CRAM-MD5), and following the steps in RFC2104 (HMAC algo).
You can see what I've done so far at http://ilohamail.org/code/cram_md5.php along with the source.
TIA, Ryo
Duh....just figured it out.
For anyone who's interested, the problem was in Step 6. Instead of appending the value from Step 4 as a string, I had to append it as a binary value (using pack).