php 无法从 RNCryptor 上的 $_get 请求中解密密码
php can't decrypt the cipher from $_get request on RNCryptor
我正在尝试解密从越狱中获取的密码 iphone 但我不知道为什么当我将 $_get 值设置为时 RNCryptor 解密函数总是 return 空值功能,但是当我将原始数据用于解密功能时它工作正常。有人知道这个问题吗?
这是 return 空值的代码:
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';
}
抱歉,我刚刚发现 $_get 参数在通过 URL 发送时被编码,所以所有 '+' 字符都已更改为 space 字符。这是我的解决方案:
$password = "mykey";
$stringCipher = explode('?info=', $_SERVER['REQUEST_URI'], 2);
$base64Encrypted = $stringCipher[1];
$cryptor = new \RNCryptor\Decryptor();
$decryptSerial = $cryptor->decrypt($base64Encrypted, $password);
我正在尝试解密从越狱中获取的密码 iphone 但我不知道为什么当我将 $_get 值设置为时 RNCryptor 解密函数总是 return 空值功能,但是当我将原始数据用于解密功能时它工作正常。有人知道这个问题吗? 这是 return 空值的代码:
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';
}
抱歉,我刚刚发现 $_get 参数在通过 URL 发送时被编码,所以所有 '+' 字符都已更改为 space 字符。这是我的解决方案:
$password = "mykey";
$stringCipher = explode('?info=', $_SERVER['REQUEST_URI'], 2);
$base64Encrypted = $stringCipher[1];
$cryptor = new \RNCryptor\Decryptor();
$decryptSerial = $cryptor->decrypt($base64Encrypted, $password);