note 28897 modified in function.mcrypt-ecb by jsheets
| From: | jsheets@php.net | Date: | Mon, 27 Jan 2003 15:10:01 +0000 |
| Subject: | note 28897 modified in function.mcrypt-ecb by jsheets | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-42820@lists.php.net to get a copy of this message | ||
[Editor's Note]
It may be necessary to encode an encrypted string before storing it in your database. base64_encode
and base64_decode are one option.
I'm not sure about the specifics yet, but here is a warning: It appears that Oracle has a
problem with some of the characters that this function may return.
Here is an example:
$valueToInsertIntoOracle=
mcrypt_ecb(
MCRYPT_TripleDES,
'mraw',
'cartridges',
MCRYPT_ENCRYPT,
64
);
storeInOracle($valueToInsertIntoOracle);
$valueSelectedFromOracle = getFromOracle();
$decryptedValue=
mcrypt_ecb(
MCRYPT_TripleDES,
'mraw',
$valueSelectedFromOracle,
MCRYPT_ENCRYPT,
64
);
echo $decryptedValue;
//Should return 'cartridges' but it does not. You get a garbled mess instead.
--was--
I'm not sure about the specifics yet, but here is a warning: It appears that Oracle has a
problem with some of the characters that this function may return.
Here is an example:
$valueToInsertIntoOracle=
mcrypt_ecb(
MCRYPT_TripleDES,
'mraw',
'cartridges',
MCRYPT_ENCRYPT,
64
);
storeInOracle($valueToInsertIntoOracle);
$valueSelectedFromOracle = getFromOracle();
$decryptedValue=
mcrypt_ecb(
MCRYPT_TripleDES,
'mraw',
$valueSelectedFromOracle,
MCRYPT_ENCRYPT,
64
);
echo $decryptedValue;
//Should return 'cartridges' but it does not. You get a garbled mess instead.
http://www.php.net/manual/en/function.mcrypt-ecb.php