MD5 Decryption

Discussion in 'PHP' started by strgraphics, Jun 19, 2010.

  1. #1
    i am going to store the users passwordds using

    $pass=md5($_POST['pass']);
    PHP:

    and they are successfully went to database..!
    but how to decrypt those passwords...,

    if user click on forget password it will fetch the particular password.., and sent to mail but it was sending the encrypted... one.

    how to decrypt before i send to those mails.
     
    strgraphics, Jun 19, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    roopajyothi, Jun 19, 2010 IP
  3. Cozmic

    Cozmic Member

    Messages:
    146
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #3
    Just generate a new password. You would do this by using mt_rand() to get a random number, then hashing it with sha1(), then finally substr()-ing it to a couple characters long. MD5 can't be decrypted practically. The only real way is to compare it to the hash of a string until you find a match.
     
    Cozmic, Jun 19, 2010 IP
  4. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    ohh k k thanks friends..!
     
    strgraphics, Jun 19, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    yeah use Sha1 instead of Md5 they are more secure and unbreakable :)
     
    roopajyothi, Jun 19, 2010 IP
  6. darkdrgn2k

    darkdrgn2k Active Member

    Messages:
    159
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    MD5s are unreversable encryption,

    if a user provides you with a password, you can only encrypt that password and compair it to the one on file, you dont DECRYPT it :)


    PS: Remember to SALT your MD5's to :)
     
    darkdrgn2k, Jun 19, 2010 IP
  7. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    i tried Cozmic process, about sha1
    but not understand clearly. any body explain me how to make forget password page with simple example, for MD5 based passwords.

    Thanks..!
     
    Last edited: Jun 20, 2010
    strgraphics, Jun 20, 2010 IP
  8. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #8
    For MD5 As i said that Generate a New Password and update that in DB with MD5 encryption and send that generated password to the user!
    If you cant do that still i can solve that for some bucks
     
    roopajyothi, Jun 20, 2010 IP
  9. clox.c

    clox.c Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you can not decrypt an hash -- if you're lucky the user has been so dumb to type in something like "duck" or "mom" as their password and you're able to look it up in some md5 database.

    that would be of no use, though, so just send another random password upon request.
     
    clox.c, Jun 20, 2010 IP
  10. ttyler333

    ttyler333 Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #10
    I once created a hash that was MD5-salt-SHA1-salt but i was told it would not work because it would interfere with the other encryptions. Anywho i did not come crossed an issue and successfully secured my site. IF you wanted to you could record to another section of the database to store the encrypted version and the normal string. This of course is just the same as not having any md5 encryption. Well best of luck :)
     
    ttyler333, Jun 20, 2010 IP
  11. K1llswitch

    K1llswitch Member

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #11
    Best solution is stated above, have them input their email and then once the email is confirmed to be associated with an account, say a new password is being sent to that email, and just change the password for them, send the new password, then when they login request the password to be changed again.
     
    K1llswitch, Jun 20, 2010 IP
  12. ttyler333

    ttyler333 Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #12
    yeah, i know i do that now too but i guess i should of mentioned it. That is how alot of sites do it. If a site sends you your password that you previously used, i would recommend not using that site.
     
    ttyler333, Jun 20, 2010 IP
  13. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #13
    ya finally i created forget password script...! for Md5,

    thanks a lot for your replies...,!
     
    strgraphics, Jun 20, 2010 IP