I am implementing digest-md5 in J2ME.In the computation of the client response, the following steps are given:
- Create a string of the form "username:realm:password". Call this string X.
- Compute the 16 octet MD5 hash of X. Call the result Y.
- Create a string of the form "Y:nonce:cnonce:authzid". Call this string A1.
- Create a string of the form "AUTHENTICATE:digest-uri". Call this string A2.
- Compute the 32 hex digit MD5 hash of A1. Call the result HA1.
- Compute the 32 hex digit MD5 hash of A2. Call the result HA2.
- Create a string of the form "HA1:nonce:nc:cnonce:qop:HA2". Call this string KD.
- Compute the 32 hex digit MD5 hash of KD. Call the result Z.
Does anyone here know how to implement step 2? I have a md5 function that returns a 32 hex digit but i don't know how to compute a 16 octet md5 hash?
I just would like to reiterate that I am using J2ME. In that case I can not simply use MessageDigest.
Thank you in advance. :)