简体   繁体   中英

PHP - decrypt encrypted password

Is there any possible or easy way to decrypt this part of the encryption?

$mixpw .= chr((int) ((sqrt( (ord($_POST['passwd'][$i]) << 2) * 974169 * (ord($_POST['passwd'][$i]))) >> 1) / (314.33 * 3.14)) + 2.12);

Because of the bitwise shift, for me it seems way too complex.

This is the complete code of the encryption:

$mixpw = '';
$curM = 0;
for($i = 0; $i < strlen($_POST['passwd']); $i++) {
    if($curM == 0) {
        $mixpw .= ($i+2 < strlen($_POST['passwd'])) ? $_POST['passwd'][$i+2] : $_POST['passwd'][$i];
    } else if($curM == 1) {
        $mixpw .= chr((0x46+$i) % 254) . $_POST['passwd'][$i];
    } else if($curM == 2) {
        $mixpw .= ucfirst($_POST['passwd'][$i-2]);
    } else if($curM == 3) {
        $mixpw .= chr((int) ((sqrt( (ord($_POST['passwd'][$i]) << 2) * 974169 * (ord($_POST['passwd'][$i]))) >> 1) / (314.33 * 3.14)) + 2.12);
    }
    $curM = ($curM+1 > 3) ? 0 : $curM+1;
}

And the encrypted password is: CG3ST3KT

I managed to get the first 3 letters of the original password: s3C

I've come up with a solution! The first three encryption aren't that hard to decrypt.
But to solve the 4th one, I just copied the encryption code and tried to guess some characters following the first three. This won't take too long to guess until you get the correct encryption.
Eventually the password for this encryption is s3CReT .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM