md5 hashses

Discussion in 'ASP .Net' started by Lee Atkinson, Jun 22, 2010.

  1. Lee Atkinson

    Lee Atkinson Guest

    HI guys,

    Im having trouble replicating the format of a MD5 hashed list of passwords
    ive been sent from a client .... They all appear to be in this kind of
    format - "d41d8cd98f00b204e9800998ecf8427e"

    However when I try to hash some clear text passwords using something like
    this -

    byte[] pass = Encoding.UTF8.GetBytes(cleartextpassword);
    MD5 md5 = new MD5CryptoServiceProvider();
    string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass));
    return strPassword;

    The format comes up with all kinds of usual characters, not just alpha
    numeric like the list provided, Also tried converting to base64 but that's
    not right either.

    I finally looked at -
    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("
    password", "MD5"))

    Which produces the right format but I cant find any code to see whats going
    on behind the scenes with this.... Any one got any ideas how this is
    generated?

    Cheers
    Lee
     
    Lee Atkinson, Jun 22, 2010
    #1
    1. Advertising

  2. Lee Atkinson

    Lee Atkinson Guest

    Ah... Ive found the function to format it -

    Function byteArrayToHexString(ByVal a) As String
    Dim r, b, i
    r = ""
    For i = 0 To UBound(a)
    b = Hex((a(i) And &HF0) / 16) & Hex(a(i) And &HF)
    r = r & b
    Next
    byteArrayToHexString = r
    End Function






    On 22/06/2010 09:27, in article C8463282.A81D%, "Lee
    Atkinson" <> wrote:

    > HI guys,
    >
    > Im having trouble replicating the format of a MD5 hashed list of passwords
    > ive been sent from a client .... They all appear to be in this kind of
    > format - "d41d8cd98f00b204e9800998ecf8427e"
    >
    > However when I try to hash some clear text passwords using something like
    > this -
    >
    > byte[] pass = Encoding.UTF8.GetBytes(cleartextpassword);
    > MD5 md5 = new MD5CryptoServiceProvider();
    > string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass));
    > return strPassword;
    >
    > The format comes up with all kinds of usual characters, not just alpha
    > numeric like the list provided, Also tried converting to base64 but that's
    > not right either.
    >
    > I finally looked at -
    > System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("
    > password", "MD5"))
    >
    > Which produces the right format but I cant find any code to see whats going
    > on behind the scenes with this.... Any one got any ideas how this is
    > generated?
    >
    > Cheers
    > Lee
    >
     
    Lee Atkinson, Jun 22, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Afonin

    How to generate an MD5 data from the string

    Peter Afonin, Aug 20, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    499
  2. Peter Afonin

    MD5 conversion problem

    Peter Afonin, Aug 27, 2004, in forum: ASP .Net
    Replies:
    15
    Views:
    807
    Peter Afonin
    Sep 1, 2004
  3. Jason Williard

    Encrypt Password w/MD5

    Jason Williard, Oct 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    597
    Steve C. Orr [MVP, MCSD]
    Oct 17, 2004
  4. Replies:
    9
    Views:
    17,202
    John Salerno
    May 8, 2006
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    240
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page