0

I have very simple query .

I am fetching user name and password from a Mysql DB using php.

The password is in md5() encoded. Can any one help me out

script

while($rfg=mysql_fetch_array($rc)){
            //print_r($rfg);
              echo $_POST['im_password'] = $rfg['Password'];
              echo $_POST['im_user'] = $rfg['Nombre'];

        }

how I can decode the md5 password to real text in php ??

Thanks in Advance

Vikram Anand Bhushan
  • 4,836
  • 15
  • 68
  • 130

2 Answers2

0

The point of using md5 is that you CANT decrypt it that easely. You could for example use it to compare md5(user_input) with the hash in the database (login system).

If you really need to get a plain-text (which I dont support) you could try using dictionary-attacks. Everything beside that (bruteforcing) wouldnt be worth it according to the needed calculation power.

C4d
  • 3,183
  • 4
  • 29
  • 50
-1

MD5 can't be decoded unless you are using rainbow tables. The way to check if a user entered a correct password is to hash his entered password with md5 and check it with the password in the database.

Sonaryr
  • 1,092
  • 1
  • 10
  • 24
  • 1
    Not exactly correct. The best way would be using bruteforcing which would be a question of time. There is no guarantee to decrypt it with a rainbow-table. Not to mention it wouldnt even be real "decrypting". – C4d Nov 27 '14 at 13:00
  • 1
    You're not necessarily guaranteed to have found the original password, even if you do brute force or rainbow table correctly, you can only say that you've found a match, it may be a clash – Mark Baker Nov 27 '14 at 13:07
  • @MarkBaker: Hah yeah. Taking the possibilities really strong you are right. I have to say I never got that case. At least not for something beside strings like "1234". – C4d Nov 27 '14 at 13:24