-1

我正在尝试解密从越狱的 iphone 中获取的密码,但我不知道为什么当我将 $_get 值放入函数时,RNCryptor 解密函数总是返回空值,但是当我放入原始数据时它工作正常解密函数。有人知道这个问题吗?这是返回空值的代码:

if(isset($_GET['info'])){

    $password = "mykey"
    $base64Encrypted = $_GET['info'];
    $cryptor = new \RNCryptor\Decryptor();
    $plaintext = $cryptor->decrypt($base64Encrypted, $password);
    echo $plaintext;//=> this code block return null value

}else{
    echo 'not have info params';
}

但是当我输入原始密码数据时,这个代码块运行良好:

if(isset($_GET['info'])){

    $password = "mykey"
    $base64Encrypted = 'AwEEeG/CU0VHXVGvuRcm805DvvVQi32NPjmlQxoaniIL9ngCjNY1Su4jEb2IfCILBvhKIdjl1znysm6SMiFmRZi2St8wCcWCmnImdwAPLysB/g==';
    $cryptor = new \RNCryptor\Decryptor();
    $plaintext = $cryptor->decrypt($base64Encrypted, $password);
    echo $plaintext;//=> this code block return the original value of cipher

}else{
    echo 'not have info params';
}
4

1 回答 1

0

抱歉,我只是发现 $_get 参数只是在通过 URL 发送时被编码,所以所有的 '+' 字符都已更改为空格字符。这是我的解决方案:

 $password = "mykey";
    $stringCipher = explode('?info=', $_SERVER['REQUEST_URI'], 2);
    $base64Encrypted = $stringCipher[1];
    $cryptor = new \RNCryptor\Decryptor();
    $decryptSerial = $cryptor->decrypt($base64Encrypted, $password);
于 2016-06-25T16:58:30.880 回答