<?php
if($_SERVER['REQUEST_METHOD']=='POST'){
require_once('ConnectUsers.php');
$email = $_POST['email'];
$password = $_POST['password'];
$encrypt_pass= encryptIt($password);
$sql="Update Subscriber_Login SET SubsPassword = '$encrypt_pass' where EmailId = '$email'";
if(mysqli_query($conn,$sql)){
echo 'password updated';
}
else{
echo 'oops! Please try again!';
}
function encryptIt( $q ) {
$cryptKey = 'mjn2Wb5wM46uBehwuabh';
$qEncoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q,
MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
return( $qEncoded );
}
}
?>
that is my code which is used to reset the password in my website, here the encryption method I am using is not seem to be working in newer PHP versions like 7.2 (current PHP version), it was working fine in older versions so what could I do now, I can not change the encryption method now as too many passwords have been encrypted using this..so i would like to know the workaround for this issue.