0

I want to implement the use of the CRAM-MD5 sasl mechanism, i am taking a look at System.Security.Cryptography.HMACMD5 but don't know where to start. can any one help me , tutorials articles any thing is welcome.

Public Function CRAMMD5Credentials(ByVal userName As String, ByVal password As String, ByVal b64challenge As String) As String
    Dim cram As New System.Security.Cryptography.HMACMD5(System.Text.Encoding.ASCII.GetBytes(password))
    Dim challenge As String = System.Text.Encoding.ASCII.GetString(System.Convert.FromBase64String(b64challenge))
    Dim digest As String = System.Text.Encoding.ASCII.GetString(cram.ComputeHash(System.Text.Encoding.ASCII.GetBytes(challenge)))
    Return System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(userName & " " & digest.ToLower))
End Function
Abinonos
  • 27
  • 5

1 Answers1

0

What did you try so far? CRAM-MD5 clearly described even in Wikipedia (http://en.wikipedia.org/wiki/CRAM-MD5) and in more details in corresponding RFCs (RFC 2095, RFC 2195)

Nickolay Olshevsky
  • 13,706
  • 1
  • 34
  • 48
  • yes nickolay i did read definitions, i have no background in cryptography, but i am trying my best, i edited my question with a method that may work, the problem , i have no way to test it with a server , i tried gmail, live , no one of them is using CRAM-MD5 Sasl mechanism. – Abinonos May 17 '13 at 14:33
  • You should setup server and check it. This is simple with virtual Linuxes/Freebsds. – Nickolay Olshevsky May 17 '13 at 18:55