I have a code that goes something like:
$cipher_alg = MCRYPT_RIJNDAEL_128; $decrypted_string = mcrypt_decrypt($cipher_alg, $key, $encrypted_string , MCRYPT_MODE
After 24 hours of research, finally this worked for me:
function removePadding($decryptedText){ $strPad = ord($decryptedText[strlen($decryptedText)-1]); $decryptedText= substr($decryptedText, 0, -$strPad); return $decryptedText; }