Since the returned data seems to be still padded with extra characters, you can get *only* the original data that was encrypted by str_replace()'ing the \x0 characters.
<?php
$decryptedData = str_replace("\x0", '', $encryptedData);
?>
![]() |
|
||||||||||
|
mcrypt_decryptDescriptionstring mcrypt_decrypt ( string cipher, string key, string data, string mode [, string iv] )mcrypt_decrypt() decrypts the data and returns the unencrypted data.
The mcrypt_decrypt
smp_info at yahoo dot com
10-Oct-2007 11:27
Since the returned data seems to be still padded with extra characters, you can get *only* the original data that was encrypted by str_replace()'ing the \x0 characters.
eddiec at stararcher dot com
13-Jul-2005 06:26
It appears that mcrypt_decrypt pads the *RETURN STRING* with nulls ('\0') to fill out to n * blocksize. For old C-programmers, like myself, it is easy to believe the string ends at the first null. In PHP it does not:
kooktroop at gmail dot com
09-Jul-2004 03:13
Following on from the mcrypt_encrypt() example: |