解密它,我已經在PHP以下加密班組長加密查詢字符串和PHP
define(ENCRYPTION_KEY,"abcdegef");
define(INITIALIZATION_VECTOR,mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB), MCRYPT_RAND));
function EncryptString($input)
{
$encrypted_string = mcrypt_encrypt(MCRYPT_DES, ENCRYPTION_KEY, $input, MCRYPT_MODE_CBC, INITIALIZATION_VECTOR);
return base64_encode($encrypted_string);
}
function DecryptString($encryptedInput)
{
$decrypted_string = mcrypt_decrypt(MCRYPT_DES, ENCRYPTION_KEY, base64_decode($encryptInput), MCRYPT_MODE_CBC, INITIALIZATION_VECTOR);
return $decrypted_string;
}
,並且對與查詢字符串錨標記網址對此我加密
<a href="SomePage.php?action=<?php include_once ('EncryptionLibrary.php');
echo EncryptString("IamData"); ?>
當我試圖解密它在SomePage.php使用以下代碼..我得到解密值不正確
if (isset($_GET["action"]))
{
echo trim(DecryptString($_GET["action"]));
}
我正在通過加密 >「 – 2009-12-16 13:54:13