Jump to content

how would i decode this???


almightyegg

Recommended Posts

function makeRandomPassword() {
  $salt = "abcdefghjklmnopqrstuvwxyz0123456789";
  srand((double)microtime()*1000000);
      $i = 0;
      while ($i <= 7) {
            $num = rand() % 33;
            $tmp = substr($salt, $num, 1);
            $pass = $pass . $tmp;
            $i++;
      }
      return $pass;
}

so if a password is stored as b8d06984c2d6450693a95817926fad4c is there a way to work out what it is??
Link to comment
https://forums.phpfreaks.com/topic/26491-how-would-i-decode-this/
Share on other sites



If you knew the exact microsecond the srand function was activated, you could easily. The likelyhood of that is ... slim. That string looks like a md5 encrypted string though, and I dont think PhP has the functionlity built in to decrypt md5. At present, all the information I have found about decrypting md5 is located at shady sites that I refuse to risk testing my security against.

The only other option is to guess and check. It would take a mess of processing power, but:

[code]
$salt="abcdefghjklmnopqrstuvwxyz0123456789";
$iSeed=0;
while($thisPass!='b8d06984c2d6450693a95817926fad4c'){
  srand($iSeed);
  $thisPassRaw='';
  $iLen=0;
  while ($iLen <= 7) {
      $num = rand() % 33;
      $tmp = substr($salt, $num, 1);
      $thisPassRaw= $thisPassRaw . $tmp;
      $iLen++;
  }
  $thisPass=md5($thisPassRaw);
  $iSeed++;
}

echo $thisPassRaw;[/code]

This should output the password, but with a note of warning, this could take a lot of time to process.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.