I update my server from 5.45 to 7.1 after that I am getting an error.
I am getting the issue in decryptIt function
.
function encryptIt( $q ) {
$cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
$qEncoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
return( $qEncoded );
}
function decryptIt( $q ) {
$cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
$qDecoded = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $q ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "\0");
return( $qDecoded );
}
I am encrypting the id using below code so that I can display the URL something like this uYxnJrS3aLv0JbJFLnnmW4TRRpF6%2FYB0JD6LUhPYu0U%3D#
$p_id=10;
$encrypted_user_id1 = encryptIt($p_id);
$p_user_id1=urlencode($encrypted_user_id1);
And decrepting it so that I will get the $p_id=10
on my page
$decrypted_p_id = decryptIt($p_id);
But I am getting error now
Deprecated: Function mcrypt_decrypt() is deprecated
Would you help me out in this?