Results 1 to 11 of 11
  1. #1
    Join Date
    May 2007
    Posts
    139

    Unanswered: want now convert the site password system to md5 coding

    I have a database with Customers table that includes a password field, want now convert the site password system to md5 coding, well, as of db what required?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

  3. #3
    Join Date
    May 2007
    Posts
    139

    prior data in that field char 32 (now char 32 md5) what should happen

    If I have a db table with full of data and a field get converted to md5 char 32, then with prior data in that field char 32 (now char 32 md5) what should happen?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so change your exisitng data
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    May 2007
    Posts
    139
    you mean manually from string $field1 in the field prior, create md5 code $field1md5=md5($field1); // and replace the field in the records...? or, if in phpMyAdmin convert db table field to md5 this done automatically(I mean the data in field conversion)? what stands?

  6. #6
    Join Date
    May 2007
    Posts
    139
    in phpMyAdmin, how convert an existing field, to md5, i do not see it in EDIT field web form? or, there is no such and md5 is normal varchar text fields in mysql 5.0?

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    md5 is an encryption function
    its not a storage function
    so when you decide to implement your MD5 encryption change the existing passwords using a query

    eg
    update mytable set mypasswordcolumn = md5(mypasswordcolumn)

    MySQL :: MySQL 5.5 Reference Manual :: 11.13 Encryption and Compression Functions
    take note fo the comments regarding the suggested storage for MD5 value.

    it may be smarter to to create a new column, shift the old vales to that new column, then drop the old column.
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    May 2007
    Posts
    139
    you mean the db field remains the same... not need modify....?
    just the pre-existing values MUST GET CONVERTED to md5 and the new ones added as MD5?

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its your design you do what you want
    you have two issues
    one is the phasing in of the new password encryption
    the other is handling existing data
    how you do it is up to you

    if you read the suggested reference MySQL recommend that you use binary datatype then you will need to transfer your existing passwords to that new column.

    if you choose to store the MD5 hash as character then you could use the existing type
    essentially its up to you to deicee which approach you want to take
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    May 2007
    Posts
    139
    update mytable set mypasswordcolumn = md5(mypasswordcolumn)

    this works?

  11. #11
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you replace
    mytable with the name of your table
    mypasswordcolumn witht hew name of your column containing the password

    however the safe approach is to set the value into a new column )so the old passwords aren't lost. going down this route is a one way street, you cannot recover the plaintext password once you use the inbuilt MySQL function MD5()

    probably the best approach is to declare a new column of Binary and then use the MD5 function to update that column
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •