我正在尝试解密加密的字段。当我尝试解密它时,我收到错误500内部服务器错误。这是我第一次使用MySQL进行加密所以我确定我错过了一些东西。这是代码
$mysqli = mysqli_connect(###SETTINGS HERE#####);
$job_sql = "SELECT * FROM apples WHERE id =1";
$job_result = mysqli_query($mysqli, $job_sql) or die(mysqli_error($mysqli));
while ($info = mysqli_fetch_array($job_result)) {
$encrypted = stripslashes($info['enc_text']);
$org_text = stripslashes($info['org_text']);
}
mysqli_free_result($job_result);
$key = "JARD01776"; //each key is unique to acct
$decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
echo "decrypted value";
echo "$decrypted":
echo "$org_text";
我很感激任何想法。