PHP -解密加密密码


PHP - decrypt encrypted password

是否有任何可能或简单的方法来解密这部分加密?

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

由于按位移位,对我来说似乎太复杂了。

加密的完整代码:

$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;
}

加密密码为:CG3ST3KT

我设法得到了原密码的前3个字母:s3C

我想到了一个解决办法!前三个加密并不难解密。
但为了解决第四个问题,我只是复制了加密代码,并尝试猜测前三个字符后面的一些字符。在得到正确的加密之前,这不会花太长时间来猜测。
最终,此加密的密码为s3CReT