SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Encrypt Data Already Stored in DB

    I'm looking for a way to UPDATE a table to MD5() all my stored passwords.

    I was hoping a simple subquery passed to the MD5 method would be all it would take.

    UPDATE users SET id = MD5((SELECT id FROM users))

    No such luck.


    Any advice?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,408
    Mentioned
    149 Post(s)
    Tagged
    4 Thread(s)
    Code:
    UPDATE users SET id = MD5(id)
    But you really should use a salt to make the MD5 more secure.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for that super fast reply. Note taken on the salt.

  4. #4
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Are you trying to MD5 your user's ID, or the password field?


Bookmarks

Posting Permissions

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