[sync] MD5 authentication

Erik Gustavsson cyrano at area26.no-ip.org
Sun Jul 9 05:58:11 PDT 2006


Hmmm, maybe I should code more and post less.

I did get my PHP code to match the example given in 
"OMA-TS-SyncML-DataSyncRep-V1_2-20060316-C.pdf".

However, it's interesting to note that the documents for version 1.1 and 
1.2 both seem to have the same MD5 value in the examples 
(Zz6EivR3yeaaENcRN6lpAQ==), while using different inputs. Only the 1.2 
version seems to actually match...

Here is my test code:

---

<?php

function md5_base64($data)
{
    return base64_encode(pack('H*',md5($data)));
}

function md5_syncml_new($user,$pass,$nonce)
{
    return md5_base64(md5_base64($user.":".$pass).":".$nonce);
}

    print md5_syncml_new("Bruce2","OhBehave","Nonce");
    print "Zz6EivR3yeaaENcRN6lpAQ==";

?>

---

And the output I get from running it:

Zz6EivR3yeaaENcRN6lpAQ==Zz6EivR3yeaaENcRN6lpAQ==

/Erik


More information about the sync mailing list