MD5 issue

Discussion in 'ASP .Net Security' started by Chris Newald, Nov 2, 2006.

  1. Chris Newald

    Chris Newald Guest

    Hello there,

    Not sure if I'm in the right newsgroup but here it is anyway...

    I store web passwords by encrypting them using a simple MD5 .dll I wrote a
    little while ago using C#. User passwords are stored as binary data in the
    database. When a user enters his/her password the newly entered password is
    encrypted and the new binary arrays are compared to those in the database.
    Long story short, no one besides the user can know the password.

    Recently I needed to recompile the .dll. After recompiling none of the
    passwords work. The new binary arrays are different than the ones in the
    database. My old .dll still works but the newly compiled one does not.

    Why would recompiling the dll change the way the same passwords are
    encrypted?

    Also, I've compared the files using a file compare and they are identical.

    I need to recompile the file and I have a number of users who can't get
    locked out of the site. Any help would be appreciated.

    Thanks,
    Chris


    My encryption function:

    public byte[] encryptPassword(string passwordString, string salt)
    {
    byte[] encryptedPass;
    string password;
    System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher;
    System.Text.UTF8Encoding encoder;

    // Generate a secure password string to encript
    password = passwordString.Trim() + salt;

    encoder = new System.Text.UTF8Encoding();
    md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider();
    encryptedPass =
    md5Hasher.ComputeHash(encoder.GetBytes(passwordString.Trim()));

    return encryptedPass;
    }
    Chris Newald, Nov 2, 2006
    #1
    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:
    480
  2. Peter Afonin

    MD5 conversion problem

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

    Encrypt Password w/MD5

    Jason Williard, Oct 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    584
    Steve C. Orr [MVP, MCSD]
    Oct 17, 2004
  4. Replies:
    9
    Views:
    17,083
    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:
    209
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page