简体   繁体   English

PHP-解密加密密码

[英]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 加密的密码为: CG3ST3KT

I managed to get the first 3 letters of the original password: s3C 我设法获得了原始密码的前3个字母: 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 . 最终,此加密的密码是s3CReT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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